diff --git a/common/shlibs b/common/shlibs index 1f26086650d..9214a9d6d13 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2116,6 +2116,9 @@ libfcitx-config.so.4 libfcitx-4.2.8_1 libFcitxQt5DBusAddons.so.1 libfcitx-qt5-1.2.1_1 libFcitxQt5WidgetsAddons.so.1 libfcitx-qt5-1.2.1_1 libfcitx-qt5.so.0 libfcitx-qt5-0.1.3_1 +libFcitx5Utils.so.2 libfcitx5-5.0.5_1 +libFcitx5Core.so.7 libfcitx5-5.0.5_1 +libFcitx5Config.so.6 libfcitx5-5.0.5_1 libdruntime-ldc-debug-shared.so.94 ldc-runtime-1.24.0_1 libdruntime-ldc-shared.so.94 ldc-runtime-1.24.0_1 libphobos2-ldc-shared.so.94 ldc-runtime-1.24.0_1 diff --git a/srcpkgs/fcitx5-icons b/srcpkgs/fcitx5-icons new file mode 120000 index 00000000000..99ac64afc61 --- /dev/null +++ b/srcpkgs/fcitx5-icons @@ -0,0 +1 @@ +fcitx5 \ No newline at end of file diff --git a/srcpkgs/fcitx5/patches/cross-config-template.patch b/srcpkgs/fcitx5/patches/cross-config-template.patch new file mode 100644 index 00000000000..69a988f3c87 --- /dev/null +++ b/srcpkgs/fcitx5/patches/cross-config-template.patch @@ -0,0 +1,45 @@ +Index: fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5ModuleTemplate.cmake.in +=================================================================== +--- fcitx5-5.0.6.orig/src/lib/fcitx-utils/Fcitx5ModuleTemplate.cmake.in ++++ fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5ModuleTemplate.cmake.in +@@ -2,6 +2,16 @@ if (TARGET Fcitx5::Module::@FEM_EXPORTNA + return() + endif() + ++# Compute the installation prefix relative to this file. ++get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++if(_IMPORT_PREFIX STREQUAL "/") ++ set(_IMPORT_PREFIX "") ++endif() ++ + add_library(@FEM_TARGET@-interface INTERFACE) + add_library(Fcitx5::Module::@FEM_EXPORTNAME@ ALIAS @FEM_TARGET@-interface) +-set_target_properties(@FEM_TARGET@-interface PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@_MODULE_HEADER_DIR@") ++set_target_properties(@FEM_TARGET@-interface PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../@_MODULE_HEADER_DIR@") +Index: fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5UtilsConfig.cmake.in +=================================================================== +--- fcitx5-5.0.6.orig/src/lib/fcitx-utils/Fcitx5UtilsConfig.cmake.in ++++ fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5UtilsConfig.cmake.in +@@ -3,8 +3,17 @@ + include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5UtilsTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5Macros.cmake") + ++# Compute the installation prefix relative to this file. ++get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ++if(_IMPORT_PREFIX STREQUAL "/") ++ set(_IMPORT_PREFIX "") ++endif() ++ + set(FCITX_SYS_INSTALL_PREFIX "@FCITX_INSTALL_PREFIX@") +-set(FCITX_INSTALL_CMAKECONFIG_DIR "@FCITX_INSTALL_CMAKECONFIG_DIR@") ++set(FCITX_INSTALL_CMAKECONFIG_DIR "${_IMPORT_PREFIX}/../@FCITX_INSTALL_CMAKECONFIG_DIR@") + + set(_default_FCITX_INSTALL_USE_FCITX_SYS_PATHS Off) + if (NOT DEFINED FCITX_INSTALL_USE_FCITX_SYS_PATHS) diff --git a/srcpkgs/fcitx5/patches/no-which.patch b/srcpkgs/fcitx5/patches/no-which.patch new file mode 100644 index 00000000000..ae553dd1535 --- /dev/null +++ b/srcpkgs/fcitx5/patches/no-which.patch @@ -0,0 +1,194 @@ +Index: fcitx5-5.0.6/data/fcitx5-configtool.sh +=================================================================== +--- fcitx5-5.0.6.orig/data/fcitx5-configtool.sh ++++ fcitx5-5.0.6/data/fcitx5-configtool.sh +@@ -5,14 +5,14 @@ + + export TEXTDOMAIN=fcitx5 + +-if which kdialog > /dev/null 2>&1; then ++if command -v kdialog > /dev/null 2>&1; then + message() { + kdialog --msgbox "$1" + } + error() { + kdialog --error "$1" + } +-elif which zenity > /dev/null 2>&1; then ++elif command -v zenity > /dev/null 2>&1; then + message() { + zenity --info --text="$1" + } +@@ -28,7 +28,7 @@ else + } + fi + +-if which gettext > /dev/null 2>&1; then ++if command -v gettext > /dev/null 2>&1; then + _() { + gettext "$@" + } +@@ -101,7 +101,7 @@ detectDE() { + if [ x"$DE" = x"gnome" ]; then + # gnome-default-applications-properties is only available in GNOME 2.x + # but not in GNOME 3.x +- which gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" ++ command -v gnome-default-applications-properties > /dev/null 2>&1 || DE="gnome3" + fi + } + +@@ -116,7 +116,7 @@ run_kde() { + } + + run_qt() { +- if which fcitx5-config-qt > /dev/null 2>&1; then ++ if command -v fcitx5-config-qt > /dev/null 2>&1; then + exec fcitx5-config-qt "$1" + fi + return 1 +@@ -132,13 +132,13 @@ run_xdg() { + ;; + esac + +- if command="$(which xdg-open 2>/dev/null)"; then ++ if command="$(command -v xdg-open 2>/dev/null)"; then + exec "$command" "$HOME/.config/fcitx5" + fi + } + + _which_cmdline() { +- cmd="$(which "$1")" || return 1 ++ cmd="$(command -v "$1")" || return 1 + shift + echo "$cmd $*" + } +Index: fcitx5-5.0.6/data/fcitx5-diagnose.sh +=================================================================== +--- fcitx5-5.0.6.orig/data/fcitx5-diagnose.sh ++++ fcitx5-5.0.6/data/fcitx5-diagnose.sh +@@ -123,7 +123,7 @@ __get_pretty_name() { + fi + } + +-fcitx_exe="$(which fcitx5 2> /dev/null)" ++fcitx_exe="$(command -v fcitx5 2> /dev/null)" + + __conf_dir_init() { + # Don't do any fancy check here, it's the user's fault, which we should detect +@@ -208,9 +208,9 @@ if type dbus-send &> /dev/null; then + "string:$1" 2> /dev/null) || return 1 + echo -n "${pid##* }" + } +-elif qdbus_exe=$(which qdbus 2> /dev/null) || \ +- qdbus_exe=$(which qdbus-qt4 2> /dev/null) || \ +- qdbus_exe=$(which qdbus-qt5 2> /dev/null); then ++elif qdbus_exe=$(command -v qdbus 2> /dev/null) || \ ++ qdbus_exe=$(command -v qdbus-qt4 2> /dev/null) || \ ++ qdbus_exe=$(command -v qdbus-qt5 2> /dev/null); then + dbus_exe=${qdbus_exe} + dbus_get_name_owner() { + "${qdbus_exe}" org.freedesktop.DBus /org/freedesktop/DBus \ +@@ -324,15 +324,15 @@ detectDE() { + if [ x"$DE" = x"gnome" ]; then + # gnome-default-applications-properties is only available in GNOME 2.x + # but not in GNOME 3.x +- which gnome-default-applications-properties > /dev/null 2>&1 || \ ++ command -v gnome-default-applications-properties > /dev/null 2>&1 || \ + DE="gnome3" +- which gnome-shell &> /dev/null && DE="gnome3" ++ command -v gnome-shell &> /dev/null && DE="gnome3" + fi + } + + maybe_gnome3() { + [[ $DE = gnome3 ]] && return 0 +- [[ $DE = generic ]] && which gnome-shell &> /dev/null && return 0 ++ [[ $DE = generic ]] && command -v gnome-shell &> /dev/null && return 0 + return 1 + } + +@@ -341,7 +341,7 @@ detectDE + # user and uid + + detect_user() { +- if which id &> /dev/null; then ++ if command -v id &> /dev/null; then + cur_user=$(id -un) + cur_uid=$(id -u) + else +@@ -352,7 +352,7 @@ detect_user() { + else + cur_uid="" + fi +- if which whoami &> /dev/null; then ++ if command -v whoami &> /dev/null; then + cur_user=$(whoami) + elif [[ -d /proc/$$/ ]]; then + cur_user=$(stat -c %U /proc/$$/) +@@ -374,7 +374,7 @@ _check_open_root() { + for f in /proc/1/environ /proc/1/mem /proc/kcore /proc/kmem; do + try_open "$f" && return 0 + done +- if which readlink &> /dev/null; then ++ if command -v readlink &> /dev/null; then + for f in /proc/1/exe /proc/1/cwd /proc/1/root; do + readlink "$f" &> /dev/null && return 0 + done +@@ -966,7 +966,7 @@ _find_config_gtk() { + return 0 + } + local config_gtk +- config_gtk="$(which "fcitx5-config-gtk" 2> /dev/null)" || return 1 ++ config_gtk="$(command -v "fcitx5-config-gtk" 2> /dev/null)" || return 1 + echo "${config_gtk}" + _config_tool_gtk_exe="${config_gtk}" + } +@@ -993,7 +993,7 @@ _check_config_gtk() { + local version=$1 + local config_gtk config_gtk_name + write_order_list_eval "$(_ 'Config GUI for gtk${1}:')" "${version}" +- if ! config_gtk="$(which "fcitx5-config-gtk${version}" 2> /dev/null)"; then ++ if ! config_gtk="$(command -v "fcitx5-config-gtk${version}" 2> /dev/null)"; then + if ! _check_config_gtk_version "${version}"; then + write_error_eval \ + "$(_ 'Config GUI for gtk${1} not found.')" "${version}" +@@ -1014,7 +1014,7 @@ _check_config_qt() { + local config_qt config_qt_name + config_qt_name="fcitx5-config-qt" + write_order_list_eval "$(_ 'Config GUI for qt:')" "${version}" +- if ! config_qt="$(which "${config_qt_name}" 2> /dev/null)"; then ++ if ! config_qt="$(command -v "${config_qt_name}" 2> /dev/null)"; then + write_error "$(_ 'Config GUI for qt not found.')" + return 1 + fi +@@ -1027,7 +1027,7 @@ _check_config_kcm() { + local version=$1 + local kcm_shell config_kcm + write_order_list "$(_ 'Config GUI for kde:')" +- if ! kcm_shell="$(which "kcmshell${version}" 2> /dev/null)"; then ++ if ! kcm_shell="$(command -v "kcmshell${version}" 2> /dev/null)"; then + write_error "$(print_not_found "kcmshell${version}")" + return 1 + fi +@@ -1043,7 +1043,7 @@ check_config_ui() { + local IFS=$'\n' + write_title 1 "$(_ 'Fcitx Configure UI:')" + write_order_list "$(_ 'Config Tool Wrapper:')" +- if ! fcitx_configtool="$(which fcitx5-configtool 2> /dev/null)"; then ++ if ! fcitx_configtool="$(command -v fcitx5-configtool 2> /dev/null)"; then + write_error_eval "$(_ 'Cannot find ${1} executable!')" fcitx5-configtool + else + write_eval "$(_ 'Found ${1} at ${2}.')" \ +Index: fcitx5-5.0.6/test/xvfb_wrapper.sh +=================================================================== +--- fcitx5-5.0.6.orig/test/xvfb_wrapper.sh ++++ fcitx5-5.0.6/test/xvfb_wrapper.sh +@@ -20,7 +20,7 @@ finish() + + trap finish EXIT + +-if which xprop >/dev/null 2>&1; then ++if command -v xprop >/dev/null 2>&1; then + i=1 + while [ "$i" -lt 5 ]; do + if xprop -root >/dev/null 2>&1; then diff --git a/srcpkgs/fcitx5/template b/srcpkgs/fcitx5/template new file mode 100644 index 00000000000..260c4bd8163 --- /dev/null +++ b/srcpkgs/fcitx5/template @@ -0,0 +1,69 @@ +# Template file for 'fcitx5' +pkgname=fcitx5 +version=5.0.7 +revision=1 +build_style=cmake +build_helper=qemu +configure_args=" + -DCMAKE_INSTALL_LIBDATADIR=/usr/lib${XBPS_TARGET_WORDSIZE} + -DUSE_SYSTEMD=OFF" +hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen + extra-cmake-modules xkeyboard-config wayland-devel" +makedepends="fmt-devel expat-devel iso-codes enchant2-devel libxkbfile-devel + dbus-devel pango-devel glib-devel libevent-devel xcb-util-wm-devel + xcb-util-keysyms-devel xcb-util-devel xcb-imdkit-devel libxkbcommon-devel + wayland-devel wayland-protocols gdk-pixbuf-devel json-c-devel" +depends="fcitx5-icons" +short_desc="Flexible Context-aware Input Tool with eXtension - v5" +maintainer="Đoàn Trần Công Danh " +license="LGPL-2.1-or-later" +homepage="https://fcitx-im.org/wiki/Fcitx" +_en_dict_ver=20121020 +distfiles="https://download.fcitx-im.org/fcitx5/fcitx5/fcitx5-${version}.tar.xz + https://download.fcitx-im.org/data/en_dict-${_en_dict_ver}.tar.gz" +checksum="c66781c4f774cb82794004877d94f1e68deaf9fd6312c649b438fb479ffe4588 + c44a5d7847925eea9e4d2d04748d442cd28dd9299a0b572ef7d91eac4f5a6ceb" +patch_args=-Np1 +skip_extraction=en_dict-${_en_dict_ver}.tar.gz +lib32disabled=yes + +# Warning: do NOT enable backtrace for musl, do NOT add libexecinfo-devel + +post_extract() { + local _distdir=${XBPS_SRCDISTDIR}/${pkgname}-${version} + cp ${_distdir}/en_dict-${_en_dict_ver}.tar.gz src/modules/spell/dict +} + +post_install() { + sed -i '/prefix=/!s,/usr,${exec_prefix},' \ + "${DESTDIR}/usr/lib/pkgconfig"/*.pc + sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \ + "${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake +} + +fcitx5-icons_package() { + short_desc+=" - icons" + conflicts="fcitx<=4.2.9.8_3" + pkg_install() { + vmove usr/share/icons + } +} + +libfcitx5_package() { + short_desc+=" - libraries" + lib32disabled=yes + pkg_install() { + vmove "usr/lib/*.so.*" + } +} + +libfcitx5-devel_package() { + depends="libfcitx5>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/cmake + vmove usr/lib/pkgconfig + vmove "usr/lib/*.so" + } +} diff --git a/srcpkgs/libfcitx5 b/srcpkgs/libfcitx5 new file mode 120000 index 00000000000..99ac64afc61 --- /dev/null +++ b/srcpkgs/libfcitx5 @@ -0,0 +1 @@ +fcitx5 \ No newline at end of file diff --git a/srcpkgs/libfcitx5-devel b/srcpkgs/libfcitx5-devel new file mode 120000 index 00000000000..99ac64afc61 --- /dev/null +++ b/srcpkgs/libfcitx5-devel @@ -0,0 +1 @@ +fcitx5 \ No newline at end of file