Debian Codegraph @

distro/freebsd/Makefile

raw
1 # New ports collection makefile for: zh-hime
2 # Date created: 2012/06/20
3 # Whom: The HIME project
4 # Depends: git gtk20 intltool libXtst gtk30 gmake ja-anthy
5 # zh-libchewing
6 #
7 # $FreeBSD$
8 #
9
10 PORTNAME= hime
11 DATE!= /bin/date "+%Y%m%d"
12 PORTVERSION= 0.9.10+git${DATE}
13 CATEGORIES= chinese textproc
14 MASTER_SITES= http://hime.luna.com.tw/
15
16 MAINTAINER= The HIME project
17 COMMENT= A GTK2+/GTK3+ based universal input method platform
18
19 LICENSE= LGPL21
20
21 USE_GMAKE= yes
22 HAS_CONFIGURE= yes
23
24 USE_XORG= xtst
25 USE_GNOME= gtk20
26 USE_LDCONFIG= yes
27 WITH_DEBUG= yes
28 OPTIONS= NLS "Enable Native Language Support" on \
29 GTK3_IM_MODULE "Build the GTK+3 im-module" on \
30 ANTHY "Support Anthy input method" on \
31 CHEWING "Support Chewing input method" on
32
33 TMP_PLIST_DIR= build
34
35 do-fetch:
36
37 do-extract:
38 @${RM} -rf ${WRKDIR}
39 @${MKDIR} ${WRKDIR}
40 (cd ${WRKDIR} && \
41 git clone --depth=1 git://github.com/hime-ime/hime.git && \
42 ${LN} -s ${PORTNAME} ${PORTNAME}-${PORTVERSION})
43
44 pre-patch:
45 @${SED} -i -e 's/^\( install -m 644 \*\.1 \$$(man1dir)\)$$/\1 \&\& find .\/ -name "*.1" -exec gzip $$(man1dir)\/{} \\;/g' ${WRKDIR}/${PORTNAME}/man/Makefile
46
47 .include <bsd.port.options.mk>
48
49 .if defined(WITH_GTK3_IM_MODULE)
50 BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/gtk+-3.0.pc:${PORTSDIR}/x11-toolkits/gtk30
51 GTK3_BINARY_VERSION!= /usr/local/bin/pkg-config --variable=gtk_binary_version gtk+-3.0
52 .else
53 CONFIGURE_ARGS+=--disable-gtk3-im-module
54 .endif
55
56 .if defined(WITH_ANTHY)
57 BUILD_DEPENDS+= ${LOCALBASE}/include/anthy/anthy.h:${PORTSDIR}/japanese/anthy
58 .else
59 CONFIGURE_ARGS+=--disable-anthy
60 .endif
61
62 .if defined(WITH_CHEWING)
63 BUILD_DEPENDS+= zh-libchewing>=0.3.2:${PORTSDIR}/chinese/libchewing
64 .else
65 CONFIGURE_ARGS+=--disable-chewing
66 .endif
67
68 .if !defined(WITHOUT_NLS)
69 USE_GETTEXT= yes
70 .else
71 CONFIGURE_ARGS+=--disable-nls
72 .endif
73
74 post-install:
75 @${RM} -rf ${WRKDIR}/${TMP_PLIST_DIR}
76 @${MKDIR} ${WRKDIR}/${TMP_PLIST_DIR}
77 ( cd ${WRKDIR}/${PORTNAME} && \
78 ${GMAKE} DESTDIR=${WRKDIR}/${TMP_PLIST_DIR} install && \
79 cd ${WRKDIR}/${TMP_PLIST_DIR}${PREFIX} && \
80 ${FIND} ./ -type f > ${TMPPLIST} && \
81 ${FIND} ./ -type l >> ${TMPPLIST} && \
82 mtree -U -f ${MTREE_FILE} && \
83 DIRLIST=`mtree -L -d -f ${MTREE_FILE} | ${SED} -e 's/ extra$$//g'` && \
84 for DIR in $$DIRLIST; do \
85 case "$$DIR" in \
86 lib/gtk-2.0|lib/gtk-3.0|share/locale/en_US) ;; \
87 *) ${FIND} $$DIR -type d | ${SORT} -r | ${SED} -e 's/^/@dirrm /g' >> ${TMPPLIST};; \
88 esac ; \
89 done; \
90 echo '@exec gtk-query-immodules-2.0 > %D/etc/gtk-2.0/gtk.immodules || /usr/bin/true' >> ${TMPPLIST}; \
91 echo '@unexec gtk-query-immodules-2.0 > %D/etc/gtk-2.0/gtk.immodules || /usr/bin/true' >> ${TMPPLIST} )
92 .if defined(WITH_GTK3_IM_MODULE)
93 echo '@exec gtk-query-immodules-3.0 > %D/lib/gtk-3.0/${GTK3_BINARY_VERSION}/immodules.cache 2>/dev/null || /usr/bin/true' >> ${TMPPLIST};
94 echo '@unexec gtk-query-immodules-3.0 > %D/lib/gtk-3.0/${GTK3_BINARY_VERSION}/immodules.cache 2>/dev/null || /usr/bin/true' >> ${TMPPLIST};
95 .endif
96
97 .include <bsd.port.mk>