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>
This commit is contained in:
parent
301843b51e
commit
ff6a82fba1
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=298283
4 changed files with 74 additions and 32 deletions
|
@ -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}
|
||||
|
|
29
chinese/fcitx/files/pkg-message.in
Normal file
29
chinese/fcitx/files/pkg-message.in
Normal file
|
@ -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.
|
||||
|
||||
************************************************************************
|
|
@ -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.
|
||||
|
||||
************************************************************************
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue