aboutsummaryrefslogtreecommitdiff
path: root/chinese/ibus-pinyin/Makefile
blob: eb05ca6e20a9e4d8122f0b400b4d4e8f88696924 (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
# Created by: Henry Hu <henry.hu.sh@gmail.com>
# $FreeBSD$

PORTNAME=	ibus-pinyin
PORTVERSION=	1.4.0
PORTREVISION=	2
CATEGORIES=	chinese
MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
DISTFILES=		${DISTNAME}${EXTRACT_SUFX}
EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}

MAINTAINER=	henry.hu.sh@gmail.com
COMMENT=	PinYin engine for IBus

BUILD_DEPENDS=	ibus-daemon:${PORTSDIR}/textproc/ibus \
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3
RUN_DEPENDS=	ibus-daemon:${PORTSDIR}/textproc/ibus \
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3

USE_PYTHON=	yes
USE_GNOME=	pygtk2

USE_GCC=	yes
USES=		gmake pkgconfig
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--disable-dependency-tracking --disable-lua-extension

PROJECTHOST=	ibus

OPTIONS_DEFINE=	ANDROID_DB OPENPHRASE_DB OPENCC NLS
OPTIONS_DEFAULT=	ANDROID_DB
ANDROID_DB_DESC=	Build Android DB
OPENPHRASE_DB_DESC=	Build Open Phrase DB
OPENCC_DESC=		Use opencc

NO_STAGE=	yes
.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MANDROID_DB}
CONFIGURE_ARGS+=	--enable-db-android
PLIST_SUB+=	ANDROID_DB=""
.else
CONFIGURE_ARGS+=	--disable-db-android
PLIST_SUB+=	ANDROID_DB="@comment "
.endif

OPENPHRASE_DBVER=	1.2.99
OPENPHRASE_DBFILE=	pinyin-database-${OPENPHRASE_DBVER}.tar.bz2

.if ${PORT_OPTIONS:MOPENPHRASE_DB}
CONFIGURE_ARGS+=	--enable-db-open-phrase
DISTFILES+=	${OPENPHRASE_DBFILE}
PLIST_SUB+=	OPENPHRASE_DB=""
.else
CONFIGURE_ARGS+=	--disable-db-open-phrase
PLIST_SUB+=	OPENPHRASE_DB="@comment "
.endif

.if ${PORT_OPTIONS:MOPENCC}
CONFIGURE_ARGS+=	--enable-opencc
LIB_DEPENDS+=		opencc.1:${PORTSDIR}/chinese/opencc
.else
CONFIGURE_ARGS+=	--disable-opencc
.endif

.if ${PORT_OPTIONS:MNLS}
USES+=		gettext
PLIST_SUB+=	NLS=""
.else
CONFIGURE_ARGS+=	--disable-nls
PLIST_SUB+=	NLS="@comment "
.endif

post-extract:
.if ${PORT_OPTIONS:MOPENPHRASE_DB}
	@${CP} ${DISTDIR}/${OPENPHRASE_DBFILE} ${WRKSRC}/data/db/open-phrase
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|DATADIRNAME=lib|DATADIRNAME=share|' ${WRKSRC}/configure

.include <bsd.port.mk>