aboutsummaryrefslogtreecommitdiff
path: root/textproc/ibus-typing-booster/Makefile
blob: 87eafb8494d030587142da9ca139563fe002e313 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
PORTNAME=	ibus-typing-booster
PORTVERSION=	2.25.3
CATEGORIES=	textproc

MAINTAINER=	thierry@FreeBSD.org
COMMENT=	Faster typing by context sensitive completion
WWW=		https://mike-fabian.github.io/ibus-typing-booster/

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/COPYING

BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}xdg>0:devel/py-xdg@${PY_FLAVOR}		\
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR}
LIB_DEPENDS=	libibus-1.0.so:textproc/ibus	\
		libm17n.so:devel/m17n-lib
RUN_DEPENDS=	CLDR>0:textproc/CLDR	\
		${PYTHON_PKGNAMEPREFIX}xdg>0:devel/py-xdg@${PY_FLAVOR}		\
		${PYTHON_PKGNAMEPREFIX}dbus>0:devel/py-dbus@${PY_FLAVOR}		\
		${PYTHON_PKGNAMEPREFIX}hunspell>0:textproc/py-hunspell@${PY_FLAVOR}	\
		${PYTHON_PKGNAMEPREFIX}pycountry>0:textproc/py-pycountry@${PY_FLAVOR}	\
		${LOCALBASE}/share/unicode/ucd/Index.txt:textproc/UCD			\
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR}
TEST_DEPENDS=	${LOCALBASE}/share/hunspell/cs_CZ.dic:textproc/cs-hunspell	\
		${LOCALBASE}/share/hunspell/de_DE.dic:german/hunspell		\
		${LOCALBASE}/share/hunspell/en_US.aff:textproc/en-hunspell	\
		${LOCALBASE}/share/hunspell/es_ES.dic:textproc/es-hunspell	\
		${LOCALBASE}/share/hunspell/it_IT.dic:textproc/it-hunspell	\
		${LOCALBASE}/share/hunspell/ko_KR.aff:korean/hunspell		\
		${LOCALBASE}/share/hunspell/sv_SE.dic:textproc/sv-hunspell	\
		${LOCALBASE}/libexec/ibus-engine-m17n:textproc/ibus-m17n	\
		${LOCALBASE}/share/m17n/hi-inscript2.mim:devel/m17n-inscript2	\
		${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR}	\
		gmake:devel/gmake

USE_GITHUB=	yes
GH_ACCOUNT=	mike-fabian

USES=		autoreconf desktop-file-utils gettext gmake gnome iconv pathfix	\
		pkgconfig python shebangfix
SHEBANG_FILES=	engine/emoji-picker.in engine/ibus-engine-typing-booster.in	\
		setup/ibus-setup-typing-booster.in
SHEBANG_LANG=	sh
sh_OLD_CMD=	/usr/bin/sh
sh_CMD=		${SH}
USE_GNOME=	glib20 gtk30 pygobject3
USE_LOCALE=	en_US.UTF-8
GNU_CONFIGURE=	yes
NO_ARCH=	yes
GLIB_SCHEMAS=	org.freedesktop.ibus.engine.typing-booster.gschema.xml

TEST_TARGET=	check
TEST_ENV=	MAKE_CMD=${LOCALBASE}/bin/gmake LC_ALL=en_US.UTF-8	\
		IBUS_TYPING_BOOSTER_DEBUG_LEVEL=1

OPTIONS_DEFINE=	HUNSPELL
OPTIONS_DEFAULT=HUNSPELL

HUNSPELL_RUN_DEPENDS=	hunspell:textproc/hunspell

SPELL2FIX=	engine/itb_util.py setup/user_transliteration.py
PY2FIX=		setup/user_transliteration.py tests/test_m17n_db_info.py	\
		tests/test_itb.py tests/test_compose_sequences.py		\
		tests/test_hunspell_suggest.py tests/test_keyvals_to_keycodes.py\
		tests/test_m17n_translit.py tests/test_emoji_unicode_version.py	\
		tests/test_emoji_similar.py tests/test_emoji_candidates.py
SHR2FIX=	engine/itb_util.py engine/itb_emoji.py engine/hunspell_table.py	\
		tests/test_compose_sequences.py typing-booster.appdata.xml	\
		setup/user_transliteration.py ${GLIB_SCHEMAS} engine/itb_sound.py
COMP2DEL=	engine/Makefile setup/Makefile

pre-configure:
.for f in ${SPELL2FIX}
	${REINPLACE_CMD} -e 's|/usr/share/myspell|${LOCALBASE}/share/hunspell|'	\
		${WRKSRC}/${f}
.endfor
.for f in ${PY2FIX}
	${REINPLACE_CMD} -e 's|/usr/bin/python3| ${PYTHON_CMD}|' ${WRKSRC}/${f}
.endfor
	${REINPLACE_CMD} -e 's|/usr/libexec|${PREFIX}/libexec|'	\
		${WRKSRC}/typing-booster.appdata.xml
.for f in ${SHR2FIX}
	${REINPLACE_CMD} -e 's|/usr/share/ibus-typing-booster|${DATADIR}|'	\
		-e 's|/usr/share|${LOCALBASE}/share|' ${WRKSRC}/${f}
.endfor

post-configure:
.for f in ${COMP2DEL}
	${SED} -i.orig -e '/if test -n "\$$\$$dlist"/,/^	else :; fi$$/ d'	\
		${WRKSRC}/${f}
.endfor

post-install:
	(cd ${STAGEDIR}${PREFIX} \
	&& ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py \
	-d ${PREFIX} -f ${DATADIR:S;${PREFIX}/;;}	\
	&& ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py \
	-d ${PREFIX} -f ${DATADIR:S;${PREFIX}/;;})

.include <bsd.port.mk>