void-packages/srcpkgs/fcitx/template

114 lines
3.3 KiB
Bash

# Template file for 'fcitx'
pkgname=fcitx
version=4.2.9.7
revision=3
build_style=cmake
short_desc="Flexible Context-aware Input Tool with eXtension"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="GPL-2.0-or-later, LGPL-2.1-or-later, MIT"
homepage="https://fcitx-im.org/"
distfiles="http://download.fcitx-im.org/fcitx/fcitx-${version}_dict.tar.xz"
checksum=cf333b2a90be616ffed8b83438dfe3dc0e22ecf034b9f651167203ecbe3f6f8f
hostmakedepends="pkg-config doxygen gobject-introspection extra-cmake-modules qt-qmake"
makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
json-c-devel opencc-devel
libxkbfile-devel icu-devel qt-devel dbus-devel gtk+-devel gtk+3-devel"
lib32disabled=yes
configure_args="-DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
-DENABLE_GTK2_IM_MODULE=ON -DENABLE_GTK3_IM_MODULE=ON -DENABLE_QT_IM_MODULE=ON
-DFORCE_ENCHANT=ON -DENABLE_TEST=ON"
# Warning: do NOT enable backtrace for musl, do NOT add libexecinfo-devel
case "$XBPS_TARGET_MACHINE" in
*-musl) configure_args+=" -DENABLE_BACKTRACE=OFF";;
esac
if [ "$CROSS_BUILD" ]; then
configure_args+=" -DENABLE_GIR=OFF"
hostmakedepends+=" glib-devel qt-host-tools fcitx"
fi
pre_configure() {
# include FcitxMacro.cmake without invoking fcitx4-config
vsed -i -e 's;INCLUDE(${FCITX4_PREFIX}/share/cmake/fcitx;INCLUDE(${CMAKE_CURRENT_LIST_DIR};' \
cmake/FcitxConfig.cmake
if [ "$CROSS_BUILD" ]; then
# use host binaries
vsed -i -e 's;${PROJECT_BINARY_DIR}/tools/dev;/usr/lib/fcitx/libexec;' \
cmake/FcitxMacro.cmake
vsed -i -e 's;${PROJECT_BINARY_DIR}/src/module/spell/dict;/usr/lib/fcitx/libexec;' \
src/module/spell/dict/CMakeLists.txt
vsed -i -e 's;${PROJECT_BINARY_DIR}/tools/cli;/usr/bin;' \
src/im/pinyin/data/CMakeLists.txt \
src/im/table/data/CMakeLists.txt
fi
}
libfcitx_package() {
short_desc+=" - shared libraries"
pkg_install() {
for i in config core gclient utils; do
vmove "usr/lib/libfcitx-${i}.so.*"
done
vmove "usr/lib/fcitx/fcitx-*.so"
for i in comp-spell-dict fcitx-{po-parser,scanner}; do
vmove usr/lib/fcitx/libexec/${i}
done
if [ -z "$CROSS_BUILD" ]; then
vmove usr/lib/girepository-1.0
fi
vlicense COPYING.LIBS
vlicense COPYING.MIT
}
}
fcitx-devel_package() {
depends="libfcitx-${version}_${revision} glib-devel"
short_desc+=" - development files"
pkg_install() {
for i in config gclient utils; do
vmove usr/include/fcitx-${i}
vmove usr/lib/pkgconfig/fcitx-${i}.pc
vmove usr/lib/libfcitx-${i}.so
done
vmove usr/bin/fcitx4-config
vmove usr/include/fcitx
vmove usr/lib/pkgconfig/fcitx.pc
vmove usr/lib/libfcitx-core.so
vmove usr/share/cmake
if [ -z "$CROSS_BUILD" ]; then
vmove usr/share/gir-1.0
fi
}
}
libfcitx-gtk_package() {
short_desc+=" - GTK2 IM module"
pkg_install() {
vmove usr/lib/gtk-2.0
}
}
libfcitx-gtk3_package() {
short_desc+=" - GTK3 IM module"
pkg_install() {
vmove usr/lib/gtk-3.0
}
}
libfcitx-qt_package() {
short_desc+=" - Qt4 IM module"
pkg_install() {
vmove "usr/lib/libfcitx-qt.so.*"
vmove usr/lib/fcitx/libexec/fcitx-qt-gui-wrapper
vmove usr/lib/qt
}
}
libfcitx-qt-devel_package() {
short_desc+=" - Qt4 IM module development files"
depends="fcitx-${version}_${revision} qt-devel"
pkg_install() {
vmove usr/include/fcitx-qt
vmove usr/lib/libfcitx-qt.so
vmove usr/lib/pkgconfig/fcitx-qt.pc
}
}