diff options
author | bapt <bapt@FreeBSD.org> | 2012-06-04 06:37:51 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2012-06-04 06:37:51 +0800 |
commit | 32c9c8e9053eb9fe833c595a0d3daea1309ee12e (patch) | |
tree | 37a498a74f20094e54ca5f650ea2b28723807e4b | |
parent | 0217f08ee684116de1b405647eb62f9499fd5e5c (diff) | |
download | freebsd-ports-gnome-32c9c8e9053eb9fe833c595a0d3daea1309ee12e.tar.gz freebsd-ports-gnome-32c9c8e9053eb9fe833c595a0d3daea1309ee12e.tar.zst freebsd-ports-gnome-32c9c8e9053eb9fe833c595a0d3daea1309ee12e.zip |
1. Convert to the new options style;
2. Fix pkg-plist for gtk2/gtk3/qt4 IM modules;
3. Update gtk immodules file(s);
4. Smart pkg-message.in;
5. Align some Makefile variables.
PR: ports/168634
Submitted by: Zhihao Yuan <lichray@gmail.com>
-rw-r--r-- | chinese/fcitx/Makefile | 50 | ||||
-rw-r--r-- | chinese/fcitx/files/pkg-message.in | 29 | ||||
-rw-r--r-- | chinese/fcitx/pkg-message | 18 | ||||
-rw-r--r-- | chinese/fcitx/pkg-plist | 9 |
4 files changed, 74 insertions, 32 deletions
diff --git a/chinese/fcitx/Makefile b/chinese/fcitx/Makefile index dd82efa698a0..0b363d804237 100644 --- a/chinese/fcitx/Makefile +++ b/chinese/fcitx/Makefile @@ -7,7 +7,7 @@ PORTNAME= fcitx PORTVERSION= 4.2.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= chinese x11 MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE} DISTFILES= ${DISTNAME}${EXTRACT_SUFX} pinyin.tar.gz table.tar.gz @@ -23,10 +23,12 @@ LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo \ dbus-1.3:${PORTSDIR}/devel/dbus RUN_DEPENDS= xdg-open:${PORTSDIR}/devel/xdg-utils -MAN1= createPYMB.1 fcitx-remote.1 fcitx.1 mb2org.1 mb2txt.1 \ - readPYBase.1 readPYMB.1 scel2org.1 txt2mb.1 +MAN1= createPYMB.1 fcitx-remote.1 fcitx.1 mb2org.1 mb2txt.1 \ + readPYBase.1 readPYMB.1 scel2org.1 txt2mb.1 +SUB_FILES= pkg-message +SUB_LIST+= PORTSDIR=${PORTSDIR} -USE_XZ= yes +USE_XZ= yes USE_GNOME= pango intltool gnomehack USE_GETTEXT= yes USE_XORG= x11 xext @@ -34,39 +36,53 @@ USE_LDCONFIG= yes USE_CMAKE= yes INSTALLS_ICONS= yes -OPTIONS= GTK2 "Enable Gtk2 IM module" off \ - GTK3 "Enable Gtk3 IM module" off \ - QT4 "Enable Qt4 IM module" off \ - OPENCC "Enable OpenCC for Chinese Transform" off \ - TPUNC "Use traditional quotation marks" off +OPTIONS_DEFINE= GTK2 GTK3 QT4 OPENCC TPUNC + +GTK2_DESC= "Enable Gtk2 IM module" +GTK3_DESC= "Enable Gtk3 IM module" +QT4_DESC= "Enable Qt4 IM module" +OPENCC_DESC= "Enable OpenCC for Chinese Transform" +TPUNC_DESC= "Use traditional quotation marks" .include <bsd.port.options.mk> -.if defined(WITH_GTK2) +.if ${PORT_OPTIONS:MGTK2} USE_GNOME+= gtk20 +PLIST_SUB+= GTK2="" +SUB_LIST+= GTK2_IM=fcitx .else CMAKE_ARGS+= -DENABLE_GTK2_IM_MODULE=OFF +PLIST_SUB+= GTK2="@comment " +SUB_LIST+= GTK2_IM=xim .endif -.if defined(WITH_GTK3) +.if ${PORT_OPTIONS:MGTK3} USE_GNOME+= gtk30 CMAKE_ARGS+= -DENABLE_GTK3_IM_MODULE=ON +PLIST_SUB+= GTK3="" +SUB_LIST+= GTK3_IM=fcitx +.else +PLIST_SUB+= GTK3="@comment " +SUB_LIST+= GTK3_IM=xim .endif -.if defined(WITH_QT4) +.if ${PORT_OPTIONS:MQT4} USE_QT= yes USE_QT_VER= 4 QT_COMPONENTS= gui CMAKE_ARGS+= -DENABLE_QT_IM_MODULE=ON +PLIST_SUB+= QT4="" +.else +PLIST_SUB+= QT4="@comment " .endif -.if defined(WITH_OPENCC) +.if ${PORT_OPTIONS:MOPENCC} LIB_DEPENDS+= opencc.1:${PORTSDIR}/chinese/opencc .else CMAKE_ARGS+= -DENABLE_OPENCC=OFF .endif -.if defined(WITH_TPUNC) +.if ${PORT_OPTIONS:MTPUNC} EXTRA_PATCHES+= ${FILESDIR}/tpunc-data_punc.mb.zh_CN .endif @@ -92,6 +108,12 @@ EXTRA_PATCHES+= ${FILESDIR}/getline-src_lib_fcitx-utils_utils.c \ .endif post-install: +.if ${PORT_OPTIONS:MGTK2} + -gtk-query-immodules-2.0 > ${LOCALBASE}/etc/gtk-2.0/gtk.immodules +.endif +.if ${PORT_OPTIONS:MGTK3} + -gtk-query-immodules-3.0 > ${LOCALBASE}/lib/gtk-3.0/${GTK3_VERSION}/immodules.cache +.endif @${ECHO_CMD} @${CAT} ${PKGMESSAGE} @${ECHO_CMD} diff --git a/chinese/fcitx/files/pkg-message.in b/chinese/fcitx/files/pkg-message.in new file mode 100644 index 000000000000..38de6a4834f8 --- /dev/null +++ b/chinese/fcitx/files/pkg-message.in @@ -0,0 +1,29 @@ +************************************************************************ + +Remember to set the environment variable XMODIFIERS: + + csh/tcsh: setenv XMODIFIERS @im=fcitx + sh/bash: export XMODIFIERS='@im=fcitx' + +For GTK+ programs, you may want to set: + + csh/tcsh: setenv GTK_IM_MODULE %%GTK2_IM%% + setenv GTK3_IM_MODULE %%GTK3_IM%% + sh/bash: export GTK_IM_MODULE=%%GTK2_IM%% + export GTK3_IM_MODULE=%%GTK3_IM%% + +For Qt4 programs, we recommend you to use + + qtconfig-qt4: %%PORTSDIR%%/misc/qt4-qtconfig + +instead of to manually set QT4_IM_MODULE. + +To start fcitx with your desktop, just + + cp %%PREFIX%%/share/applications/fcitx.desktop \ + ~/.config/autostart/ + +if your desktop environment is XDG-compatible. Otherwise, you have to +make sure fcitx is started AFTER dbus-launch. + +************************************************************************ diff --git a/chinese/fcitx/pkg-message b/chinese/fcitx/pkg-message deleted file mode 100644 index cb407f49e9ed..000000000000 --- a/chinese/fcitx/pkg-message +++ /dev/null @@ -1,18 +0,0 @@ -************************************************************************ - -Remember to set environment variable XMODIFIERS: - - csh/tcsh: setenv XMODIFIERS @im=fcitx - sh/bash: export XMODIFIERS='@im=fcitx' - -Additionally, for GTK/Qt programs, you must also set: - - csh/tcsh: setenv GTK_IM_MODULE xim - setenv QT_IM_MODULE xim - sh/bash: export GTK_IM_MODULE=xim - export QT_IM_MODULE=xim - -You can replace the `xim` above with `fcitx` if you built fcitx with -the corresponding IM module. - -************************************************************************ diff --git a/chinese/fcitx/pkg-plist b/chinese/fcitx/pkg-plist index df8a3439af52..b4fe670eca1a 100644 --- a/chinese/fcitx/pkg-plist +++ b/chinese/fcitx/pkg-plist @@ -64,6 +64,15 @@ lib/libfcitx-core.so.0.3 lib/libfcitx-utils.so lib/libfcitx-utils.so.0 lib/libfcitx-utils.so.0.1 +%%GTK2%%lib/gtk-2.0/%%GTK2_VERSION%%/immodules/im-fcitx.so +%%GTK2%%@exec gtk-query-immodules-2.0 > %%LOCALBASE%%/etc/gtk-2.0/gtk.immodules +%%GTK2%%@unexec gtk-query-immodules-2.0 > %%LOCALBASE%%/etc/gtk-2.0/gtk.immodules +%%GTK3%%lib/gtk-3.0/%%GTK3_VERSION%%/immodules/im-fcitx.so +%%GTK3%%@exec gtk-query-immodules-3.0 > %%LOCALBASE%%/lib/gtk-3.0/%%GTK3_VERSION%%/immodules.cache +%%GTK3%%@unexec gtk-query-immodules-3.0 > %%LOCALBASE%%/lib/gtk-3.0/%%GTK3_VERSION%%/immodules.cache +%%QT4%%lib/qt4/plugins/inputmethods/qtim-fcitx.so +%%QT4%%@dirrmtry lib/qt4/plugins/inputmethods +%%QT4%%@dirrmtry lib/qt4/plugins libdata/pkgconfig/fcitx-config.pc libdata/pkgconfig/fcitx-utils.pc libdata/pkgconfig/fcitx.pc |