fcitx: fix cross compilation

This commit is contained in:
newbluemoon 2018-03-05 23:25:19 +01:00 committed by Jürgen Buchmüller
parent 943f9e2508
commit c7898ef32d
2 changed files with 25 additions and 19 deletions

View File

@ -1,12 +0,0 @@
--- CMakeLists.txt.bak 2017-12-02 13:38:52.784843265 +0100
+++ src/CMakeLists.txt 2017-12-02 13:39:15.028841808 +0100
@@ -1,6 +1,8 @@
include_directories(${LIBINTL_INCLUDE_DIR})
include_directories(${LIBICONV_INCLUDE_DIR})
-include_directories(${LIBEXECINFO_INCLUDE_DIR})
+if(ENABLE_BACKTRACE)
+ include_directories(${LIBEXECINFO_INCLUDE_DIR})
+endif()
include_directories(${DL_INCLUDE_DIR})
include_directories(${PTHREAD_INCLUDE_DIR})

View File

@ -1,7 +1,7 @@
# Template file for 'fcitx'
pkgname=fcitx
version=4.2.9.6
revision=1
revision=2
build_style=cmake
short_desc="Flexible Context-aware Input Tool with eXtension"
maintainer="Robert La Spina <rkidlaspina@gmail.com>"
@ -18,17 +18,31 @@ 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"
nocross="fcitx-scanner: cannot execute binary file: Exec format error"
case "$XBPS_TARGET_MACHINE" in
*-musl) configure_args+=" -DENABLE_BACKTRACE=OFF";;
*-musl) makedepends+=" libexecinfo-devel";;
esac
if [ "$CROSS_BUILD" ]; then
configure_args+=" -DENABLE_GIR=OFF"
hostmakedepends+=" glib-devel qt-host-tools"
hostmakedepends+=" glib-devel qt-host-tools fcitx"
fi
pre_configure() {
# include FcitxMacro.cmake without invoking fcitx4-config
sed -i -e 's;INCLUDE(${FCITX4_PREFIX}/share/cmake/fcitx;INCLUDE(${CMAKE_CURRENT_LIST_DIR};' \
cmake/FcitxConfig.cmake
if [ "$CROSS_BUILD" ]; then
# use host binaries
sed -i -e 's;${PROJECT_BINARY_DIR}/tools/dev;/usr/lib/fcitx/libexec;' \
cmake/FcitxMacro.cmake
sed -i -e 's;${PROJECT_BINARY_DIR}/src/module/spell/dict;/usr/lib/fcitx/libexec;' \
src/module/spell/dict/CMakeLists.txt
sed -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"
@ -40,7 +54,9 @@ libfcitx_package() {
for i in comp-spell-dict fcitx-{po-parser,scanner}; do
vmove usr/lib/fcitx/libexec/${i}
done
vmove usr/lib/girepository-1.0
if [ -z "$CROSS_BUILD" ]; then
vmove usr/lib/girepository-1.0
fi
}
}
fcitx-devel_package() {
@ -56,8 +72,10 @@ fcitx-devel_package() {
vmove usr/include/fcitx
vmove usr/lib/pkgconfig/fcitx.pc
vmove usr/lib/libfcitx-core.so
vmove usr/share/gir-1.0
vmove usr/share/cmake
if [ -z "$CROSS_BUILD" ]; then
vmove usr/share/gir-1.0
fi
}
}
libfcitx-gtk_package() {