Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] WIP: fcitx5
@ 2021-03-21 18:04 sgn
  2021-03-22 15:38 ` [PR PATCH] [Updated] " sgn
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: sgn @ 2021-03-21 18:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

WIP: fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 13502 bytes --]

From 6d095bcfa6b8bff6822cb7cee94037dad019be39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 1/4] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 4b82c3ced654..664df6856561 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -257,6 +257,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 04b224760534f4a3bc02046649f852f41e7caa6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 2/4] New package: fcitx5-5.0.5

---
 common/shlibs           |  3 ++
 srcpkgs/fcitx5/template | 62 +++++++++++++++++++++++++++++++++++++++++
 srcpkgs/libfcitx5       |  1 +
 srcpkgs/libfcitx5-devel |  1 +
 4 files changed, 67 insertions(+)
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 664df6856561..c1a2eb8acba6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2122,6 +2122,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/template b/srcpkgs/fcitx5/template
new file mode 100644
index 000000000000..063a2f6cfc54
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,62 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+configure_args="
+ -DCMAKE_INSTALL_LIBDATADIR=/usr/lib${XBPS_TARGET_WORDSIZE}
+ -DUSE_SYSTEMD=OFF -DUSE_FLATPAK_ICON=ON"
+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"
+short_desc="Flexible Context-aware Input Tool with eXtension - v5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+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="c1d74d4681f56e72a90b6c36e3d10f2efe66f7e745ea44b11cd3925216a128b4
+ c44a5d7847925eea9e4d2d04748d442cd28dd9299a0b572ef7d91eac4f5a6ceb"
+
+skip_extraction=en_dict-${_en_dict_ver}.tar.gz
+
+if [ "$XBPS_TARGET_LIBC" = musl ]; then
+	makedepends+=" libexecinfo-devel"
+fi
+
+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"/*/*.cmake
+	find ${DESTDIR}/usr/share/icons -name 'fcitx.png' -delete
+	rm -f ${DESTDIR}/usr/share/icons/hicolor/scalable/apps/fcitx.svg
+}
+
+libfcitx5_package() {
+	short_desc+=" - libraries"
+	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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From 0d408fc4553a43b9f66d8d4c80751f9a59eeb697 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 3/4] New package: fcitx5-gtk-5.0.4

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 65 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 5 files changed, 69 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index c1a2eb8acba6..51a23ad3870e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..ca4c8ba96380
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,65 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.4
+revision=1
+#archs="i686 x86_64"
+#wrksrc=
+#create_wrksrc=yes
+build_style=cmake
+build_helper=gir
+configure_args="-DENABLE_GTK2_IM_MODULE=OFF $(vopt_bool gir ENABLE_GIR)"
+#make_build_args=""
+#make_install_args=""
+#conf_files=""
+#make_dirs="/var/log/dir 0755 root root"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel gtk+3-devel gtk4-devel fmt-devel"
+depends="fcitx5"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - GTK"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=9a491f6c77e796a3d47fbae052b0d8778b3728dc10326fc90d819109bbcdaccc
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+fcitx5-gtk+3_package() {
+	short_desc+="+3 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc+="4 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From 9315df83f56dd6da80a7a21059bc6ac19db55eec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 4/4] New package: fcitx5-qt5-5.0.3

---
 common/shlibs                              |  2 ++
 srcpkgs/fcitx5-qt5-devel                   |  1 +
 srcpkgs/fcitx5-qt5/patches/fix-cross.patch | 13 +++++++++
 srcpkgs/fcitx5-qt5/template                | 34 ++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/patches/fix-cross.patch
 create mode 100644 srcpkgs/fcitx5-qt5/template

diff --git a/common/shlibs b/common/shlibs
index 51a23ad3870e..6f584d5d81ee 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2126,6 +2126,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/patches/fix-cross.patch b/srcpkgs/fcitx5-qt5/patches/fix-cross.patch
new file mode 100644
index 000000000000..841c6534f81c
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/patches/fix-cross.patch
@@ -0,0 +1,13 @@
+Index: fcitx5-qt-5.0.3/CMakeLists.txt
+===================================================================
+--- fcitx5-qt-5.0.3.orig/CMakeLists.txt
++++ fcitx5-qt-5.0.3/CMakeLists.txt
+@@ -56,7 +56,7 @@ if (BUILD_ONLY_PLUGIN)
+ # Dup a little bit option here.
+ include(CompilerSettings)
+ else()
+-include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
++include("$ENV{XBPS_CROSS_BASE}${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
+ endif()
+ 
+ set(Fcitx5Qt6_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/Fcitx5Qt6)
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..9edb1bcc3884
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,34 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.3
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+depends="fcitx5"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=169e13341fc4c88e5201cda4eff656fa89dcc5d973b68c1c8d57b21d1f9439e3
+patch_args=-Np1
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] WIP: fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
@ 2021-03-22 15:38 ` sgn
  2021-03-22 15:38 ` sgn
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-22 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

WIP: fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 31820 bytes --]

From 15b9f1ab4b6c263ecf18195f9bf62e0f9496a59c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/10] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 4b82c3ced654..664df6856561 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -257,6 +257,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From fa9fbfb29a00f64454f216f8209c8f1b67b9249e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/10] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  61 ++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 6 files changed, 305 insertions(+)
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 664df6856561..c1a2eb8acba6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2122,6 +2122,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/patches/cross-config-template.patch b/srcpkgs/fcitx5/patches/cross-config-template.patch
new file mode 100644
index 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..093adda3bf58
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,61 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+revision=1
+build_style=cmake
+build_helper=qemu
+configure_args="
+ -DCMAKE_INSTALL_LIBDATADIR=/usr/lib${XBPS_TARGET_WORDSIZE}
+ -DUSE_SYSTEMD=OFF -DUSE_FLATPAK_ICON=ON"
+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"
+short_desc="Flexible Context-aware Input Tool with eXtension - v5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ c44a5d7847925eea9e4d2d04748d442cd28dd9299a0b572ef7d91eac4f5a6ceb"
+patch_args=-Np1
+
+skip_extraction=en_dict-${_en_dict_ver}.tar.gz
+
+# 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
+	find ${DESTDIR}/usr/share/icons -name 'fcitx.png' -delete
+	rm -f ${DESTDIR}/usr/share/icons/hicolor/scalable/apps/fcitx.svg
+}
+
+libfcitx5_package() {
+	short_desc+=" - libraries"
+	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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From 82a0d1cac670b0ddf137abafd51631056092c541 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/10] New package: fcitx5-gtk-5.0.4

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 57 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 5 files changed, 61 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index c1a2eb8acba6..51a23ad3870e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..74b3c3611ab1
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,57 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.4
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="-DENABLE_GTK2_IM_MODULE=OFF $(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel gtk+3-devel gtk4-devel fmt-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - GTK"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=9a491f6c77e796a3d47fbae052b0d8778b3728dc10326fc90d819109bbcdaccc
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+fcitx5-gtk+3_package() {
+	short_desc+="+3 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc+="4 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From 261a44c3350d4dadd762807b89100af2bd297c17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/10] New package: fcitx5-qt5-5.0.3

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template

diff --git a/common/shlibs b/common/shlibs
index 51a23ad3870e..6f584d5d81ee 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2126,6 +2126,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..f6ca5fe8bbec
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,32 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.3
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=169e13341fc4c88e5201cda4eff656fa89dcc5d973b68c1c8d57b21d1f9439e3
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From e3d352cd87cae0f93569a3bb3ec21b0a03083a03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/10] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..70d3abb58cdd
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a

From f56522fb93f3feb015d47da223044515d21b7ec8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/10] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..91083a5c5ea8
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 32e2b28491b6a7ea5a350bc7b97b67894e30b8b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 21:37:16 +0700
Subject: [PATCH 07/10] fcitx5-qt5: update to 5.0.4.

---
 srcpkgs/fcitx5-qt5/template | 4 ++--
 srcpkgs/fcitx5-qt5/update   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
index f6ca5fe8bbec..0a148cbce4d9 100644
--- a/srcpkgs/fcitx5-qt5/template
+++ b/srcpkgs/fcitx5-qt5/template
@@ -1,6 +1,6 @@
 # Template file for 'fcitx5-qt5'
 pkgname=fcitx5-qt5
-version=5.0.3
+version=5.0.4
 revision=1
 wrksrc=fcitx5-qt-$version
 build_style=cmake
@@ -13,7 +13,7 @@ maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
 license="LGPL-2.1-or-later, BSD-3-Clause"
 homepage="https://fcitx-im.org/wiki/Fcitx"
 distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
-checksum=169e13341fc4c88e5201cda4eff656fa89dcc5d973b68c1c8d57b21d1f9439e3
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
 
 post_install() {
 	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From caeb4702722756a2e9074969bd8dd62e16c2d86c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 21:37:52 +0700
Subject: [PATCH 08/10] fcitx5-gtk: update to 5.0.5.

---
 srcpkgs/fcitx5-gtk/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
index 74b3c3611ab1..d14c55559e1f 100644
--- a/srcpkgs/fcitx5-gtk/template
+++ b/srcpkgs/fcitx5-gtk/template
@@ -1,6 +1,6 @@
 # Template file for 'fcitx5-gtk'
 pkgname=fcitx5-gtk
-version=5.0.4
+version=5.0.5
 revision=1
 build_style=cmake
 build_helper=gir
@@ -8,12 +8,12 @@ configure_args="-DENABLE_GTK2_IM_MODULE=OFF $(vopt_bool gir ENABLE_GIR)"
 hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
  extra-cmake-modules glib-devel"
 makedepends="libfcitx5-devel libglib-devel gtk+3-devel gtk4-devel fmt-devel"
-short_desc="Flexible Context-aware Input Tool with eXtension v5 - GTK"
+short_desc="Fcitx v5 - GTK"
 maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
 license="LGPL-2.1-or-later"
 homepage="https://fcitx-im.org/wiki/Fcitx"
 distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
-checksum=9a491f6c77e796a3d47fbae052b0d8778b3728dc10326fc90d819109bbcdaccc
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
 
 build_options="gir"
 build_options_default="gir"

From f6e0586e7f131a88fa39c199d357f2f9b95b093c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 09/10] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 28 ++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..254826ec8013
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,28 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From b5fddcf9135d7af565fdd3824f6f38d5a7307761 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 10/10] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..df7ad5a3e34c
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] WIP: fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
  2021-03-22 15:38 ` [PR PATCH] [Updated] " sgn
@ 2021-03-22 15:38 ` sgn
  2021-03-25 15:36 ` sgn
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-22 15:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

WIP: fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 29112 bytes --]

From 15b9f1ab4b6c263ecf18195f9bf62e0f9496a59c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 1/8] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 4b82c3ced654..664df6856561 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -257,6 +257,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From fa9fbfb29a00f64454f216f8209c8f1b67b9249e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 2/8] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  61 ++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 6 files changed, 305 insertions(+)
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 664df6856561..c1a2eb8acba6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2122,6 +2122,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/patches/cross-config-template.patch b/srcpkgs/fcitx5/patches/cross-config-template.patch
new file mode 100644
index 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..093adda3bf58
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,61 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+revision=1
+build_style=cmake
+build_helper=qemu
+configure_args="
+ -DCMAKE_INSTALL_LIBDATADIR=/usr/lib${XBPS_TARGET_WORDSIZE}
+ -DUSE_SYSTEMD=OFF -DUSE_FLATPAK_ICON=ON"
+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"
+short_desc="Flexible Context-aware Input Tool with eXtension - v5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ c44a5d7847925eea9e4d2d04748d442cd28dd9299a0b572ef7d91eac4f5a6ceb"
+patch_args=-Np1
+
+skip_extraction=en_dict-${_en_dict_ver}.tar.gz
+
+# 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
+	find ${DESTDIR}/usr/share/icons -name 'fcitx.png' -delete
+	rm -f ${DESTDIR}/usr/share/icons/hicolor/scalable/apps/fcitx.svg
+}
+
+libfcitx5_package() {
+	short_desc+=" - libraries"
+	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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From ed11df1723e9c68ef2052358a3a7a2f529ab11fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 3/8] New package: fcitx5-gtk-5.0.4

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 57 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 5 files changed, 61 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index c1a2eb8acba6..51a23ad3870e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..d14c55559e1f
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,57 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="-DENABLE_GTK2_IM_MODULE=OFF $(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel gtk+3-devel gtk4-devel fmt-devel"
+short_desc="Fcitx v5 - GTK"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+fcitx5-gtk+3_package() {
+	short_desc+="+3 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc+="4 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From d9511e2470297c9962c8790ad94f78efab8c71a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 4/8] New package: fcitx5-qt5-5.0.3

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 32 ++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 36 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 51a23ad3870e..6f584d5d81ee 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2126,6 +2126,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..0a148cbce4d9
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,32 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From 1f3aed313724b4a3391bf2dc8f3db57304038804 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 5/8] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..70d3abb58cdd
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a

From 6262c65a66605bf4447ac449668c1f6fa920cf2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 6/8] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..91083a5c5ea8
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 22fb9bec946fbf9cf7b01e4e417502a10acde620 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 7/8] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 28 ++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..254826ec8013
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,28 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From c686ea5cd2036d1dd42f661dff7ad7d63c738201 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 8/8] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..df7ad5a3e34c
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] WIP: fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
  2021-03-22 15:38 ` [PR PATCH] [Updated] " sgn
  2021-03-22 15:38 ` sgn
@ 2021-03-25 15:36 ` sgn
  2021-03-26 11:42 ` sgn
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-25 15:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

WIP: fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 50947 bytes --]

From b4713207ee239b2898c2c17d4e7d3c6897e96b62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/16] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 7319cc8d20cb..3d0e41d9f3fa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From a0e27ddfd21b33cc9ba5439bf1b794ff02699d20 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/16] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  68 ++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 313 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 3d0e41d9f3fa..a1e493c04505 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..ae3ff65c83b7
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,68 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ c44a5d7847925eea9e4d2d04748d442cd28dd9299a0b572ef7d91eac4f5a6ceb"
+patch_args=-Np1
+
+skip_extraction=en_dict-${_en_dict_ver}.tar.gz
+
+# 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"
+	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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From 8350ee53e5eebf67c833bfd25b8acae72339ab91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/16] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 57 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 5 files changed, 61 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index a1e493c04505..30db51e34873 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..d14c55559e1f
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,57 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="-DENABLE_GTK2_IM_MODULE=OFF $(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel gtk+3-devel gtk4-devel fmt-devel"
+short_desc="Fcitx v5 - GTK"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+fcitx5-gtk+3_package() {
+	short_desc+="+3 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc+="4 IM Modules"
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From 4e18717b9df86b9694330f2f0491c1dd7f300427 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/16] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 32 ++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 36 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 30db51e34873..ac9be6aa1b1e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..0a148cbce4d9
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,32 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From c33cd5180bb72a47fc17773a3d1d97f2473ef7bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/16] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..898033befbf9
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From f45625734e3da4cdaae685185b92acbef7acdd27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/16] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..91083a5c5ea8
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 7c20dd5c35f90409a76f54d091ac4f6000fa4dc4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/16] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 28 ++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 29 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..254826ec8013
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,28 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 25a8c093bc2d1f1a609413f548d0e3e9300aeb3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/16] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..df7ad5a3e34c
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2

From 37fcb1bb9d3c6ded8f18f14155e1a10cb57dea54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/16] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..82c64a643345
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,21 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From d225479ace273401a51099972a2d0e4b8cc16150 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/16] New package: libime-1.0.5

---
 common/shlibs            |  3 +++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime/template  | 51 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index ac9be6aa1b1e..e9b056acc679 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..1f786ad6424f
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,51 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-1.0.5.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 3aa7b802f9581616871a7d435cbb36632194ae34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/16] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..ea1c4b65a38d 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 068030801ea5a82bcd4ed30d027c75f5e2fd5646 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/16] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel    |  1 +
 srcpkgs/fcitx5-chinese-addons-icons    |  1 +
 srcpkgs/fcitx5-chinese-addons-qt5      |  1 +
 srcpkgs/fcitx5-chinese-addons/template | 56 ++++++++++++++++++++++++++
 4 files changed, 59 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-qt5
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-qt5 b/srcpkgs/fcitx5-chinese-addons-qt5
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-qt5
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..fe340ca4f84d
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,56 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel qt5-devel
+ fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From c2b35c045e2359cb373e003754294022bceee3e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/16] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From b85018a578ebfd6e4e50ffc38396c07955ee2a5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/16] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index e9b056acc679..7c35868d85b8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..20f493800cba
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 5c851f65e605b26028ae4a97f91b310a63e610d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/16] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 7c35868d85b8..fd4606fb7786 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.17.6 zeek-3.2.4_2
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From 2d756c471b672d5504c07111f1a69aac034af644 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/16] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..1b6938da09be
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated] WIP: fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (2 preceding siblings ...)
  2021-03-25 15:36 ` sgn
@ 2021-03-26 11:42 ` sgn
  2021-03-26 12:15 ` sgn
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-26 11:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

WIP: fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 57690 bytes --]

From 41f4ea7cd492ff12713f26fb44fc57fcb70598f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/20] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 7319cc8d20cb..3d0e41d9f3fa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From dbcac07ed65a493f3605f8c43d7f55381f27f03e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/20] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 3d0e41d9f3fa..a1e493c04505 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From d35bbd2603f70527b0dd62dd3125ea8d57f22f16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/20] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 69 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 74 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index a1e493c04505..30db51e34873 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..32d5f58e5c9a
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From d59e3015ce457108c9954c9c38176039ef1b7439 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/20] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 30db51e34873..ac9be6aa1b1e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..a9c3b5ec58e1
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From ac2862b9c7ab467f8b0f568f73dd213dc1048993 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/20] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From cd0439e21e7d7c32abc75b7a36db44082cd15816 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/20] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 9348959d6950de372f72965277a72ce16b01f761 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/20] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 397cd88e12256d40c80ff049fc2eb9e408fea97f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/20] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..d6a8a9c9c732
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,15 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From e2be385f86b1abd339752fb803ad0575aa0df1a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/20] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 834a8109ae25b4386445cc22b5321afcd090cf4a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/20] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index ac9be6aa1b1e..e9b056acc679 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From a43a2f3ffffabe3c85a98b73ac2868c8e235ff27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/20] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..ea1c4b65a38d 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 83a853d84b7506f398501d05b97da6bbbf378096 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/20] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel    |  1 +
 srcpkgs/fcitx5-chinese-addons-icons    |  1 +
 srcpkgs/fcitx5-chinese-addons-qt5      |  1 +
 srcpkgs/fcitx5-chinese-addons/template | 57 ++++++++++++++++++++++++++
 4 files changed, 60 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-qt5
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-qt5 b/srcpkgs/fcitx5-chinese-addons-qt5
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-qt5
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..7b011e276695
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,57 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel qt5-devel
+ fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 45621d721758a801d8094c84956f9588d9c57689 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/20] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From a76ef626944944b8df6d0e1c7a3935dab6543279 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/20] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index e9b056acc679..7c35868d85b8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..20f493800cba
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 20aefe2e94fa45ddec2d1b195fe922c16e6b7533 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/20] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 7c35868d85b8..fd4606fb7786 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.17.6 zeek-3.2.4_2
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From 2cf82d4102051076e1ecdf57f1de56c82ed07bf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/20] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From 59b8fd3c7b1632ff829da1dcbf7b36c4fe0693b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/20] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From 1210ddeb73c92439e81c1135c860cec426fcdd23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/20] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From 8554826e15c6a36dbe5626740b4a599902e3d982 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/20] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 20a24b5f885ca0508fa1c4e1096857ee4f5a15b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/20] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..e761a192aefd 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,11 +1,11 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
 homepage="https://github.com/fcitx/fcitx-hangul"
 license="GPL-2.0-only"
@@ -13,3 +13,7 @@ distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.ta
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: WIP: fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (3 preceding siblings ...)
  2021-03-26 11:42 ` sgn
@ 2021-03-26 12:15 ` sgn
  2021-03-26 12:15 ` sgn
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-26 12:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808165278

Comment:
- Works:
    - LibreOffice
    - qutebrowser
- Broken:
    -  xterm on x86_64-musl.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: WIP: fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (4 preceding siblings ...)
  2021-03-26 12:15 ` sgn
@ 2021-03-26 12:15 ` sgn
  2021-03-26 13:59 ` [PR PATCH] [Updated] fcitx5 sgn
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-26 12:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808165278

Comment:
- Works:
    - LibreOffice
    - qutebrowser
    - firefox
- Broken:
    -  xterm on x86_64-musl.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (5 preceding siblings ...)
  2021-03-26 12:15 ` sgn
@ 2021-03-26 13:59 ` sgn
  2021-03-26 15:47 ` fcitx5 sgn
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-26 13:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 57812 bytes --]

From 41f4ea7cd492ff12713f26fb44fc57fcb70598f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/20] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 7319cc8d20cb..3d0e41d9f3fa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From dbcac07ed65a493f3605f8c43d7f55381f27f03e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/20] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 3d0e41d9f3fa..a1e493c04505 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From d35bbd2603f70527b0dd62dd3125ea8d57f22f16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/20] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 69 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 74 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index a1e493c04505..30db51e34873 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..32d5f58e5c9a
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From d59e3015ce457108c9954c9c38176039ef1b7439 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/20] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 30db51e34873..ac9be6aa1b1e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..a9c3b5ec58e1
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From ac2862b9c7ab467f8b0f568f73dd213dc1048993 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/20] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From cd0439e21e7d7c32abc75b7a36db44082cd15816 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/20] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 9348959d6950de372f72965277a72ce16b01f761 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/20] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 12f2d533a476c37715b54a9ad3bb031893d53304 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/20] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..597d193e3e00
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db fcitx5"
+checkdepends="$depends"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From e19fec522039d1bf546f56ed89d46e72d29a4ef3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/20] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From bbd4de671c924891b55fed7a22f078eb040b4828 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/20] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index ac9be6aa1b1e..e9b056acc679 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 3ddb4adb2591a6848a375702bf427124bcdc7279 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/20] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..8f2c9c4ce432 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx5-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 344e4da94bf1af73b3ff653be1e6792aa6a68de2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/20] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel    |  1 +
 srcpkgs/fcitx5-chinese-addons-icons    |  1 +
 srcpkgs/fcitx5-chinese-addons-qt5      |  1 +
 srcpkgs/fcitx5-chinese-addons/template | 57 ++++++++++++++++++++++++++
 4 files changed, 60 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-qt5
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-qt5 b/srcpkgs/fcitx5-chinese-addons-qt5
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-qt5
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..7b011e276695
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,57 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel qt5-devel
+ fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From d115cd8f1ce57e8b97b92e6b70623c5caedc07b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/20] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From c88e2d2e6e14221725fa890a7f1697c9e3ab4cf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/20] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index e9b056acc679..7c35868d85b8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..20f493800cba
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 0fdead00cdc351dd08b3be2a2963b7bb2f561760 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/20] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 7c35868d85b8..fd4606fb7786 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.17.6 zeek-3.2.4_2
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From 1b8f0bb325a7ac197d58a803b078bbc14e2186fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/20] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From 48df26c6d58b22e78fb71bd6ef707f6cb30dca5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/20] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From fb894ec9c3658c6a96d5d9bd6978b848bc86a2fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/20] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From fe075c3fc8c3c5da9dc7ddac9846140e750a07e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/20] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 5f39db0e60879d51bbdebfb8f3f62166fb3a29bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/20] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..d1b50e2d6237 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,15 +1,20 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
-homepage="https://github.com/fcitx/fcitx-hangul"
+maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-only"
+homepage="https://github.com/fcitx/fcitx-hangul"
 distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.tar.xz"
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (6 preceding siblings ...)
  2021-03-26 13:59 ` [PR PATCH] [Updated] fcitx5 sgn
@ 2021-03-26 15:47 ` sgn
  2021-03-27 20:18 ` fcitx5 noarchwastaken
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-26 15:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808323549

Comment:
`-DNDEBUG` is added by CMake for `Release` `MinSizeRel` and `RelWithDebInfo`

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (7 preceding siblings ...)
  2021-03-26 15:47 ` fcitx5 sgn
@ 2021-03-27 20:18 ` noarchwastaken
  2021-03-27 21:54 ` fcitx5 noarchwastaken
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: noarchwastaken @ 2021-03-27 20:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 891 bytes --]

New comment by noarchwastaken on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808796771

Comment:
> @noarchwastaken please test.

Here's my tests on sway, all apps are running in native Wayland except those under "XWayland Apps":

Works:
- Firefox
- Thunderbird
- Thunar
- Epiphany
- Evince
- Telegram Desktop
- KeepassXC
- FileZilla
- XWayland Apps
  - GIMP
  - XTerm
    (probably because I use glibc?)
  - Element
  - VSCode - OSS

Don't (fully) work:
- Flatpak Wayland GTK apps (Fcitx5 runs in XWayland, blurry and has wrong position)
  - Firefox
  - Flatseal
  - [GIMP beta](https://www.gimp.org/downloads/devel/)
- Wofi
  Weird behavior: the first candidate is automatically selected upon every key press, and the whole screen glitches
- Alacritty (known Alacritty issue)

Thank you very much for the work!

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (8 preceding siblings ...)
  2021-03-27 20:18 ` fcitx5 noarchwastaken
@ 2021-03-27 21:54 ` noarchwastaken
  2021-03-27 22:05 ` fcitx5 noarchwastaken
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: noarchwastaken @ 2021-03-27 21:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

New comment by noarchwastaken on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808796771

Comment:
> @noarchwastaken please test.

Here are my tests on sway, all apps are running in native Wayland except those under "XWayland Apps":

Works:
- Firefox
- Thunderbird
- Thunar
- Epiphany
- Evince
- Telegram Desktop
- KeepassXC
- FileZilla
- XWayland Apps
  - GIMP
  - XTerm
    (probably because I use glibc?)
  - Element
  - VSCode - OSS

Don't (fully) work:
- Flatpak Wayland GTK apps (Fcitx5 runs in XWayland, blurry and has wrong position)
  - Firefox
  - Flatseal
  - [GIMP beta](https://www.gimp.org/downloads/devel/)
- Wofi
  Weird behavior: the first candidate is automatically selected upon every key press, and the whole screen glitches
- Alacritty Wayland (known Alacritty issue)

Thank you very much for the work!

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (9 preceding siblings ...)
  2021-03-27 21:54 ` fcitx5 noarchwastaken
@ 2021-03-27 22:05 ` noarchwastaken
  2021-03-28  0:40 ` fcitx5 sgn
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: noarchwastaken @ 2021-03-27 22:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

New comment by noarchwastaken on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808808989

Comment:
Would you please package Mozc for fcitx5 too?

If it doesn't conform the quality standard yet (I couldn't find release tarballs for it), what about packaging fcitx5-kkc or creating another branch for Mozc but not put it in the PR for now? It would be useful for some people, including me, a Japanese learner.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (10 preceding siblings ...)
  2021-03-27 22:05 ` fcitx5 noarchwastaken
@ 2021-03-28  0:40 ` sgn
  2021-03-28 17:00 ` fcitx5 noarchwastaken
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-28  0:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808823818

Comment:
On 2021-03-27 15:05:52-0700, noarchwastaken ***@***.***> wrote:
> Would you please package Mozc for fcitx5 too?

Maybe -anthy would work for you?

> If it doesn't conform the quality standard yet (I couldn't find
> release tarballs for it),
> what about packaging fcitx5-kkc or

I will look into -kkc later

> creating another branch for Mozc but not put it in the PR for now?
> It would be useful for some people, including me, a Japanese
> learner.


^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (11 preceding siblings ...)
  2021-03-28  0:40 ` fcitx5 sgn
@ 2021-03-28 17:00 ` noarchwastaken
  2021-03-29  1:08 ` fcitx5 noarchwastaken
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: noarchwastaken @ 2021-03-28 17:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

New comment by noarchwastaken on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808796771

Comment:
> @noarchwastaken please test.

Here are my tests on sway, all apps are running in native Wayland except those under "XWayland Apps":

Works:
- Firefox
- Thunderbird
- Thunar
- Epiphany
- Evince
- Telegram Desktop
- KeepassXC
- FileZilla
- XWayland Apps
  - GIMP
  - XTerm
    (probably because I use glibc?)
  - Element
  - VSCode - OSS
  - VLC

Don't (fully) work:
- Flatpak Wayland GTK apps (Fcitx5 runs in XWayland, blurry and has wrong position)
  - Firefox
  - Flatseal
  - [GIMP beta](https://www.gimp.org/downloads/devel/)
- Wofi
  Weird behavior: the first candidate is automatically selected upon every key press, and the whole screen glitches
- Alacritty Wayland (known Alacritty issue)

Thank you very much for the work!

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (12 preceding siblings ...)
  2021-03-28 17:00 ` fcitx5 noarchwastaken
@ 2021-03-29  1:08 ` noarchwastaken
  2021-03-30 15:44 ` [PR PATCH] [Updated] fcitx5 sgn
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: noarchwastaken @ 2021-03-29  1:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

New comment by noarchwastaken on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-808796771

Comment:
> @noarchwastaken please test.

Here are my tests on sway, all apps are running in native Wayland except those under "XWayland Apps":

Works:
- Firefox
- Thunderbird
- Thunar
- Epiphany
- Evince
- Telegram Desktop
- KeepassXC
- FileZilla
- Kleopatra
- XWayland Apps
  - GIMP
  - XTerm
    (probably because I use glibc?)
  - Element
  - VSCode - OSS
  - VLC

Don't (fully) work:
- Flatpak Wayland GTK apps (Fcitx5 runs in XWayland, blurry and has wrong position)
  - Firefox
  - Flatseal
  - [GIMP beta](https://www.gimp.org/downloads/devel/)
- Wofi
  Weird behavior: the first candidate is automatically selected upon every key press, and the whole screen glitches
- Alacritty Wayland (known Alacritty issue)

Thank you very much for the work!

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (13 preceding siblings ...)
  2021-03-29  1:08 ` fcitx5 noarchwastaken
@ 2021-03-30 15:44 ` sgn
  2021-03-30 15:46 ` sgn
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-30 15:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 89487 bytes --]

From 923e1e3c5ffbb8d92cf6e4933bc7d2218677ad9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/28] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 3a2c8d27b3a0..807397b5f878 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 8fa5485b58fa03a1ebae9559411ed25f56c76520 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/28] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 807397b5f878..b8e61ea69d49 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From 1697e205302e7934ef944fb556eab633d009dbbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/28] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 71 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 76 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index b8e61ea69d49..2203da5c3d2c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..06a54a221d65
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,71 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,/usr,${_IMPORT_PREFIX},g' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From 2e99f5778434ce48dfd09bb473b5efe8150baae2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/28] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 2203da5c3d2c..e9659a12599d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..79da6b401796
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision} qt5-devel"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From 25d710f879ef47dde86d9ccc81e48b2e51ba2d9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/28] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From f340147f034751eb782fc74cb3f9cec8882ce1ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/28] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From c52465d6383100a40f7e68551bb0b9fc48a3ca95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/28] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 7b9ba0f21a62915b86adcee01164030f3d2a7fb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/28] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..597d193e3e00
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db fcitx5"
+checkdepends="$depends"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From 913af7b476ae35efb2c3b6d871001779379b7c0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/28] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From a2ce2623d1a9f2b65779ca413dbf0f37740f538d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/28] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index e9659a12599d..db492cbda7d9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 5db46e2f89a8b30c4b4e744857e2759ae48d04b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/28] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..ea1c4b65a38d 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 4129190ebfb59ff09a11318f87b00a23cd32db97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/28] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel    |  1 +
 srcpkgs/fcitx5-chinese-addons-icons    |  1 +
 srcpkgs/fcitx5-chinese-addons-qt5      |  1 +
 srcpkgs/fcitx5-chinese-addons/template | 56 ++++++++++++++++++++++++++
 4 files changed, 59 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-qt5
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-qt5 b/srcpkgs/fcitx5-chinese-addons-qt5
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-qt5
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..6619e108a608
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,56 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 28a47ddf76792f3f7861112fca40d28cb04e802a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/28] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From 3c75d58010f89dcb5f157a7d822520d61275b705 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/28] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index db492cbda7d9..375e907bdfc4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..46a5ad944e88
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3 libime-utils"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 5ba559459adc43db7fd64020224d8ad2b4b91335 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/28] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 375e907bdfc4..9b8e2bdb4637 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.17.6 zeek-3.2.4_2
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From 5557943949a0bf90f316e1480e28ca99cc84db6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/28] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From 8638730c6f1da5eade2c19426e36fcd09bda342d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/28] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From dd3fccc85982ce4a72324d042e6e44d630435821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/28] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From 6c12dcae2c413ca69370eea6ae64a48f2bf95767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/28] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 21d78dcd871087eb27329b7f2ddb0bd15c48a35c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/28] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..e761a192aefd 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,11 +1,11 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
 homepage="https://github.com/fcitx/fcitx-hangul"
 license="GPL-2.0-only"
@@ -13,3 +13,7 @@ distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.ta
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From b59f604db86cd6b32af2e1a8c615829541b5e409 Mon Sep 17 00:00:00 2001
From: Artur Sinila <opensource@logarithmus.dev>
Date: Wed, 17 Mar 2021 17:48:51 +0300
Subject: [PATCH 21/28] New package: zlib-ng-2.0.2

---
 srcpkgs/zlib-ng-devel       |  1 +
 srcpkgs/zlib-ng/INSTALL.msg |  3 +++
 srcpkgs/zlib-ng/REMOVE.msg  |  3 +++
 srcpkgs/zlib-ng/template    | 30 ++++++++++++++++++++++++++++++
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/zlib-ng-devel
 create mode 100644 srcpkgs/zlib-ng/INSTALL.msg
 create mode 100644 srcpkgs/zlib-ng/REMOVE.msg
 create mode 100644 srcpkgs/zlib-ng/template

diff --git a/srcpkgs/zlib-ng-devel b/srcpkgs/zlib-ng-devel
new file mode 120000
index 000000000000..65f4ecb07e5b
--- /dev/null
+++ b/srcpkgs/zlib-ng-devel
@@ -0,0 +1 @@
+zlib-ng
\ No newline at end of file
diff --git a/srcpkgs/zlib-ng/INSTALL.msg b/srcpkgs/zlib-ng/INSTALL.msg
new file mode 100644
index 000000000000..2b50efdb4f7b
--- /dev/null
+++ b/srcpkgs/zlib-ng/INSTALL.msg
@@ -0,0 +1,3 @@
+In order to use `zlib-ng` instead of `zlib`, add this line to /etc/ld.so.preload:
+/usr/lib/zlib-ng/libz.so.1
+
diff --git a/srcpkgs/zlib-ng/REMOVE.msg b/srcpkgs/zlib-ng/REMOVE.msg
new file mode 100644
index 000000000000..ea2cad37daf8
--- /dev/null
+++ b/srcpkgs/zlib-ng/REMOVE.msg
@@ -0,0 +1,3 @@
+Since `zlib-ng` package is uninstalled now, you can remove this line from /etc/ld.so.preload:
+/usr/lib/zlib-ng/libz.so.1
+
diff --git a/srcpkgs/zlib-ng/template b/srcpkgs/zlib-ng/template
new file mode 100644
index 000000000000..20b15edf102b
--- /dev/null
+++ b/srcpkgs/zlib-ng/template
@@ -0,0 +1,30 @@
+# Template file for 'zlib-ng'
+pkgname=zlib-ng
+version=2.0.2
+revision=1
+build_style=cmake
+configure_args="-DZLIB_COMPAT=ON"
+short_desc="Zlib replacement with optimizations for 'next generation' systems"
+maintainer="Artur Sinila <opensource@logarithmus.dev>"
+license="Zlib"
+homepage="https://github.com/zlib-ng/zlib-ng"
+distfiles="https://github.com/zlib-ng/zlib-ng/archive/${version}.tar.gz"
+checksum=dd37886f22ca6890e403ea6c1d60f36eab1d08d2f232a35f5b02126621149d28
+
+post_install() {
+	mkdir "${DESTDIR}/usr/lib/zlib-ng" "${DESTDIR}/usr/include/zlib-ng"
+	mv "${DESTDIR}/usr/lib/pkgconfig/zlib.pc" "${DESTDIR}/usr/lib/pkgconfig/zlib-ng.pc"
+	mv ${DESTDIR}/usr/lib/libz.* ${DESTDIR}/usr/lib/zlib-ng/
+	mv ${DESTDIR}/usr/include/*.h ${DESTDIR}/usr/include/zlib-ng/
+}
+
+zlib-ng-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/zlib-ng/*.a"
+		vmove "usr/lib/zlib-ng/*.so"
+	}
+}

From 88874893f4a7c75aeb239847859e15e4c1cdb25d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 18:42:50 +0700
Subject: [PATCH 22/28] New package: anthy-unicode-1.0.0.20201109

---
 common/shlibs                  |  3 +++
 srcpkgs/anthy-unicode-devel    |  1 +
 srcpkgs/anthy-unicode/template | 36 ++++++++++++++++++++++++++++++++++
 srcpkgs/libanthy-unicode       |  1 +
 4 files changed, 41 insertions(+)
 create mode 120000 srcpkgs/anthy-unicode-devel
 create mode 100644 srcpkgs/anthy-unicode/template
 create mode 120000 srcpkgs/libanthy-unicode

diff --git a/common/shlibs b/common/shlibs
index 9b8e2bdb4637..cfab83ce691d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2335,6 +2335,9 @@ liboath.so.0 oath-toolkit-2.6.0_2
 libanthy.so.1 libanthy-0.4_1
 libanthydic.so.1 libanthy-0.4_1
 libanthyinput.so.0 libanthy-0.4_1
+libanthy-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthydic-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthyinput-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
 libanthygobject-1.0.so.5 ibus-anthy-1.5.6_1
 libtbbmalloc_proxy_debug.so.2 tbb-4.3_1
 libtbbmalloc_proxy.so.2 tbb-4.3_1
diff --git a/srcpkgs/anthy-unicode-devel b/srcpkgs/anthy-unicode-devel
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/anthy-unicode-devel
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file
diff --git a/srcpkgs/anthy-unicode/template b/srcpkgs/anthy-unicode/template
new file mode 100644
index 000000000000..1cd2bdffa9b0
--- /dev/null
+++ b/srcpkgs/anthy-unicode/template
@@ -0,0 +1,36 @@
+# Template file for 'anthy-unicode'
+pkgname=anthy-unicode
+version=1.0.0.20201109
+revision=1
+build_style=gnu-configure
+configure_args="--disable-static"
+short_desc="Japanese character set input library for Unicode"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.0-or-later, GPL-2.0-only, Public Domain"
+homepage="https://github.com/fujiwarat/anthy-unicode/wiki"
+distfiles="https://github.com/fujiwarat/anthy-unicode/releases/download/${version}/${pkgname}-${version}.tar.gz"
+checksum=7d595bd422222bd67d7944f0c29f7d739fe677e4b885de3d4f0dae417b674381
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/*.la
+}
+
+libanthy-unicode_package() {
+	short_desc+=" - libraries"
+	conf_files="/etc/anthy-unicode.conf"
+	pkg_install() {
+		vmove etc/anthy-unicode.conf
+		vmove "usr/lib/*.so.*"
+		vmove usr/share
+	}
+}
+
+anthy-unicode-devel_package() {
+	short_desc+=" - development files"
+	depends="libanthy-unicode-${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/libanthy-unicode b/srcpkgs/libanthy-unicode
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/libanthy-unicode
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file

From 14c1df9b0b9075df3960c2c5a14954584e816851 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:31 +0700
Subject: [PATCH 23/28] fcitx-anthy: use shared icons with fcitx5

---
 srcpkgs/fcitx-anthy/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-anthy/template b/srcpkgs/fcitx-anthy/template
index d03499e83c3e..053db036dec4 100644
--- a/srcpkgs/fcitx-anthy/template
+++ b/srcpkgs/fcitx-anthy/template
@@ -1,10 +1,10 @@
 # Template file for 'fcitx-anthy'
 pkgname=fcitx-anthy
 version=0.2.3
-revision=2
+revision=3
 build_style=cmake
 makedepends="anthy-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-anthy-icons"
 short_desc="Fcitx wrapper for Anthy IM engine"
 maintainer="Matthias von Faber <mvf@gmx.eu>"
 license="GPL-2.0-or-later"
@@ -13,3 +13,7 @@ distfiles="https://github.com/fcitx/fcitx-anthy/archive/${version}.tar.gz"
 checksum=31826a49a7ff743f830e1279527301abce9e669bc176934c76775999299421a8
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 8e203d28048b06aa48979d43e47ba92470f96f23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:38 +0700
Subject: [PATCH 24/28] New package: fcitx5-anthy-5.0.4

---
 srcpkgs/fcitx5-anthy-icons                    |  1 +
 .../fcitx5-anthy/patches/fix-build-musl.patch | 18 +++++++++++++++
 srcpkgs/fcitx5-anthy/template                 | 23 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/fcitx5-anthy-icons
 create mode 100644 srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
 create mode 100644 srcpkgs/fcitx5-anthy/template

diff --git a/srcpkgs/fcitx5-anthy-icons b/srcpkgs/fcitx5-anthy-icons
new file mode 120000
index 000000000000..6fee45a4d396
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy-icons
@@ -0,0 +1 @@
+fcitx5-anthy
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
new file mode 100644
index 000000000000..bc19b7c5c406
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
@@ -0,0 +1,18 @@
+Index: fcitx5-anthy-5.0.4/src/utils.h
+===================================================================
+--- fcitx5-anthy-5.0.4.orig/src/utils.h
++++ fcitx5-anthy-5.0.4/src/utils.h
+@@ -28,11 +28,11 @@ bool key_is_keypad(const fcitx::Key &key
+ std::string keypad_to_string(const fcitx::KeyEvent &key);
+ void launch_program(std::string command);
+ 
+-bool surrounding_get_safe_delta(uint from, uint to, int32_t *delta);
++bool surrounding_get_safe_delta(unsigned from, unsigned to, int32_t *delta);
+ 
+ bool surrounding_get_anchor_pos_from_selection(
+     const std::string &surrounding_text, const std::string &selected_text,
+-    uint cursor_pos, uint *anchor_pos);
++    unsigned cursor_pos, unsigned *anchor_pos);
+ 
+ inline char get_ascii_code(const fcitx::Key &key) {
+     auto chr = fcitx::Key::keySymToUnicode(key.sym());
diff --git a/srcpkgs/fcitx5-anthy/template b/srcpkgs/fcitx5-anthy/template
new file mode 100644
index 000000000000..a2bec24b3080
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-anthy'
+pkgname=fcitx5-anthy
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="anthy-unicode-devel libfcitx5-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Anthy engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-anthy/fcitx5-anthy-${version}.tar.xz"
+checksum=6e15c0e32508db3e6b233efb99677a7b4b4478950a57bb76bd509355276b9636
+patch_args=-Np1
+
+fcitx5-anthy-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-anthy<=0.2.3_2"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 0c2e398280b53a63e63e309572f8d5baa01558bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 22:03:06 +0700
Subject: [PATCH 25/28] marisa: build python3 bindings

---
 srcpkgs/marisa/template | 41 +++++++++++++++++++++++++++++++++++++++--
 srcpkgs/python3-marisa  |  1 +
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/python3-marisa

diff --git a/srcpkgs/marisa/template b/srcpkgs/marisa/template
index 2aebc8712f5b..95e0403a7fef 100644
--- a/srcpkgs/marisa/template
+++ b/srcpkgs/marisa/template
@@ -1,10 +1,11 @@
 # Template file for 'marisa'
 pkgname=marisa
 version=0.2.6
-revision=1
+revision=2
 wrksrc="${pkgname}-trie-$version"
 build_style=gnu-configure
-hostmakedepends="autoconf automake libtool"
+hostmakedepends="autoconf automake libtool python3-setuptools swig"
+makedepends="python3-devel"
 short_desc="Matching Algorithm with Recursively Implemented StorAge"
 maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
 license="BSD-2-Clause, LGPL-2.1-or-later"
@@ -16,14 +17,50 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*) configure_args+=" --enable-popcnt --enable-sse2";;
 esac
 
+CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+CXXFLAGS="$CFLAGS"
+LDFLAGS="-L${XBPS_CROSS_BASE}/${py3_lib}"
+
+_python_env() {
+	local f
+	CFLAGS+=" -I${wrksrc}/include"
+	LDFLAGS+=" -L${wrksrc}/lib/marisa/.libs"
+	export PYPREFIX="${XBPS_CROSS_BASE}"
+	export LDSHARED="${CXX} -shared ${LDFLAGS}"
+	export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
+	for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+		f=${f##*/}
+		export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+	done
+}
+
 pre_configure() {
 	autoreconf -fi
 }
 
+post_build() {
+	make -C bindings
+	cd ${wrksrc}/bindings/python
+	_python_env
+	python3 setup.py build
+	cd ${wrksrc}
+}
+
 post_install() {
 	vlicense COPYING.md
 }
 
+python3-marisa_package() {
+	short_desc+=" - Python 3 bindings"
+	depends="python3"
+	pkg_install() {
+		cd ${wrksrc}/bindings/python
+		_python_env
+		python3 setup.py install --root=${PKGDESTDIR} --prefix=/usr
+		cd ${wrksrc}
+	}
+}
+
 marisa-devel_package() {
 	depends="marisa-${version}_${revision}"
 	short_desc+=" - development files"
diff --git a/srcpkgs/python3-marisa b/srcpkgs/python3-marisa
new file mode 120000
index 000000000000..4ebb55bc8b9f
--- /dev/null
+++ b/srcpkgs/python3-marisa
@@ -0,0 +1 @@
+marisa
\ No newline at end of file

From 5a01ca4ab44194a15eedb70802822c56acd8fde6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:49:25 +0700
Subject: [PATCH 26/28] New package: libkkc-data-0.2.7

---
 srcpkgs/libkkc-data/patches/python3.patch | 138 ++++++++++++++++++++++
 srcpkgs/libkkc-data/template              |  14 +++
 2 files changed, 152 insertions(+)
 create mode 100644 srcpkgs/libkkc-data/patches/python3.patch
 create mode 100644 srcpkgs/libkkc-data/template

diff --git a/srcpkgs/libkkc-data/patches/python3.patch b/srcpkgs/libkkc-data/patches/python3.patch
new file mode 100644
index 000000000000..70bfdcc0d372
--- /dev/null
+++ b/srcpkgs/libkkc-data/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ taken from libkkc
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/tools/genfilter.py b/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/tools/genfilter.py
++++ b/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+index a0dd8fe..40f0837 100644
+--- a/tools/sortlm.py
++++ b/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc-data/template b/srcpkgs/libkkc-data/template
new file mode 100644
index 000000000000..ffbfa76c4247
--- /dev/null
+++ b/srcpkgs/libkkc-data/template
@@ -0,0 +1,14 @@
+# Template file for 'libkkc-data'
+pkgname=libkkc-data
+_libkkc_version=0.3.5
+version=0.2.7
+revision=1
+build_style=gnu-configure
+hostmakedepends="python3-marisa"
+short_desc="Japanese Kana Kanji conversion input method library - data"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${_libkkc_version}/libkkc-data-${version}.tar.xz"
+checksum=9e678755a030043da68e37a4049aa296c296869ff1fb9e6c70026b2541595b99
+patch_args=-Np1

From 1653393f8cbfa891bca4088dec6f2bba47dd3aac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:24:13 +0700
Subject: [PATCH 27/28] New package: libkkc-0.3.5

---
 common/shlibs                              |   1 +
 srcpkgs/libkkc-devel                       |   1 +
 srcpkgs/libkkc-utils                       |   1 +
 srcpkgs/libkkc/patches/musl-locale.patch   |  13 ++
 srcpkgs/libkkc/patches/no-ssp-static.patch |  13 ++
 srcpkgs/libkkc/patches/python3.patch       | 138 +++++++++++++++++++++
 srcpkgs/libkkc/template                    |  46 +++++++
 7 files changed, 213 insertions(+)
 create mode 120000 srcpkgs/libkkc-devel
 create mode 120000 srcpkgs/libkkc-utils
 create mode 100644 srcpkgs/libkkc/patches/musl-locale.patch
 create mode 100644 srcpkgs/libkkc/patches/no-ssp-static.patch
 create mode 100644 srcpkgs/libkkc/patches/python3.patch
 create mode 100644 srcpkgs/libkkc/template

diff --git a/common/shlibs b/common/shlibs
index cfab83ce691d..8aac1f0f0249 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3112,6 +3112,7 @@ libopenglrecorder.so.0 libopenglrecorder-0.1.0_1
 libgpod.so.4 libgpod-0.8.3_1
 libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
+libkkc.so.2 libkkc-0.3.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
diff --git a/srcpkgs/libkkc-devel b/srcpkgs/libkkc-devel
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-devel
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc-utils b/srcpkgs/libkkc-utils
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-utils
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc/patches/musl-locale.patch b/srcpkgs/libkkc/patches/musl-locale.patch
new file mode 100644
index 000000000000..5ae9e6eb2c7e
--- /dev/null
+++ b/srcpkgs/libkkc/patches/musl-locale.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -6710,7 +6710,7 @@ fi
+ 
+     ;;
+     *)
+-    DATADIRNAME=lib
++    DATADIRNAME=share
+     ;;
+     esac
+ fi
diff --git a/srcpkgs/libkkc/patches/no-ssp-static.patch b/srcpkgs/libkkc/patches/no-ssp-static.patch
new file mode 100644
index 000000000000..ea5013582061
--- /dev/null
+++ b/srcpkgs/libkkc/patches/no-ssp-static.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -18480,7 +18480,7 @@ $as_echo "yes" >&6; }
+ fi
+ 
+ # libstdc++ needs to be linked with libmarisa-glib.a
+-MARISA_GLIB_STATIC_DEPENDENCIES="$postdeps_CXX"
++MARISA_GLIB_STATIC_DEPENDENCIES="-lstdc++"
+ 
+ 
+ LIBKKC_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS"
diff --git a/srcpkgs/libkkc/patches/python3.patch b/srcpkgs/libkkc/patches/python3.patch
new file mode 100644
index 000000000000..91d3f6956e88
--- /dev/null
+++ b/srcpkgs/libkkc/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/data/templates/libkkc-data/tools/genfilter.py b/data/templates/libkkc-data/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/data/templates/libkkc-data/tools/genfilter.py
++++ b/data/templates/libkkc-data/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+diff --git a/data/templates/libkkc-data/tools/sortlm.py b/data/templates/libkkc-data/tools/sortlm.py
+index a0dd8fe..40f0837 100644
+--- a/data/templates/libkkc-data/tools/sortlm.py
++++ b/data/templates/libkkc-data/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc/template b/srcpkgs/libkkc/template
new file mode 100644
index 000000000000..dc4d76a771ca
--- /dev/null
+++ b/srcpkgs/libkkc/template
@@ -0,0 +1,46 @@
+# Template file for 'libkkc'
+pkgname=libkkc
+version=0.3.5
+revision=1
+build_style=gnu-configure
+build_helper=gir
+configure_args="--disable-static --disable-silent-rules"
+make_build_args="V=1"
+hostmakedepends="pkg-config glib-devel gettext intltool python3-marisa
+ $(vopt_if gir vala)"
+makedepends="libglib-devel libgee08-devel json-glib-devel marisa-devel
+ $(vopt_if gir vala-devel)"
+depends="libkkc-data"
+short_desc="Japanese Kana Kanji conversion input method library"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${version}/libkkc-${version}.tar.gz"
+checksum=89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef
+patch_args=-Np1
+python_version=3
+
+build_options="gir"
+build_options_default="gir"
+
+libkkc-utils_package() {
+	short_desc+=" - utils"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/locale
+	}
+}
+
+libkkc-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/share/libkkc/templates
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+			vmove usr/share/vala
+		fi
+	}
+}

From 07664a92105d4de9e9f0015571a03b02557b6141 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 22:43:59 +0700
Subject: [PATCH 28/28] New package: fcitx5-kkc-5.0.5

---
 srcpkgs/fcitx5-kkc-qt5      |  1 +
 srcpkgs/fcitx5-kkc/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-kkc-qt5
 create mode 100644 srcpkgs/fcitx5-kkc/template

diff --git a/srcpkgs/fcitx5-kkc-qt5 b/srcpkgs/fcitx5-kkc-qt5
new file mode 120000
index 000000000000..4686c1fbe9b3
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc-qt5
@@ -0,0 +1 @@
+fcitx5-kkc
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-kkc/template b/srcpkgs/fcitx5-kkc/template
new file mode 100644
index 000000000000..7ee3ab77ff7f
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-kkc'
+pkgname=fcitx5-kkc
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libkkc-devel libgee08-devel json-glib-devel"
+short_desc="Fcitx5 - kkc engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-kkc/fcitx5-kkc-${version}.tar.xz"
+checksum=0e5fc4a8cd3dce8fa3774e6f304013869709aaa7cda9d9420386841e6d850b92
+
+fcitx5-kkc-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (14 preceding siblings ...)
  2021-03-30 15:44 ` [PR PATCH] [Updated] fcitx5 sgn
@ 2021-03-30 15:46 ` sgn
  2021-03-30 15:48 ` sgn
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-30 15:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 86849 bytes --]

From 923e1e3c5ffbb8d92cf6e4933bc7d2218677ad9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/27] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 3a2c8d27b3a0..807397b5f878 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 8fa5485b58fa03a1ebae9559411ed25f56c76520 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/27] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 807397b5f878..b8e61ea69d49 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From 1697e205302e7934ef944fb556eab633d009dbbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/27] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 71 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 76 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index b8e61ea69d49..2203da5c3d2c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..06a54a221d65
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,71 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,/usr,${_IMPORT_PREFIX},g' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From 2e99f5778434ce48dfd09bb473b5efe8150baae2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/27] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 2203da5c3d2c..e9659a12599d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..79da6b401796
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision} qt5-devel"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From 25d710f879ef47dde86d9ccc81e48b2e51ba2d9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/27] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From f340147f034751eb782fc74cb3f9cec8882ce1ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/27] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From c52465d6383100a40f7e68551bb0b9fc48a3ca95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/27] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 7b9ba0f21a62915b86adcee01164030f3d2a7fb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/27] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..597d193e3e00
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db fcitx5"
+checkdepends="$depends"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From 913af7b476ae35efb2c3b6d871001779379b7c0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/27] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From a2ce2623d1a9f2b65779ca413dbf0f37740f538d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/27] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index e9659a12599d..db492cbda7d9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 5db46e2f89a8b30c4b4e744857e2759ae48d04b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/27] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..ea1c4b65a38d 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 4129190ebfb59ff09a11318f87b00a23cd32db97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/27] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel    |  1 +
 srcpkgs/fcitx5-chinese-addons-icons    |  1 +
 srcpkgs/fcitx5-chinese-addons-qt5      |  1 +
 srcpkgs/fcitx5-chinese-addons/template | 56 ++++++++++++++++++++++++++
 4 files changed, 59 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-qt5
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-qt5 b/srcpkgs/fcitx5-chinese-addons-qt5
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-qt5
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..6619e108a608
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,56 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 28a47ddf76792f3f7861112fca40d28cb04e802a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/27] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From 3c75d58010f89dcb5f157a7d822520d61275b705 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/27] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index db492cbda7d9..375e907bdfc4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..46a5ad944e88
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3 libime-utils"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 5ba559459adc43db7fd64020224d8ad2b4b91335 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/27] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 375e907bdfc4..9b8e2bdb4637 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.17.6 zeek-3.2.4_2
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From 5557943949a0bf90f316e1480e28ca99cc84db6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/27] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From 8638730c6f1da5eade2c19426e36fcd09bda342d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/27] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From dd3fccc85982ce4a72324d042e6e44d630435821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/27] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From 6c12dcae2c413ca69370eea6ae64a48f2bf95767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/27] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 21d78dcd871087eb27329b7f2ddb0bd15c48a35c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/27] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..e761a192aefd 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,11 +1,11 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
 homepage="https://github.com/fcitx/fcitx-hangul"
 license="GPL-2.0-only"
@@ -13,3 +13,7 @@ distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.ta
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 32cdc9bc69f241b1c3d2ecb95e25214487fe412e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 18:42:50 +0700
Subject: [PATCH 21/27] New package: anthy-unicode-1.0.0.20201109

---
 common/shlibs                  |  3 +++
 srcpkgs/anthy-unicode-devel    |  1 +
 srcpkgs/anthy-unicode/template | 36 ++++++++++++++++++++++++++++++++++
 srcpkgs/libanthy-unicode       |  1 +
 4 files changed, 41 insertions(+)
 create mode 120000 srcpkgs/anthy-unicode-devel
 create mode 100644 srcpkgs/anthy-unicode/template
 create mode 120000 srcpkgs/libanthy-unicode

diff --git a/common/shlibs b/common/shlibs
index 9b8e2bdb4637..cfab83ce691d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2335,6 +2335,9 @@ liboath.so.0 oath-toolkit-2.6.0_2
 libanthy.so.1 libanthy-0.4_1
 libanthydic.so.1 libanthy-0.4_1
 libanthyinput.so.0 libanthy-0.4_1
+libanthy-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthydic-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthyinput-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
 libanthygobject-1.0.so.5 ibus-anthy-1.5.6_1
 libtbbmalloc_proxy_debug.so.2 tbb-4.3_1
 libtbbmalloc_proxy.so.2 tbb-4.3_1
diff --git a/srcpkgs/anthy-unicode-devel b/srcpkgs/anthy-unicode-devel
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/anthy-unicode-devel
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file
diff --git a/srcpkgs/anthy-unicode/template b/srcpkgs/anthy-unicode/template
new file mode 100644
index 000000000000..1cd2bdffa9b0
--- /dev/null
+++ b/srcpkgs/anthy-unicode/template
@@ -0,0 +1,36 @@
+# Template file for 'anthy-unicode'
+pkgname=anthy-unicode
+version=1.0.0.20201109
+revision=1
+build_style=gnu-configure
+configure_args="--disable-static"
+short_desc="Japanese character set input library for Unicode"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.0-or-later, GPL-2.0-only, Public Domain"
+homepage="https://github.com/fujiwarat/anthy-unicode/wiki"
+distfiles="https://github.com/fujiwarat/anthy-unicode/releases/download/${version}/${pkgname}-${version}.tar.gz"
+checksum=7d595bd422222bd67d7944f0c29f7d739fe677e4b885de3d4f0dae417b674381
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/*.la
+}
+
+libanthy-unicode_package() {
+	short_desc+=" - libraries"
+	conf_files="/etc/anthy-unicode.conf"
+	pkg_install() {
+		vmove etc/anthy-unicode.conf
+		vmove "usr/lib/*.so.*"
+		vmove usr/share
+	}
+}
+
+anthy-unicode-devel_package() {
+	short_desc+=" - development files"
+	depends="libanthy-unicode-${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/libanthy-unicode b/srcpkgs/libanthy-unicode
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/libanthy-unicode
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file

From 223f58912ada789ed94e4e56bca4c790f108601c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:38 +0700
Subject: [PATCH 22/27] New package: fcitx5-anthy-5.0.4

---
 srcpkgs/fcitx5-anthy-icons                    |  1 +
 .../fcitx5-anthy/patches/fix-build-musl.patch | 18 +++++++++++++++
 srcpkgs/fcitx5-anthy/template                 | 23 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/fcitx5-anthy-icons
 create mode 100644 srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
 create mode 100644 srcpkgs/fcitx5-anthy/template

diff --git a/srcpkgs/fcitx5-anthy-icons b/srcpkgs/fcitx5-anthy-icons
new file mode 120000
index 000000000000..6fee45a4d396
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy-icons
@@ -0,0 +1 @@
+fcitx5-anthy
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
new file mode 100644
index 000000000000..bc19b7c5c406
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
@@ -0,0 +1,18 @@
+Index: fcitx5-anthy-5.0.4/src/utils.h
+===================================================================
+--- fcitx5-anthy-5.0.4.orig/src/utils.h
++++ fcitx5-anthy-5.0.4/src/utils.h
+@@ -28,11 +28,11 @@ bool key_is_keypad(const fcitx::Key &key
+ std::string keypad_to_string(const fcitx::KeyEvent &key);
+ void launch_program(std::string command);
+ 
+-bool surrounding_get_safe_delta(uint from, uint to, int32_t *delta);
++bool surrounding_get_safe_delta(unsigned from, unsigned to, int32_t *delta);
+ 
+ bool surrounding_get_anchor_pos_from_selection(
+     const std::string &surrounding_text, const std::string &selected_text,
+-    uint cursor_pos, uint *anchor_pos);
++    unsigned cursor_pos, unsigned *anchor_pos);
+ 
+ inline char get_ascii_code(const fcitx::Key &key) {
+     auto chr = fcitx::Key::keySymToUnicode(key.sym());
diff --git a/srcpkgs/fcitx5-anthy/template b/srcpkgs/fcitx5-anthy/template
new file mode 100644
index 000000000000..a2bec24b3080
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-anthy'
+pkgname=fcitx5-anthy
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="anthy-unicode-devel libfcitx5-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Anthy engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-anthy/fcitx5-anthy-${version}.tar.xz"
+checksum=6e15c0e32508db3e6b233efb99677a7b4b4478950a57bb76bd509355276b9636
+patch_args=-Np1
+
+fcitx5-anthy-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-anthy<=0.2.3_2"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 79559797e98b8a4ea2e370a5780e8c92526c9d6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:31 +0700
Subject: [PATCH 23/27] fcitx-anthy: use shared icons with fcitx5

---
 srcpkgs/fcitx-anthy/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-anthy/template b/srcpkgs/fcitx-anthy/template
index d03499e83c3e..053db036dec4 100644
--- a/srcpkgs/fcitx-anthy/template
+++ b/srcpkgs/fcitx-anthy/template
@@ -1,10 +1,10 @@
 # Template file for 'fcitx-anthy'
 pkgname=fcitx-anthy
 version=0.2.3
-revision=2
+revision=3
 build_style=cmake
 makedepends="anthy-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-anthy-icons"
 short_desc="Fcitx wrapper for Anthy IM engine"
 maintainer="Matthias von Faber <mvf@gmx.eu>"
 license="GPL-2.0-or-later"
@@ -13,3 +13,7 @@ distfiles="https://github.com/fcitx/fcitx-anthy/archive/${version}.tar.gz"
 checksum=31826a49a7ff743f830e1279527301abce9e669bc176934c76775999299421a8
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 299514da19de47c8265cac26ef531df157e35a1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 22:03:06 +0700
Subject: [PATCH 24/27] marisa: build python3 bindings

---
 srcpkgs/marisa/template | 41 +++++++++++++++++++++++++++++++++++++++--
 srcpkgs/python3-marisa  |  1 +
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/python3-marisa

diff --git a/srcpkgs/marisa/template b/srcpkgs/marisa/template
index 2aebc8712f5b..95e0403a7fef 100644
--- a/srcpkgs/marisa/template
+++ b/srcpkgs/marisa/template
@@ -1,10 +1,11 @@
 # Template file for 'marisa'
 pkgname=marisa
 version=0.2.6
-revision=1
+revision=2
 wrksrc="${pkgname}-trie-$version"
 build_style=gnu-configure
-hostmakedepends="autoconf automake libtool"
+hostmakedepends="autoconf automake libtool python3-setuptools swig"
+makedepends="python3-devel"
 short_desc="Matching Algorithm with Recursively Implemented StorAge"
 maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
 license="BSD-2-Clause, LGPL-2.1-or-later"
@@ -16,14 +17,50 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*) configure_args+=" --enable-popcnt --enable-sse2";;
 esac
 
+CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+CXXFLAGS="$CFLAGS"
+LDFLAGS="-L${XBPS_CROSS_BASE}/${py3_lib}"
+
+_python_env() {
+	local f
+	CFLAGS+=" -I${wrksrc}/include"
+	LDFLAGS+=" -L${wrksrc}/lib/marisa/.libs"
+	export PYPREFIX="${XBPS_CROSS_BASE}"
+	export LDSHARED="${CXX} -shared ${LDFLAGS}"
+	export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
+	for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+		f=${f##*/}
+		export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+	done
+}
+
 pre_configure() {
 	autoreconf -fi
 }
 
+post_build() {
+	make -C bindings
+	cd ${wrksrc}/bindings/python
+	_python_env
+	python3 setup.py build
+	cd ${wrksrc}
+}
+
 post_install() {
 	vlicense COPYING.md
 }
 
+python3-marisa_package() {
+	short_desc+=" - Python 3 bindings"
+	depends="python3"
+	pkg_install() {
+		cd ${wrksrc}/bindings/python
+		_python_env
+		python3 setup.py install --root=${PKGDESTDIR} --prefix=/usr
+		cd ${wrksrc}
+	}
+}
+
 marisa-devel_package() {
 	depends="marisa-${version}_${revision}"
 	short_desc+=" - development files"
diff --git a/srcpkgs/python3-marisa b/srcpkgs/python3-marisa
new file mode 120000
index 000000000000..4ebb55bc8b9f
--- /dev/null
+++ b/srcpkgs/python3-marisa
@@ -0,0 +1 @@
+marisa
\ No newline at end of file

From 19a779c77e0456180a545d172afeff8f49841ba2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:49:25 +0700
Subject: [PATCH 25/27] New package: libkkc-data-0.2.7

---
 srcpkgs/libkkc-data/patches/python3.patch | 138 ++++++++++++++++++++++
 srcpkgs/libkkc-data/template              |  14 +++
 2 files changed, 152 insertions(+)
 create mode 100644 srcpkgs/libkkc-data/patches/python3.patch
 create mode 100644 srcpkgs/libkkc-data/template

diff --git a/srcpkgs/libkkc-data/patches/python3.patch b/srcpkgs/libkkc-data/patches/python3.patch
new file mode 100644
index 000000000000..70bfdcc0d372
--- /dev/null
+++ b/srcpkgs/libkkc-data/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ taken from libkkc
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/tools/genfilter.py b/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/tools/genfilter.py
++++ b/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+index a0dd8fe..40f0837 100644
+--- a/tools/sortlm.py
++++ b/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc-data/template b/srcpkgs/libkkc-data/template
new file mode 100644
index 000000000000..ffbfa76c4247
--- /dev/null
+++ b/srcpkgs/libkkc-data/template
@@ -0,0 +1,14 @@
+# Template file for 'libkkc-data'
+pkgname=libkkc-data
+_libkkc_version=0.3.5
+version=0.2.7
+revision=1
+build_style=gnu-configure
+hostmakedepends="python3-marisa"
+short_desc="Japanese Kana Kanji conversion input method library - data"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${_libkkc_version}/libkkc-data-${version}.tar.xz"
+checksum=9e678755a030043da68e37a4049aa296c296869ff1fb9e6c70026b2541595b99
+patch_args=-Np1

From a71cb826fe6821b07e3448901d247c09a3a70553 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:24:13 +0700
Subject: [PATCH 26/27] New package: libkkc-0.3.5

---
 common/shlibs                              |   1 +
 srcpkgs/libkkc-devel                       |   1 +
 srcpkgs/libkkc-utils                       |   1 +
 srcpkgs/libkkc/patches/musl-locale.patch   |  13 ++
 srcpkgs/libkkc/patches/no-ssp-static.patch |  13 ++
 srcpkgs/libkkc/patches/python3.patch       | 138 +++++++++++++++++++++
 srcpkgs/libkkc/template                    |  46 +++++++
 7 files changed, 213 insertions(+)
 create mode 120000 srcpkgs/libkkc-devel
 create mode 120000 srcpkgs/libkkc-utils
 create mode 100644 srcpkgs/libkkc/patches/musl-locale.patch
 create mode 100644 srcpkgs/libkkc/patches/no-ssp-static.patch
 create mode 100644 srcpkgs/libkkc/patches/python3.patch
 create mode 100644 srcpkgs/libkkc/template

diff --git a/common/shlibs b/common/shlibs
index cfab83ce691d..8aac1f0f0249 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3112,6 +3112,7 @@ libopenglrecorder.so.0 libopenglrecorder-0.1.0_1
 libgpod.so.4 libgpod-0.8.3_1
 libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
+libkkc.so.2 libkkc-0.3.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
diff --git a/srcpkgs/libkkc-devel b/srcpkgs/libkkc-devel
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-devel
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc-utils b/srcpkgs/libkkc-utils
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-utils
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc/patches/musl-locale.patch b/srcpkgs/libkkc/patches/musl-locale.patch
new file mode 100644
index 000000000000..5ae9e6eb2c7e
--- /dev/null
+++ b/srcpkgs/libkkc/patches/musl-locale.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -6710,7 +6710,7 @@ fi
+ 
+     ;;
+     *)
+-    DATADIRNAME=lib
++    DATADIRNAME=share
+     ;;
+     esac
+ fi
diff --git a/srcpkgs/libkkc/patches/no-ssp-static.patch b/srcpkgs/libkkc/patches/no-ssp-static.patch
new file mode 100644
index 000000000000..ea5013582061
--- /dev/null
+++ b/srcpkgs/libkkc/patches/no-ssp-static.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -18480,7 +18480,7 @@ $as_echo "yes" >&6; }
+ fi
+ 
+ # libstdc++ needs to be linked with libmarisa-glib.a
+-MARISA_GLIB_STATIC_DEPENDENCIES="$postdeps_CXX"
++MARISA_GLIB_STATIC_DEPENDENCIES="-lstdc++"
+ 
+ 
+ LIBKKC_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS"
diff --git a/srcpkgs/libkkc/patches/python3.patch b/srcpkgs/libkkc/patches/python3.patch
new file mode 100644
index 000000000000..91d3f6956e88
--- /dev/null
+++ b/srcpkgs/libkkc/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/data/templates/libkkc-data/tools/genfilter.py b/data/templates/libkkc-data/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/data/templates/libkkc-data/tools/genfilter.py
++++ b/data/templates/libkkc-data/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+diff --git a/data/templates/libkkc-data/tools/sortlm.py b/data/templates/libkkc-data/tools/sortlm.py
+index a0dd8fe..40f0837 100644
+--- a/data/templates/libkkc-data/tools/sortlm.py
++++ b/data/templates/libkkc-data/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc/template b/srcpkgs/libkkc/template
new file mode 100644
index 000000000000..dc4d76a771ca
--- /dev/null
+++ b/srcpkgs/libkkc/template
@@ -0,0 +1,46 @@
+# Template file for 'libkkc'
+pkgname=libkkc
+version=0.3.5
+revision=1
+build_style=gnu-configure
+build_helper=gir
+configure_args="--disable-static --disable-silent-rules"
+make_build_args="V=1"
+hostmakedepends="pkg-config glib-devel gettext intltool python3-marisa
+ $(vopt_if gir vala)"
+makedepends="libglib-devel libgee08-devel json-glib-devel marisa-devel
+ $(vopt_if gir vala-devel)"
+depends="libkkc-data"
+short_desc="Japanese Kana Kanji conversion input method library"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${version}/libkkc-${version}.tar.gz"
+checksum=89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef
+patch_args=-Np1
+python_version=3
+
+build_options="gir"
+build_options_default="gir"
+
+libkkc-utils_package() {
+	short_desc+=" - utils"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/locale
+	}
+}
+
+libkkc-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/share/libkkc/templates
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+			vmove usr/share/vala
+		fi
+	}
+}

From a3c41dd60e7ecbad967aee218e3783e92bf62b2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 22:43:59 +0700
Subject: [PATCH 27/27] New package: fcitx5-kkc-5.0.5

---
 srcpkgs/fcitx5-kkc-qt5      |  1 +
 srcpkgs/fcitx5-kkc/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-kkc-qt5
 create mode 100644 srcpkgs/fcitx5-kkc/template

diff --git a/srcpkgs/fcitx5-kkc-qt5 b/srcpkgs/fcitx5-kkc-qt5
new file mode 120000
index 000000000000..4686c1fbe9b3
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc-qt5
@@ -0,0 +1 @@
+fcitx5-kkc
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-kkc/template b/srcpkgs/fcitx5-kkc/template
new file mode 100644
index 000000000000..7ee3ab77ff7f
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-kkc'
+pkgname=fcitx5-kkc
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libkkc-devel libgee08-devel json-glib-devel"
+short_desc="Fcitx5 - kkc engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-kkc/fcitx5-kkc-${version}.tar.xz"
+checksum=0e5fc4a8cd3dce8fa3774e6f304013869709aaa7cda9d9420386841e6d850b92
+
+fcitx5-kkc-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (15 preceding siblings ...)
  2021-03-30 15:46 ` sgn
@ 2021-03-30 15:48 ` sgn
  2021-03-31 16:18 ` sgn
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-30 15:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 86937 bytes --]

From 923e1e3c5ffbb8d92cf6e4933bc7d2218677ad9b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/27] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 3a2c8d27b3a0..807397b5f878 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 8fa5485b58fa03a1ebae9559411ed25f56c76520 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/27] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index 807397b5f878..b8e61ea69d49 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From 1697e205302e7934ef944fb556eab633d009dbbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/27] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 71 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 76 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index b8e61ea69d49..2203da5c3d2c 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..06a54a221d65
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,71 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,/usr,${_IMPORT_PREFIX},g' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From 2e99f5778434ce48dfd09bb473b5efe8150baae2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/27] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 2203da5c3d2c..e9659a12599d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..79da6b401796
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision} qt5-devel"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From 25d710f879ef47dde86d9ccc81e48b2e51ba2d9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/27] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From f340147f034751eb782fc74cb3f9cec8882ce1ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/27] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From c52465d6383100a40f7e68551bb0b9fc48a3ca95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/27] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 7b9ba0f21a62915b86adcee01164030f3d2a7fb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/27] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..597d193e3e00
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db fcitx5"
+checkdepends="$depends"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From 913af7b476ae35efb2c3b6d871001779379b7c0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/27] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From a2ce2623d1a9f2b65779ca413dbf0f37740f538d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/27] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index e9659a12599d..db492cbda7d9 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 5db46e2f89a8b30c4b4e744857e2759ae48d04b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/27] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..ea1c4b65a38d 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 4129190ebfb59ff09a11318f87b00a23cd32db97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/27] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel    |  1 +
 srcpkgs/fcitx5-chinese-addons-icons    |  1 +
 srcpkgs/fcitx5-chinese-addons-qt5      |  1 +
 srcpkgs/fcitx5-chinese-addons/template | 56 ++++++++++++++++++++++++++
 4 files changed, 59 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-qt5
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-qt5 b/srcpkgs/fcitx5-chinese-addons-qt5
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-qt5
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..6619e108a608
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,56 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 28a47ddf76792f3f7861112fca40d28cb04e802a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/27] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From 3c75d58010f89dcb5f157a7d822520d61275b705 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/27] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index db492cbda7d9..375e907bdfc4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..46a5ad944e88
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3 libime-utils"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 5ba559459adc43db7fd64020224d8ad2b4b91335 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/27] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 375e907bdfc4..9b8e2bdb4637 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.17.6 zeek-3.2.4_2
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From 5557943949a0bf90f316e1480e28ca99cc84db6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/27] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From 8638730c6f1da5eade2c19426e36fcd09bda342d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/27] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From dd3fccc85982ce4a72324d042e6e44d630435821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/27] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From 6c12dcae2c413ca69370eea6ae64a48f2bf95767 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/27] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From c79dc9b715c48d8d18dcb0f9b0f6034444198e7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/27] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..d1b50e2d6237 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,15 +1,20 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
-homepage="https://github.com/fcitx/fcitx-hangul"
+maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-only"
+homepage="https://github.com/fcitx/fcitx-hangul"
 distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.tar.xz"
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From e4f5e19f29bbac19c1ba7ed078e1073fd39cbcb0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 18:42:50 +0700
Subject: [PATCH 21/27] New package: anthy-unicode-1.0.0.20201109

---
 common/shlibs                  |  3 +++
 srcpkgs/anthy-unicode-devel    |  1 +
 srcpkgs/anthy-unicode/template | 36 ++++++++++++++++++++++++++++++++++
 srcpkgs/libanthy-unicode       |  1 +
 4 files changed, 41 insertions(+)
 create mode 120000 srcpkgs/anthy-unicode-devel
 create mode 100644 srcpkgs/anthy-unicode/template
 create mode 120000 srcpkgs/libanthy-unicode

diff --git a/common/shlibs b/common/shlibs
index 9b8e2bdb4637..cfab83ce691d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2335,6 +2335,9 @@ liboath.so.0 oath-toolkit-2.6.0_2
 libanthy.so.1 libanthy-0.4_1
 libanthydic.so.1 libanthy-0.4_1
 libanthyinput.so.0 libanthy-0.4_1
+libanthy-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthydic-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthyinput-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
 libanthygobject-1.0.so.5 ibus-anthy-1.5.6_1
 libtbbmalloc_proxy_debug.so.2 tbb-4.3_1
 libtbbmalloc_proxy.so.2 tbb-4.3_1
diff --git a/srcpkgs/anthy-unicode-devel b/srcpkgs/anthy-unicode-devel
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/anthy-unicode-devel
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file
diff --git a/srcpkgs/anthy-unicode/template b/srcpkgs/anthy-unicode/template
new file mode 100644
index 000000000000..1cd2bdffa9b0
--- /dev/null
+++ b/srcpkgs/anthy-unicode/template
@@ -0,0 +1,36 @@
+# Template file for 'anthy-unicode'
+pkgname=anthy-unicode
+version=1.0.0.20201109
+revision=1
+build_style=gnu-configure
+configure_args="--disable-static"
+short_desc="Japanese character set input library for Unicode"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.0-or-later, GPL-2.0-only, Public Domain"
+homepage="https://github.com/fujiwarat/anthy-unicode/wiki"
+distfiles="https://github.com/fujiwarat/anthy-unicode/releases/download/${version}/${pkgname}-${version}.tar.gz"
+checksum=7d595bd422222bd67d7944f0c29f7d739fe677e4b885de3d4f0dae417b674381
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/*.la
+}
+
+libanthy-unicode_package() {
+	short_desc+=" - libraries"
+	conf_files="/etc/anthy-unicode.conf"
+	pkg_install() {
+		vmove etc/anthy-unicode.conf
+		vmove "usr/lib/*.so.*"
+		vmove usr/share
+	}
+}
+
+anthy-unicode-devel_package() {
+	short_desc+=" - development files"
+	depends="libanthy-unicode-${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/libanthy-unicode b/srcpkgs/libanthy-unicode
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/libanthy-unicode
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file

From b6756341b88c4ad1c1d53a99cfc038501c56fbd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:38 +0700
Subject: [PATCH 22/27] New package: fcitx5-anthy-5.0.4

---
 srcpkgs/fcitx5-anthy-icons                    |  1 +
 .../fcitx5-anthy/patches/fix-build-musl.patch | 18 +++++++++++++++
 srcpkgs/fcitx5-anthy/template                 | 23 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/fcitx5-anthy-icons
 create mode 100644 srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
 create mode 100644 srcpkgs/fcitx5-anthy/template

diff --git a/srcpkgs/fcitx5-anthy-icons b/srcpkgs/fcitx5-anthy-icons
new file mode 120000
index 000000000000..6fee45a4d396
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy-icons
@@ -0,0 +1 @@
+fcitx5-anthy
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
new file mode 100644
index 000000000000..bc19b7c5c406
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
@@ -0,0 +1,18 @@
+Index: fcitx5-anthy-5.0.4/src/utils.h
+===================================================================
+--- fcitx5-anthy-5.0.4.orig/src/utils.h
++++ fcitx5-anthy-5.0.4/src/utils.h
+@@ -28,11 +28,11 @@ bool key_is_keypad(const fcitx::Key &key
+ std::string keypad_to_string(const fcitx::KeyEvent &key);
+ void launch_program(std::string command);
+ 
+-bool surrounding_get_safe_delta(uint from, uint to, int32_t *delta);
++bool surrounding_get_safe_delta(unsigned from, unsigned to, int32_t *delta);
+ 
+ bool surrounding_get_anchor_pos_from_selection(
+     const std::string &surrounding_text, const std::string &selected_text,
+-    uint cursor_pos, uint *anchor_pos);
++    unsigned cursor_pos, unsigned *anchor_pos);
+ 
+ inline char get_ascii_code(const fcitx::Key &key) {
+     auto chr = fcitx::Key::keySymToUnicode(key.sym());
diff --git a/srcpkgs/fcitx5-anthy/template b/srcpkgs/fcitx5-anthy/template
new file mode 100644
index 000000000000..a2bec24b3080
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-anthy'
+pkgname=fcitx5-anthy
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="anthy-unicode-devel libfcitx5-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Anthy engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-anthy/fcitx5-anthy-${version}.tar.xz"
+checksum=6e15c0e32508db3e6b233efb99677a7b4b4478950a57bb76bd509355276b9636
+patch_args=-Np1
+
+fcitx5-anthy-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-anthy<=0.2.3_2"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 2129c40bbb8e2d25826f8fd8705c5552c34606c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:31 +0700
Subject: [PATCH 23/27] fcitx-anthy: use shared icons with fcitx5

---
 srcpkgs/fcitx-anthy/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-anthy/template b/srcpkgs/fcitx-anthy/template
index d03499e83c3e..053db036dec4 100644
--- a/srcpkgs/fcitx-anthy/template
+++ b/srcpkgs/fcitx-anthy/template
@@ -1,10 +1,10 @@
 # Template file for 'fcitx-anthy'
 pkgname=fcitx-anthy
 version=0.2.3
-revision=2
+revision=3
 build_style=cmake
 makedepends="anthy-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-anthy-icons"
 short_desc="Fcitx wrapper for Anthy IM engine"
 maintainer="Matthias von Faber <mvf@gmx.eu>"
 license="GPL-2.0-or-later"
@@ -13,3 +13,7 @@ distfiles="https://github.com/fcitx/fcitx-anthy/archive/${version}.tar.gz"
 checksum=31826a49a7ff743f830e1279527301abce9e669bc176934c76775999299421a8
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From d0fea6286b032e2455d1a0eaac3e181290beff00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 22:03:06 +0700
Subject: [PATCH 24/27] marisa: build python3 bindings

---
 srcpkgs/marisa/template | 41 +++++++++++++++++++++++++++++++++++++++--
 srcpkgs/python3-marisa  |  1 +
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/python3-marisa

diff --git a/srcpkgs/marisa/template b/srcpkgs/marisa/template
index 2aebc8712f5b..95e0403a7fef 100644
--- a/srcpkgs/marisa/template
+++ b/srcpkgs/marisa/template
@@ -1,10 +1,11 @@
 # Template file for 'marisa'
 pkgname=marisa
 version=0.2.6
-revision=1
+revision=2
 wrksrc="${pkgname}-trie-$version"
 build_style=gnu-configure
-hostmakedepends="autoconf automake libtool"
+hostmakedepends="autoconf automake libtool python3-setuptools swig"
+makedepends="python3-devel"
 short_desc="Matching Algorithm with Recursively Implemented StorAge"
 maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
 license="BSD-2-Clause, LGPL-2.1-or-later"
@@ -16,14 +17,50 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*) configure_args+=" --enable-popcnt --enable-sse2";;
 esac
 
+CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+CXXFLAGS="$CFLAGS"
+LDFLAGS="-L${XBPS_CROSS_BASE}/${py3_lib}"
+
+_python_env() {
+	local f
+	CFLAGS+=" -I${wrksrc}/include"
+	LDFLAGS+=" -L${wrksrc}/lib/marisa/.libs"
+	export PYPREFIX="${XBPS_CROSS_BASE}"
+	export LDSHARED="${CXX} -shared ${LDFLAGS}"
+	export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
+	for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+		f=${f##*/}
+		export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+	done
+}
+
 pre_configure() {
 	autoreconf -fi
 }
 
+post_build() {
+	make -C bindings
+	cd ${wrksrc}/bindings/python
+	_python_env
+	python3 setup.py build
+	cd ${wrksrc}
+}
+
 post_install() {
 	vlicense COPYING.md
 }
 
+python3-marisa_package() {
+	short_desc+=" - Python 3 bindings"
+	depends="python3"
+	pkg_install() {
+		cd ${wrksrc}/bindings/python
+		_python_env
+		python3 setup.py install --root=${PKGDESTDIR} --prefix=/usr
+		cd ${wrksrc}
+	}
+}
+
 marisa-devel_package() {
 	depends="marisa-${version}_${revision}"
 	short_desc+=" - development files"
diff --git a/srcpkgs/python3-marisa b/srcpkgs/python3-marisa
new file mode 120000
index 000000000000..4ebb55bc8b9f
--- /dev/null
+++ b/srcpkgs/python3-marisa
@@ -0,0 +1 @@
+marisa
\ No newline at end of file

From 1cee93b0c498801786dba588061bc4978a930253 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:49:25 +0700
Subject: [PATCH 25/27] New package: libkkc-data-0.2.7

---
 srcpkgs/libkkc-data/patches/python3.patch | 138 ++++++++++++++++++++++
 srcpkgs/libkkc-data/template              |  14 +++
 2 files changed, 152 insertions(+)
 create mode 100644 srcpkgs/libkkc-data/patches/python3.patch
 create mode 100644 srcpkgs/libkkc-data/template

diff --git a/srcpkgs/libkkc-data/patches/python3.patch b/srcpkgs/libkkc-data/patches/python3.patch
new file mode 100644
index 000000000000..70bfdcc0d372
--- /dev/null
+++ b/srcpkgs/libkkc-data/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ taken from libkkc
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/tools/genfilter.py b/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/tools/genfilter.py
++++ b/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+index a0dd8fe..40f0837 100644
+--- a/tools/sortlm.py
++++ b/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc-data/template b/srcpkgs/libkkc-data/template
new file mode 100644
index 000000000000..ffbfa76c4247
--- /dev/null
+++ b/srcpkgs/libkkc-data/template
@@ -0,0 +1,14 @@
+# Template file for 'libkkc-data'
+pkgname=libkkc-data
+_libkkc_version=0.3.5
+version=0.2.7
+revision=1
+build_style=gnu-configure
+hostmakedepends="python3-marisa"
+short_desc="Japanese Kana Kanji conversion input method library - data"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${_libkkc_version}/libkkc-data-${version}.tar.xz"
+checksum=9e678755a030043da68e37a4049aa296c296869ff1fb9e6c70026b2541595b99
+patch_args=-Np1

From 76eb5fbf253d72872a329064fa1fdab90a747536 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:24:13 +0700
Subject: [PATCH 26/27] New package: libkkc-0.3.5

---
 common/shlibs                              |   1 +
 srcpkgs/libkkc-devel                       |   1 +
 srcpkgs/libkkc-utils                       |   1 +
 srcpkgs/libkkc/patches/musl-locale.patch   |  13 ++
 srcpkgs/libkkc/patches/no-ssp-static.patch |  13 ++
 srcpkgs/libkkc/patches/python3.patch       | 138 +++++++++++++++++++++
 srcpkgs/libkkc/template                    |  46 +++++++
 7 files changed, 213 insertions(+)
 create mode 120000 srcpkgs/libkkc-devel
 create mode 120000 srcpkgs/libkkc-utils
 create mode 100644 srcpkgs/libkkc/patches/musl-locale.patch
 create mode 100644 srcpkgs/libkkc/patches/no-ssp-static.patch
 create mode 100644 srcpkgs/libkkc/patches/python3.patch
 create mode 100644 srcpkgs/libkkc/template

diff --git a/common/shlibs b/common/shlibs
index cfab83ce691d..8aac1f0f0249 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3112,6 +3112,7 @@ libopenglrecorder.so.0 libopenglrecorder-0.1.0_1
 libgpod.so.4 libgpod-0.8.3_1
 libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
+libkkc.so.2 libkkc-0.3.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
diff --git a/srcpkgs/libkkc-devel b/srcpkgs/libkkc-devel
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-devel
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc-utils b/srcpkgs/libkkc-utils
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-utils
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc/patches/musl-locale.patch b/srcpkgs/libkkc/patches/musl-locale.patch
new file mode 100644
index 000000000000..5ae9e6eb2c7e
--- /dev/null
+++ b/srcpkgs/libkkc/patches/musl-locale.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -6710,7 +6710,7 @@ fi
+ 
+     ;;
+     *)
+-    DATADIRNAME=lib
++    DATADIRNAME=share
+     ;;
+     esac
+ fi
diff --git a/srcpkgs/libkkc/patches/no-ssp-static.patch b/srcpkgs/libkkc/patches/no-ssp-static.patch
new file mode 100644
index 000000000000..ea5013582061
--- /dev/null
+++ b/srcpkgs/libkkc/patches/no-ssp-static.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -18480,7 +18480,7 @@ $as_echo "yes" >&6; }
+ fi
+ 
+ # libstdc++ needs to be linked with libmarisa-glib.a
+-MARISA_GLIB_STATIC_DEPENDENCIES="$postdeps_CXX"
++MARISA_GLIB_STATIC_DEPENDENCIES="-lstdc++"
+ 
+ 
+ LIBKKC_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS"
diff --git a/srcpkgs/libkkc/patches/python3.patch b/srcpkgs/libkkc/patches/python3.patch
new file mode 100644
index 000000000000..91d3f6956e88
--- /dev/null
+++ b/srcpkgs/libkkc/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/data/templates/libkkc-data/tools/genfilter.py b/data/templates/libkkc-data/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/data/templates/libkkc-data/tools/genfilter.py
++++ b/data/templates/libkkc-data/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+diff --git a/data/templates/libkkc-data/tools/sortlm.py b/data/templates/libkkc-data/tools/sortlm.py
+index a0dd8fe..40f0837 100644
+--- a/data/templates/libkkc-data/tools/sortlm.py
++++ b/data/templates/libkkc-data/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc/template b/srcpkgs/libkkc/template
new file mode 100644
index 000000000000..dc4d76a771ca
--- /dev/null
+++ b/srcpkgs/libkkc/template
@@ -0,0 +1,46 @@
+# Template file for 'libkkc'
+pkgname=libkkc
+version=0.3.5
+revision=1
+build_style=gnu-configure
+build_helper=gir
+configure_args="--disable-static --disable-silent-rules"
+make_build_args="V=1"
+hostmakedepends="pkg-config glib-devel gettext intltool python3-marisa
+ $(vopt_if gir vala)"
+makedepends="libglib-devel libgee08-devel json-glib-devel marisa-devel
+ $(vopt_if gir vala-devel)"
+depends="libkkc-data"
+short_desc="Japanese Kana Kanji conversion input method library"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${version}/libkkc-${version}.tar.gz"
+checksum=89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef
+patch_args=-Np1
+python_version=3
+
+build_options="gir"
+build_options_default="gir"
+
+libkkc-utils_package() {
+	short_desc+=" - utils"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/locale
+	}
+}
+
+libkkc-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/share/libkkc/templates
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+			vmove usr/share/vala
+		fi
+	}
+}

From 3188926822e6135f7ac8949736cfeaa5bbf73632 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 22:43:59 +0700
Subject: [PATCH 27/27] New package: fcitx5-kkc-5.0.5

---
 srcpkgs/fcitx5-kkc-qt5      |  1 +
 srcpkgs/fcitx5-kkc/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-kkc-qt5
 create mode 100644 srcpkgs/fcitx5-kkc/template

diff --git a/srcpkgs/fcitx5-kkc-qt5 b/srcpkgs/fcitx5-kkc-qt5
new file mode 120000
index 000000000000..4686c1fbe9b3
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc-qt5
@@ -0,0 +1 @@
+fcitx5-kkc
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-kkc/template b/srcpkgs/fcitx5-kkc/template
new file mode 100644
index 000000000000..7ee3ab77ff7f
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-kkc'
+pkgname=fcitx5-kkc
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libkkc-devel libgee08-devel json-glib-devel"
+short_desc="Fcitx5 - kkc engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-kkc/fcitx5-kkc-${version}.tar.xz"
+checksum=0e5fc4a8cd3dce8fa3774e6f304013869709aaa7cda9d9420386841e6d850b92
+
+fcitx5-kkc-qt5_package() {
+	short_desc+=" - Qt5"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (16 preceding siblings ...)
  2021-03-30 15:48 ` sgn
@ 2021-03-31 16:18 ` sgn
  2021-04-01  0:09 ` sgn
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-03-31 16:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 93184 bytes --]

From 22e39debb899cbc7297a95edaf3a6fcba9b8387f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/29] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 4a81ffd64e21..d02191d49eb1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 49eb6252cfa5a6ad63415a1b5418cb61691886ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/29] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index d02191d49eb1..5d182ca1fe65 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From f1c15a8c266aff93c7c248aed8d5644549db195c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/29] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 71 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 76 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index 5d182ca1fe65..11ed5622a2fa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..06a54a221d65
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,71 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,/usr,${_IMPORT_PREFIX},g' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From e0c728f12bb7bdd7642e4b994cd4d3c1885a0103 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/29] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 11ed5622a2fa..40921762bcee 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..79da6b401796
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision} qt5-devel"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From 4ab8016eedd0e269826caade56955c0371f6b922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/29] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 41ae31b291d15294cf0d6b6b3ac1a1f4f28f646b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/29] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From a25d4dd803e9c83ae5cbd1c46eb6d621306a4037 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/29] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 8b44fd21bc2f9dabbbc4f75d259d0ce16a967c11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/29] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..597d193e3e00
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db fcitx5"
+checkdepends="$depends"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From c9c37f57166387d45117df2a0021f2ee636f8044 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/29] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 7e9ed63229c12f13907ae3beb2a2e736c1bf2f8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/29] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index 40921762bcee..dca48b891a03 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 32ef064b6c45f35fb94796bf5b4b3d494f608466 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/29] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..8f2c9c4ce432 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx5-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From e2b4f98d4ce30ccd7bc3c8047f0f1e73615a119b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/29] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel           |  1 +
 srcpkgs/fcitx5-chinese-addons-icons           |  1 +
 .../fcitx5-chinese-addons-pinyin-dict-manager |  1 +
 srcpkgs/fcitx5-chinese-addons/template        | 58 +++++++++++++++++++
 4 files changed, 61 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager b/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..2dc17d49ffe1
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,58 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-pinyin-dict-manager_package() {
+	short_desc+=" - Pinyin Dictionaries Manager"
+	depends="fcitx5-chinese-addon>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-chinese-addon>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 165101d74e0a5c7b0b73942685f73b4bc7ac22b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/29] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From 2c97a0e8628a4972386927abcd1b51eb791dfc95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/29] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index dca48b891a03..3506746e83c8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..46a5ad944e88
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3 libime-utils"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 4d1727b1df4bce0f8232c929baa96dc088ae410b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/29] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 3506746e83c8..b040daaaff37 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.18.0 zeek-4.0.0_1
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From 2e50dc45c220d732a24bc842fe0802c5806fd18f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/29] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From 72f71a7bf05f1a5fdf2deb764518cf472cdb1123 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/29] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From 5ca2eb84b8af4ef86cd75db508ea248111b306c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/29] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From d694069ce3dec1da52a8d41cd8cb58bac4c83e0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/29] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From af6b1bb652ad6ed45751b325233dd295f3410166 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/29] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..d1b50e2d6237 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,15 +1,20 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
-homepage="https://github.com/fcitx/fcitx-hangul"
+maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-only"
+homepage="https://github.com/fcitx/fcitx-hangul"
 distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.tar.xz"
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From b57443456380aeadac4fbfeafecc1227841c6216 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 18:42:50 +0700
Subject: [PATCH 21/29] New package: anthy-unicode-1.0.0.20201109

---
 common/shlibs                  |  3 +++
 srcpkgs/anthy-unicode-devel    |  1 +
 srcpkgs/anthy-unicode/template | 37 ++++++++++++++++++++++++++++++++++
 srcpkgs/libanthy-unicode       |  1 +
 4 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/anthy-unicode-devel
 create mode 100644 srcpkgs/anthy-unicode/template
 create mode 120000 srcpkgs/libanthy-unicode

diff --git a/common/shlibs b/common/shlibs
index b040daaaff37..9049007d1ac2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2335,6 +2335,9 @@ liboath.so.0 oath-toolkit-2.6.0_2
 libanthy.so.1 libanthy-0.4_1
 libanthydic.so.1 libanthy-0.4_1
 libanthyinput.so.0 libanthy-0.4_1
+libanthy-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthydic-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthyinput-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
 libanthygobject-1.0.so.5 ibus-anthy-1.5.6_1
 libtbbmalloc_proxy_debug.so.2 tbb-4.3_1
 libtbbmalloc_proxy.so.2 tbb-4.3_1
diff --git a/srcpkgs/anthy-unicode-devel b/srcpkgs/anthy-unicode-devel
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/anthy-unicode-devel
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file
diff --git a/srcpkgs/anthy-unicode/template b/srcpkgs/anthy-unicode/template
new file mode 100644
index 000000000000..f7c4ae32a5bb
--- /dev/null
+++ b/srcpkgs/anthy-unicode/template
@@ -0,0 +1,37 @@
+# Template file for 'anthy-unicode'
+pkgname=anthy-unicode
+version=1.0.0.20201109
+revision=1
+build_style=gnu-configure
+configure_args="--disable-static"
+short_desc="Japanese character set input library for Unicode"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.0-or-later, GPL-2.0-only, Public Domain"
+homepage="https://github.com/fujiwarat/anthy-unicode/wiki"
+distfiles="https://github.com/fujiwarat/anthy-unicode/releases/download/${version}/${pkgname}-${version}.tar.gz"
+checksum=7d595bd422222bd67d7944f0c29f7d739fe677e4b885de3d4f0dae417b674381
+nocross='execute lt-mkdepgraph'
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/*.la
+}
+
+libanthy-unicode_package() {
+	short_desc+=" - libraries"
+	conf_files="/etc/anthy-unicode.conf"
+	pkg_install() {
+		vmove etc/anthy-unicode.conf
+		vmove "usr/lib/*.so.*"
+		vmove usr/share
+	}
+}
+
+anthy-unicode-devel_package() {
+	short_desc+=" - development files"
+	depends="libanthy-unicode-${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/libanthy-unicode b/srcpkgs/libanthy-unicode
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/libanthy-unicode
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file

From cd3c041ff8b2fab760e758b95263a677a7cbdf36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:38 +0700
Subject: [PATCH 22/29] New package: fcitx5-anthy-5.0.4

---
 srcpkgs/fcitx5-anthy-icons                    |  1 +
 .../fcitx5-anthy/patches/fix-build-musl.patch | 18 +++++++++++++++
 srcpkgs/fcitx5-anthy/template                 | 23 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/fcitx5-anthy-icons
 create mode 100644 srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
 create mode 100644 srcpkgs/fcitx5-anthy/template

diff --git a/srcpkgs/fcitx5-anthy-icons b/srcpkgs/fcitx5-anthy-icons
new file mode 120000
index 000000000000..6fee45a4d396
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy-icons
@@ -0,0 +1 @@
+fcitx5-anthy
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
new file mode 100644
index 000000000000..bc19b7c5c406
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
@@ -0,0 +1,18 @@
+Index: fcitx5-anthy-5.0.4/src/utils.h
+===================================================================
+--- fcitx5-anthy-5.0.4.orig/src/utils.h
++++ fcitx5-anthy-5.0.4/src/utils.h
+@@ -28,11 +28,11 @@ bool key_is_keypad(const fcitx::Key &key
+ std::string keypad_to_string(const fcitx::KeyEvent &key);
+ void launch_program(std::string command);
+ 
+-bool surrounding_get_safe_delta(uint from, uint to, int32_t *delta);
++bool surrounding_get_safe_delta(unsigned from, unsigned to, int32_t *delta);
+ 
+ bool surrounding_get_anchor_pos_from_selection(
+     const std::string &surrounding_text, const std::string &selected_text,
+-    uint cursor_pos, uint *anchor_pos);
++    unsigned cursor_pos, unsigned *anchor_pos);
+ 
+ inline char get_ascii_code(const fcitx::Key &key) {
+     auto chr = fcitx::Key::keySymToUnicode(key.sym());
diff --git a/srcpkgs/fcitx5-anthy/template b/srcpkgs/fcitx5-anthy/template
new file mode 100644
index 000000000000..a2bec24b3080
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-anthy'
+pkgname=fcitx5-anthy
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="anthy-unicode-devel libfcitx5-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Anthy engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-anthy/fcitx5-anthy-${version}.tar.xz"
+checksum=6e15c0e32508db3e6b233efb99677a7b4b4478950a57bb76bd509355276b9636
+patch_args=-Np1
+
+fcitx5-anthy-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-anthy<=0.2.3_2"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From aa46bc0380b5d9436566831a69d8cd80d1824c89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:31 +0700
Subject: [PATCH 23/29] fcitx-anthy: use shared icons with fcitx5

---
 srcpkgs/fcitx-anthy/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-anthy/template b/srcpkgs/fcitx-anthy/template
index d03499e83c3e..053db036dec4 100644
--- a/srcpkgs/fcitx-anthy/template
+++ b/srcpkgs/fcitx-anthy/template
@@ -1,10 +1,10 @@
 # Template file for 'fcitx-anthy'
 pkgname=fcitx-anthy
 version=0.2.3
-revision=2
+revision=3
 build_style=cmake
 makedepends="anthy-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-anthy-icons"
 short_desc="Fcitx wrapper for Anthy IM engine"
 maintainer="Matthias von Faber <mvf@gmx.eu>"
 license="GPL-2.0-or-later"
@@ -13,3 +13,7 @@ distfiles="https://github.com/fcitx/fcitx-anthy/archive/${version}.tar.gz"
 checksum=31826a49a7ff743f830e1279527301abce9e669bc176934c76775999299421a8
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 8b6f90e3f2f0cc5cd69a386911c507cd23bc1e22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 22:03:06 +0700
Subject: [PATCH 24/29] marisa: build python3 bindings

---
 srcpkgs/marisa/template | 41 +++++++++++++++++++++++++++++++++++++++--
 srcpkgs/python3-marisa  |  1 +
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/python3-marisa

diff --git a/srcpkgs/marisa/template b/srcpkgs/marisa/template
index 2aebc8712f5b..95e0403a7fef 100644
--- a/srcpkgs/marisa/template
+++ b/srcpkgs/marisa/template
@@ -1,10 +1,11 @@
 # Template file for 'marisa'
 pkgname=marisa
 version=0.2.6
-revision=1
+revision=2
 wrksrc="${pkgname}-trie-$version"
 build_style=gnu-configure
-hostmakedepends="autoconf automake libtool"
+hostmakedepends="autoconf automake libtool python3-setuptools swig"
+makedepends="python3-devel"
 short_desc="Matching Algorithm with Recursively Implemented StorAge"
 maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
 license="BSD-2-Clause, LGPL-2.1-or-later"
@@ -16,14 +17,50 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*) configure_args+=" --enable-popcnt --enable-sse2";;
 esac
 
+CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+CXXFLAGS="$CFLAGS"
+LDFLAGS="-L${XBPS_CROSS_BASE}/${py3_lib}"
+
+_python_env() {
+	local f
+	CFLAGS+=" -I${wrksrc}/include"
+	LDFLAGS+=" -L${wrksrc}/lib/marisa/.libs"
+	export PYPREFIX="${XBPS_CROSS_BASE}"
+	export LDSHARED="${CXX} -shared ${LDFLAGS}"
+	export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
+	for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+		f=${f##*/}
+		export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+	done
+}
+
 pre_configure() {
 	autoreconf -fi
 }
 
+post_build() {
+	make -C bindings
+	cd ${wrksrc}/bindings/python
+	_python_env
+	python3 setup.py build
+	cd ${wrksrc}
+}
+
 post_install() {
 	vlicense COPYING.md
 }
 
+python3-marisa_package() {
+	short_desc+=" - Python 3 bindings"
+	depends="python3"
+	pkg_install() {
+		cd ${wrksrc}/bindings/python
+		_python_env
+		python3 setup.py install --root=${PKGDESTDIR} --prefix=/usr
+		cd ${wrksrc}
+	}
+}
+
 marisa-devel_package() {
 	depends="marisa-${version}_${revision}"
 	short_desc+=" - development files"
diff --git a/srcpkgs/python3-marisa b/srcpkgs/python3-marisa
new file mode 120000
index 000000000000..4ebb55bc8b9f
--- /dev/null
+++ b/srcpkgs/python3-marisa
@@ -0,0 +1 @@
+marisa
\ No newline at end of file

From e1093543ce89806fee8d025fc1454e733c41583c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:49:25 +0700
Subject: [PATCH 25/29] New package: libkkc-data-0.2.7

---
 srcpkgs/libkkc-data/patches/python3.patch | 138 ++++++++++++++++++++++
 srcpkgs/libkkc-data/template              |  14 +++
 2 files changed, 152 insertions(+)
 create mode 100644 srcpkgs/libkkc-data/patches/python3.patch
 create mode 100644 srcpkgs/libkkc-data/template

diff --git a/srcpkgs/libkkc-data/patches/python3.patch b/srcpkgs/libkkc-data/patches/python3.patch
new file mode 100644
index 000000000000..70bfdcc0d372
--- /dev/null
+++ b/srcpkgs/libkkc-data/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ taken from libkkc
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/tools/genfilter.py b/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/tools/genfilter.py
++++ b/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+index a0dd8fe..40f0837 100644
+--- a/tools/sortlm.py
++++ b/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc-data/template b/srcpkgs/libkkc-data/template
new file mode 100644
index 000000000000..ffbfa76c4247
--- /dev/null
+++ b/srcpkgs/libkkc-data/template
@@ -0,0 +1,14 @@
+# Template file for 'libkkc-data'
+pkgname=libkkc-data
+_libkkc_version=0.3.5
+version=0.2.7
+revision=1
+build_style=gnu-configure
+hostmakedepends="python3-marisa"
+short_desc="Japanese Kana Kanji conversion input method library - data"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${_libkkc_version}/libkkc-data-${version}.tar.xz"
+checksum=9e678755a030043da68e37a4049aa296c296869ff1fb9e6c70026b2541595b99
+patch_args=-Np1

From ac07cd78cda9133b51fb2faefe3dfeb81bf75ce2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:24:13 +0700
Subject: [PATCH 26/29] New package: libkkc-0.3.5

---
 common/shlibs                              |   1 +
 srcpkgs/libkkc-devel                       |   1 +
 srcpkgs/libkkc-utils                       |   1 +
 srcpkgs/libkkc/patches/musl-locale.patch   |  13 ++
 srcpkgs/libkkc/patches/no-ssp-static.patch |  13 ++
 srcpkgs/libkkc/patches/python3.patch       | 138 +++++++++++++++++++++
 srcpkgs/libkkc/template                    |  46 +++++++
 7 files changed, 213 insertions(+)
 create mode 120000 srcpkgs/libkkc-devel
 create mode 120000 srcpkgs/libkkc-utils
 create mode 100644 srcpkgs/libkkc/patches/musl-locale.patch
 create mode 100644 srcpkgs/libkkc/patches/no-ssp-static.patch
 create mode 100644 srcpkgs/libkkc/patches/python3.patch
 create mode 100644 srcpkgs/libkkc/template

diff --git a/common/shlibs b/common/shlibs
index 9049007d1ac2..7e6f687f7f32 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3112,6 +3112,7 @@ libopenglrecorder.so.0 libopenglrecorder-0.1.0_1
 libgpod.so.4 libgpod-0.8.3_1
 libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
+libkkc.so.2 libkkc-0.3.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
diff --git a/srcpkgs/libkkc-devel b/srcpkgs/libkkc-devel
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-devel
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc-utils b/srcpkgs/libkkc-utils
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-utils
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc/patches/musl-locale.patch b/srcpkgs/libkkc/patches/musl-locale.patch
new file mode 100644
index 000000000000..5ae9e6eb2c7e
--- /dev/null
+++ b/srcpkgs/libkkc/patches/musl-locale.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -6710,7 +6710,7 @@ fi
+ 
+     ;;
+     *)
+-    DATADIRNAME=lib
++    DATADIRNAME=share
+     ;;
+     esac
+ fi
diff --git a/srcpkgs/libkkc/patches/no-ssp-static.patch b/srcpkgs/libkkc/patches/no-ssp-static.patch
new file mode 100644
index 000000000000..ea5013582061
--- /dev/null
+++ b/srcpkgs/libkkc/patches/no-ssp-static.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -18480,7 +18480,7 @@ $as_echo "yes" >&6; }
+ fi
+ 
+ # libstdc++ needs to be linked with libmarisa-glib.a
+-MARISA_GLIB_STATIC_DEPENDENCIES="$postdeps_CXX"
++MARISA_GLIB_STATIC_DEPENDENCIES="-lstdc++"
+ 
+ 
+ LIBKKC_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS"
diff --git a/srcpkgs/libkkc/patches/python3.patch b/srcpkgs/libkkc/patches/python3.patch
new file mode 100644
index 000000000000..91d3f6956e88
--- /dev/null
+++ b/srcpkgs/libkkc/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/data/templates/libkkc-data/tools/genfilter.py b/data/templates/libkkc-data/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/data/templates/libkkc-data/tools/genfilter.py
++++ b/data/templates/libkkc-data/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+diff --git a/data/templates/libkkc-data/tools/sortlm.py b/data/templates/libkkc-data/tools/sortlm.py
+index a0dd8fe..40f0837 100644
+--- a/data/templates/libkkc-data/tools/sortlm.py
++++ b/data/templates/libkkc-data/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc/template b/srcpkgs/libkkc/template
new file mode 100644
index 000000000000..dc4d76a771ca
--- /dev/null
+++ b/srcpkgs/libkkc/template
@@ -0,0 +1,46 @@
+# Template file for 'libkkc'
+pkgname=libkkc
+version=0.3.5
+revision=1
+build_style=gnu-configure
+build_helper=gir
+configure_args="--disable-static --disable-silent-rules"
+make_build_args="V=1"
+hostmakedepends="pkg-config glib-devel gettext intltool python3-marisa
+ $(vopt_if gir vala)"
+makedepends="libglib-devel libgee08-devel json-glib-devel marisa-devel
+ $(vopt_if gir vala-devel)"
+depends="libkkc-data"
+short_desc="Japanese Kana Kanji conversion input method library"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${version}/libkkc-${version}.tar.gz"
+checksum=89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef
+patch_args=-Np1
+python_version=3
+
+build_options="gir"
+build_options_default="gir"
+
+libkkc-utils_package() {
+	short_desc+=" - utils"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/locale
+	}
+}
+
+libkkc-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/share/libkkc/templates
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+			vmove usr/share/vala
+		fi
+	}
+}

From 5d035ec3f21c2ba0c340fb8ffbda65a181c67eec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 31 Mar 2021 22:28:30 +0700
Subject: [PATCH 27/29] New package: skkdic-20210106

---
 srcpkgs/skkdic-extra                         |  1 +
 srcpkgs/skkdic/patches/010_assoc.patch       | 24 +++++++++++
 srcpkgs/skkdic/patches/dump-dict-lists.patch | 12 ++++++
 srcpkgs/skkdic/template                      | 45 ++++++++++++++++++++
 4 files changed, 82 insertions(+)
 create mode 120000 srcpkgs/skkdic-extra
 create mode 100644 srcpkgs/skkdic/patches/010_assoc.patch
 create mode 100644 srcpkgs/skkdic/patches/dump-dict-lists.patch
 create mode 100644 srcpkgs/skkdic/template

diff --git a/srcpkgs/skkdic-extra b/srcpkgs/skkdic-extra
new file mode 120000
index 000000000000..eb0ad40ae696
--- /dev/null
+++ b/srcpkgs/skkdic-extra
@@ -0,0 +1 @@
+skkdic
\ No newline at end of file
diff --git a/srcpkgs/skkdic/patches/010_assoc.patch b/srcpkgs/skkdic/patches/010_assoc.patch
new file mode 100644
index 000000000000..14ea32e8f534
--- /dev/null
+++ b/srcpkgs/skkdic/patches/010_assoc.patch
@@ -0,0 +1,24 @@
+Subject: assoc: fix incorrect words
+Origin: upstream, https://github.com/skk-dev/dict/commit/fcd7503d041b344014c226da078ccd14f8081233
+Bug: https://github.com/skk-dev/dict/pull/26
+
+--- a/SKK-JISYO.assoc
++++ b/SKK-JISYO.assoc
+@@ -573,7 +573,7 @@ $ /
+ 12¤­¤å¤¦ /½½ÆóµÜ/ÇòÍӵܡ¦¶âµíµÜ¡¦ÁлùµÜ¡¦µð³ªµÜ¡¦»â»ÒµÜ¡¦½è½÷µÜ¡¦Å·ÇéµÜ¡¦Å·éùµÜ¡¦¿ÍÇϵܡ¦Ëá滵ܡ¦ÊõÉӵܡ¦ÁеûµÜ/¤ª¤Ò¤Ä¤¸ºÂ¡¦¤ª¤¦¤·ºÂ¡¦¤Õ¤¿¤´ºÂ¡¦¤«¤ËºÂ¡¦¤·¤·ºÂ¡¦¤ª¤È¤áºÂ¡¦¤Æ¤ó¤Ó¤óºÂ¡¦¤µ¤½¤êºÂ¡¦¤¤¤ÆºÂ¡¦¤ä¤®ºÂ¡¦¤ß¤º¤¬¤áºÂ¡¦¤¦¤ªºÂ/
+ 12¤· /½½Æó»Ù/»Ò±¯ÆÒ±¬Ã¤Ì¦¸á̤¿½ÆÓØü°ç/
+ 13 /XIII;[¥í¡¼¥Þ¿ô»ú]/
+-14 /XVI;[¥í¡¼¥Þ¿ô»ú]/
++14 /XIV;[¥í¡¼¥Þ¿ô»ú]/
+ 15 /XV;[¥í¡¼¥Þ¿ô»ú]/
+ 16 /XVI;[¥í¡¼¥Þ¿ô»ú]/
+ 17 /XVII;[¥í¡¼¥Þ¿ô»ú]/
+@@ -593,7 +593,7 @@ $ /
+ 22 /XXII;[¥í¡¼¥Þ¿ô»ú]/
+ 226 /IM Used;[HTTP]/
+ 23 /XXIII;[¥í¡¼¥Þ¿ô»ú]/
+-24 /XXVI;[¥í¡¼¥Þ¿ô»ú]/
++24 /XXIV;[¥í¡¼¥Þ¿ô»ú]/
+ 24¤»¤Ã¤­ /Æó½½»ÍÀᵤ/¾®´¨¡¦Âç´¨¡¦Î©½Õ¡¦±«¿å¡¦·¼ê¯¡¦½Õʬ¡¦À¶ÌÀ¡¦¹ò±«¡¦Î©²Æ¡¦¾®Ëþ¡¦çê¼ï¡¦²Æ»ê¡¦¾®½ë¡¦Âç½ë¡¦Î©½©¡¦½è½ë¡¦ÇòϪ¡¦½©Ê¬¡¦´¨Ïª¡¦Áú¹ß¡¦Î©Åß¡¦¾®À㡦ÂçÀ㡦Åß»ê/
+ 25 /XXV;[¥í¡¼¥Þ¿ô»ú]/
+ 26 /XXVI;[¥í¡¼¥Þ¿ô»ú]/
diff --git a/srcpkgs/skkdic/patches/dump-dict-lists.patch b/srcpkgs/skkdic/patches/dump-dict-lists.patch
new file mode 100644
index 000000000000..c9d436218f2a
--- /dev/null
+++ b/srcpkgs/skkdic/patches/dump-dict-lists.patch
@@ -0,0 +1,12 @@
+Index: skk-dev-dict-7497806/Makefile
+===================================================================
+--- skk-dev-dict-7497806.orig/Makefile
++++ skk-dev-dict-7497806/Makefile
+@@ -231,4 +231,7 @@ IVD_Sequences.txt:
+ IVD_Collections.txt:
+ 	test -f IVD_Collections.txt || $(CURL) -o IVD_Collections.txt https://unicode.org/ivd/data/2017-12-12/IVD_Collections.txt
+ 
++xbps-list:
++	@echo $(SRCS)
++
+ # end of Makefile.
diff --git a/srcpkgs/skkdic/template b/srcpkgs/skkdic/template
new file mode 100644
index 000000000000..29089715e23b
--- /dev/null
+++ b/srcpkgs/skkdic/template
@@ -0,0 +1,45 @@
+# Template file for 'skkdic'
+pkgname=skkdic
+version=20210106
+revision=1
+create_wrksrc=yes
+short_desc="SKK dictionaries"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="http://openlab.ring.gr.jp/skk/dic.html"
+distfiles="${DEBIAN_SITE}/main/s/skkdic/skkdic_${version}.orig.tar.gz"
+checksum=625aef9ce0294e2ca8efcff3241bda9aa5103d2e387049b67de144c916556c73
+patch_args=-Np1
+
+do_extract() {
+	local _pkgver=${pkgname}-${version}
+	bsdtar --strip-components=1 \
+		-xf ${XBPS_SRCDISTDIR}/${_pkgver}/skkdic_${version}.orig.tar.gz
+}
+
+post_patch() {
+	_filelist="$(grep -El 'coding: euc-(jp|jis-2004)' $(make xbps-list))"
+	for _file in $_filelist
+	do
+		iconv -f euc-jp -t utf-8 "$_file" >"xbps-${_file}"
+		sed -E 's/coding: euc-(jp|jis-2004)/coding: utf-8/' \
+			"xbps-${_file}" >"${_file}"
+	done
+}
+
+
+do_install() {
+	vinstall SKK-JISYO.L 644 usr/share/skk
+}
+
+skkdic-extra_package() {
+	short_desc+=" - extra"
+	pkg_install() {
+		for _file in $(make xbps-list)
+		do
+			if [ "$_file" != SKK-JISYO.L ]; then
+				vinstall "$_file" 644 usr/share/skk
+			fi
+		done
+	}
+}

From cd48f983b591d102670f62866e84e3be9e97c5aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 31 Mar 2021 23:02:28 +0700
Subject: [PATCH 28/29] New package: fcitx5-skk-5.0.5

---
 srcpkgs/fcitx5-skk-config   |  1 +
 srcpkgs/fcitx5-skk/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-skk-config
 create mode 100644 srcpkgs/fcitx5-skk/template

diff --git a/srcpkgs/fcitx5-skk-config b/srcpkgs/fcitx5-skk-config
new file mode 120000
index 000000000000..aafbfd729aa8
--- /dev/null
+++ b/srcpkgs/fcitx5-skk-config
@@ -0,0 +1 @@
+fcitx5-skk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-skk/template b/srcpkgs/fcitx5-skk/template
new file mode 100644
index 000000000000..4e857ba795da
--- /dev/null
+++ b/srcpkgs/fcitx5-skk/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-skk'
+pkgname=fcitx5-skk
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libskk-devel libgee08-devel json-glib-devel"
+depends="fcitx5 skkdic"
+short_desc="Fcitx5 - SKK engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-skk/fcitx5-skk-${version}.tar.xz"
+checksum=53d60da0386c4f97f5aa094c80f763e39bcb13af30b338c564304cfe657b88cd
+
+fcitx5-skk-config_package() {
+	short_desc+=" - config"
+	depends="fcitx5-skk"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

From d47cf06575a049a4942f33c967e9f47bcb11e52e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 22:43:59 +0700
Subject: [PATCH 29/29] New package: fcitx5-kkc-5.0.5

---
 srcpkgs/fcitx5-kkc-config   |  1 +
 srcpkgs/fcitx5-kkc/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-kkc-config
 create mode 100644 srcpkgs/fcitx5-kkc/template

diff --git a/srcpkgs/fcitx5-kkc-config b/srcpkgs/fcitx5-kkc-config
new file mode 120000
index 000000000000..4686c1fbe9b3
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc-config
@@ -0,0 +1 @@
+fcitx5-kkc
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-kkc/template b/srcpkgs/fcitx5-kkc/template
new file mode 100644
index 000000000000..36750cc55ccb
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-kkc'
+pkgname=fcitx5-kkc
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libkkc-devel libgee08-devel json-glib-devel"
+depends="fcitx5 skkdic"
+short_desc="Fcitx5 - kkc engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-kkc/fcitx5-kkc-${version}.tar.xz"
+checksum=0e5fc4a8cd3dce8fa3774e6f304013869709aaa7cda9d9420386841e6d850b92
+
+fcitx5-kkc-config_package() {
+	short_desc+=" - config"
+	depends="fcitx5-kkc>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (17 preceding siblings ...)
  2021-03-31 16:18 ` sgn
@ 2021-04-01  0:09 ` sgn
  2021-04-06 20:45 ` fcitx5 noarchwastaken
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-04-01  0:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 93186 bytes --]

From 22e39debb899cbc7297a95edaf3a6fcba9b8387f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/29] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 4a81ffd64e21..d02191d49eb1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 49eb6252cfa5a6ad63415a1b5418cb61691886ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/29] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index d02191d49eb1..5d182ca1fe65 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2121,6 +2121,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From f1c15a8c266aff93c7c248aed8d5644549db195c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/29] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 71 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 76 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index 5d182ca1fe65..11ed5622a2fa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..06a54a221d65
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,71 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,/usr,${_IMPORT_PREFIX},g' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From e0c728f12bb7bdd7642e4b994cd4d3c1885a0103 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/29] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 11ed5622a2fa..40921762bcee 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2125,6 +2125,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..79da6b401796
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision} qt5-devel"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From 4ab8016eedd0e269826caade56955c0371f6b922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/29] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 41ae31b291d15294cf0d6b6b3ac1a1f4f28f646b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/29] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From a25d4dd803e9c83ae5cbd1c46eb6d621306a4037 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/29] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From 8b44fd21bc2f9dabbbc4f75d259d0ce16a967c11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/29] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..597d193e3e00
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db fcitx5"
+checkdepends="$depends"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From c9c37f57166387d45117df2a0021f2ee636f8044 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/29] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 7e9ed63229c12f13907ae3beb2a2e736c1bf2f8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/29] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index 40921762bcee..dca48b891a03 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 32ef064b6c45f35fb94796bf5b4b3d494f608466 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/29] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..8f2c9c4ce432 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx5-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From d0f9d92dd01a8c647590f51daff1400027966946 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/29] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel           |  1 +
 srcpkgs/fcitx5-chinese-addons-icons           |  1 +
 .../fcitx5-chinese-addons-pinyin-dict-manager |  1 +
 srcpkgs/fcitx5-chinese-addons/template        | 58 +++++++++++++++++++
 4 files changed, 61 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager b/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..a37a025d7af0
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,58 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-pinyin-dict-manager_package() {
+	short_desc+=" - Pinyin Dictionaries Manager"
+	depends="fcitx5-chinese-addons>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-chinese-addons>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 19d31ffb819e7deaf9217c5979c2490a4295c39f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/29] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From e2cf2dbcded2d775e60f4fd4659f3afb6f4a3801 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/29] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index dca48b891a03..3506746e83c8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3114,6 +3114,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..46a5ad944e88
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3 libime-utils"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 19caf98404c47ce3f428d9f4d7117f427f158604 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/29] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index 3506746e83c8..b040daaaff37 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3549,6 +3549,7 @@ libcaf_openssl.so.0.18.0 zeek-4.0.0_1
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From c766680984fe682003818d2dfc3aa6ab4e9ff010 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/29] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From adccd14f474c94846168823aa42f18dcd157c201 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/29] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From 666e207f3134ade322ab2ccfceffc514807d9f80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/29] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From f09c05b02f6ff2f42276942658a3efffdf9fe6e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/29] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From a8e74d7b13d3543856664e6a5c9dd6f29c4816eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/29] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..d1b50e2d6237 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,15 +1,20 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
-homepage="https://github.com/fcitx/fcitx-hangul"
+maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-only"
+homepage="https://github.com/fcitx/fcitx-hangul"
 distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.tar.xz"
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 44939308ae5d6ee3c4fa8508454857ed8187f391 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 18:42:50 +0700
Subject: [PATCH 21/29] New package: anthy-unicode-1.0.0.20201109

---
 common/shlibs                  |  3 +++
 srcpkgs/anthy-unicode-devel    |  1 +
 srcpkgs/anthy-unicode/template | 37 ++++++++++++++++++++++++++++++++++
 srcpkgs/libanthy-unicode       |  1 +
 4 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/anthy-unicode-devel
 create mode 100644 srcpkgs/anthy-unicode/template
 create mode 120000 srcpkgs/libanthy-unicode

diff --git a/common/shlibs b/common/shlibs
index b040daaaff37..9049007d1ac2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2335,6 +2335,9 @@ liboath.so.0 oath-toolkit-2.6.0_2
 libanthy.so.1 libanthy-0.4_1
 libanthydic.so.1 libanthy-0.4_1
 libanthyinput.so.0 libanthy-0.4_1
+libanthy-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthydic-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthyinput-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
 libanthygobject-1.0.so.5 ibus-anthy-1.5.6_1
 libtbbmalloc_proxy_debug.so.2 tbb-4.3_1
 libtbbmalloc_proxy.so.2 tbb-4.3_1
diff --git a/srcpkgs/anthy-unicode-devel b/srcpkgs/anthy-unicode-devel
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/anthy-unicode-devel
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file
diff --git a/srcpkgs/anthy-unicode/template b/srcpkgs/anthy-unicode/template
new file mode 100644
index 000000000000..f7c4ae32a5bb
--- /dev/null
+++ b/srcpkgs/anthy-unicode/template
@@ -0,0 +1,37 @@
+# Template file for 'anthy-unicode'
+pkgname=anthy-unicode
+version=1.0.0.20201109
+revision=1
+build_style=gnu-configure
+configure_args="--disable-static"
+short_desc="Japanese character set input library for Unicode"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.0-or-later, GPL-2.0-only, Public Domain"
+homepage="https://github.com/fujiwarat/anthy-unicode/wiki"
+distfiles="https://github.com/fujiwarat/anthy-unicode/releases/download/${version}/${pkgname}-${version}.tar.gz"
+checksum=7d595bd422222bd67d7944f0c29f7d739fe677e4b885de3d4f0dae417b674381
+nocross='execute lt-mkdepgraph'
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/*.la
+}
+
+libanthy-unicode_package() {
+	short_desc+=" - libraries"
+	conf_files="/etc/anthy-unicode.conf"
+	pkg_install() {
+		vmove etc/anthy-unicode.conf
+		vmove "usr/lib/*.so.*"
+		vmove usr/share
+	}
+}
+
+anthy-unicode-devel_package() {
+	short_desc+=" - development files"
+	depends="libanthy-unicode-${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/libanthy-unicode b/srcpkgs/libanthy-unicode
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/libanthy-unicode
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file

From 658a64dbf76bac4d3ebf9b4945396c2286bdc4f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:38 +0700
Subject: [PATCH 22/29] New package: fcitx5-anthy-5.0.4

---
 srcpkgs/fcitx5-anthy-icons                    |  1 +
 .../fcitx5-anthy/patches/fix-build-musl.patch | 18 +++++++++++++++
 srcpkgs/fcitx5-anthy/template                 | 23 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/fcitx5-anthy-icons
 create mode 100644 srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
 create mode 100644 srcpkgs/fcitx5-anthy/template

diff --git a/srcpkgs/fcitx5-anthy-icons b/srcpkgs/fcitx5-anthy-icons
new file mode 120000
index 000000000000..6fee45a4d396
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy-icons
@@ -0,0 +1 @@
+fcitx5-anthy
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
new file mode 100644
index 000000000000..bc19b7c5c406
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
@@ -0,0 +1,18 @@
+Index: fcitx5-anthy-5.0.4/src/utils.h
+===================================================================
+--- fcitx5-anthy-5.0.4.orig/src/utils.h
++++ fcitx5-anthy-5.0.4/src/utils.h
+@@ -28,11 +28,11 @@ bool key_is_keypad(const fcitx::Key &key
+ std::string keypad_to_string(const fcitx::KeyEvent &key);
+ void launch_program(std::string command);
+ 
+-bool surrounding_get_safe_delta(uint from, uint to, int32_t *delta);
++bool surrounding_get_safe_delta(unsigned from, unsigned to, int32_t *delta);
+ 
+ bool surrounding_get_anchor_pos_from_selection(
+     const std::string &surrounding_text, const std::string &selected_text,
+-    uint cursor_pos, uint *anchor_pos);
++    unsigned cursor_pos, unsigned *anchor_pos);
+ 
+ inline char get_ascii_code(const fcitx::Key &key) {
+     auto chr = fcitx::Key::keySymToUnicode(key.sym());
diff --git a/srcpkgs/fcitx5-anthy/template b/srcpkgs/fcitx5-anthy/template
new file mode 100644
index 000000000000..a2bec24b3080
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-anthy'
+pkgname=fcitx5-anthy
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="anthy-unicode-devel libfcitx5-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Anthy engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-anthy/fcitx5-anthy-${version}.tar.xz"
+checksum=6e15c0e32508db3e6b233efb99677a7b4b4478950a57bb76bd509355276b9636
+patch_args=-Np1
+
+fcitx5-anthy-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-anthy<=0.2.3_2"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 79a64ecbd6a9a39924428a5d60bb9440bc6689c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:31 +0700
Subject: [PATCH 23/29] fcitx-anthy: use shared icons with fcitx5

---
 srcpkgs/fcitx-anthy/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-anthy/template b/srcpkgs/fcitx-anthy/template
index d03499e83c3e..053db036dec4 100644
--- a/srcpkgs/fcitx-anthy/template
+++ b/srcpkgs/fcitx-anthy/template
@@ -1,10 +1,10 @@
 # Template file for 'fcitx-anthy'
 pkgname=fcitx-anthy
 version=0.2.3
-revision=2
+revision=3
 build_style=cmake
 makedepends="anthy-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-anthy-icons"
 short_desc="Fcitx wrapper for Anthy IM engine"
 maintainer="Matthias von Faber <mvf@gmx.eu>"
 license="GPL-2.0-or-later"
@@ -13,3 +13,7 @@ distfiles="https://github.com/fcitx/fcitx-anthy/archive/${version}.tar.gz"
 checksum=31826a49a7ff743f830e1279527301abce9e669bc176934c76775999299421a8
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From c4d0d6dcf4b46cee3b98c18b79be9365686a47e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 22:03:06 +0700
Subject: [PATCH 24/29] marisa: build python3 bindings

---
 srcpkgs/marisa/template | 41 +++++++++++++++++++++++++++++++++++++++--
 srcpkgs/python3-marisa  |  1 +
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/python3-marisa

diff --git a/srcpkgs/marisa/template b/srcpkgs/marisa/template
index 2aebc8712f5b..95e0403a7fef 100644
--- a/srcpkgs/marisa/template
+++ b/srcpkgs/marisa/template
@@ -1,10 +1,11 @@
 # Template file for 'marisa'
 pkgname=marisa
 version=0.2.6
-revision=1
+revision=2
 wrksrc="${pkgname}-trie-$version"
 build_style=gnu-configure
-hostmakedepends="autoconf automake libtool"
+hostmakedepends="autoconf automake libtool python3-setuptools swig"
+makedepends="python3-devel"
 short_desc="Matching Algorithm with Recursively Implemented StorAge"
 maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
 license="BSD-2-Clause, LGPL-2.1-or-later"
@@ -16,14 +17,50 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*) configure_args+=" --enable-popcnt --enable-sse2";;
 esac
 
+CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+CXXFLAGS="$CFLAGS"
+LDFLAGS="-L${XBPS_CROSS_BASE}/${py3_lib}"
+
+_python_env() {
+	local f
+	CFLAGS+=" -I${wrksrc}/include"
+	LDFLAGS+=" -L${wrksrc}/lib/marisa/.libs"
+	export PYPREFIX="${XBPS_CROSS_BASE}"
+	export LDSHARED="${CXX} -shared ${LDFLAGS}"
+	export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
+	for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+		f=${f##*/}
+		export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+	done
+}
+
 pre_configure() {
 	autoreconf -fi
 }
 
+post_build() {
+	make -C bindings
+	cd ${wrksrc}/bindings/python
+	_python_env
+	python3 setup.py build
+	cd ${wrksrc}
+}
+
 post_install() {
 	vlicense COPYING.md
 }
 
+python3-marisa_package() {
+	short_desc+=" - Python 3 bindings"
+	depends="python3"
+	pkg_install() {
+		cd ${wrksrc}/bindings/python
+		_python_env
+		python3 setup.py install --root=${PKGDESTDIR} --prefix=/usr
+		cd ${wrksrc}
+	}
+}
+
 marisa-devel_package() {
 	depends="marisa-${version}_${revision}"
 	short_desc+=" - development files"
diff --git a/srcpkgs/python3-marisa b/srcpkgs/python3-marisa
new file mode 120000
index 000000000000..4ebb55bc8b9f
--- /dev/null
+++ b/srcpkgs/python3-marisa
@@ -0,0 +1 @@
+marisa
\ No newline at end of file

From 758d94d3757bf5357453edd93103c26bf828a50f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:49:25 +0700
Subject: [PATCH 25/29] New package: libkkc-data-0.2.7

---
 srcpkgs/libkkc-data/patches/python3.patch | 138 ++++++++++++++++++++++
 srcpkgs/libkkc-data/template              |  14 +++
 2 files changed, 152 insertions(+)
 create mode 100644 srcpkgs/libkkc-data/patches/python3.patch
 create mode 100644 srcpkgs/libkkc-data/template

diff --git a/srcpkgs/libkkc-data/patches/python3.patch b/srcpkgs/libkkc-data/patches/python3.patch
new file mode 100644
index 000000000000..70bfdcc0d372
--- /dev/null
+++ b/srcpkgs/libkkc-data/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ taken from libkkc
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/tools/genfilter.py b/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/tools/genfilter.py
++++ b/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+index a0dd8fe..40f0837 100644
+--- a/tools/sortlm.py
++++ b/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc-data/template b/srcpkgs/libkkc-data/template
new file mode 100644
index 000000000000..ffbfa76c4247
--- /dev/null
+++ b/srcpkgs/libkkc-data/template
@@ -0,0 +1,14 @@
+# Template file for 'libkkc-data'
+pkgname=libkkc-data
+_libkkc_version=0.3.5
+version=0.2.7
+revision=1
+build_style=gnu-configure
+hostmakedepends="python3-marisa"
+short_desc="Japanese Kana Kanji conversion input method library - data"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${_libkkc_version}/libkkc-data-${version}.tar.xz"
+checksum=9e678755a030043da68e37a4049aa296c296869ff1fb9e6c70026b2541595b99
+patch_args=-Np1

From 773e3e2e244d1da0eb1cb62c126a5fa4684299c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:24:13 +0700
Subject: [PATCH 26/29] New package: libkkc-0.3.5

---
 common/shlibs                              |   1 +
 srcpkgs/libkkc-devel                       |   1 +
 srcpkgs/libkkc-utils                       |   1 +
 srcpkgs/libkkc/patches/musl-locale.patch   |  13 ++
 srcpkgs/libkkc/patches/no-ssp-static.patch |  13 ++
 srcpkgs/libkkc/patches/python3.patch       | 138 +++++++++++++++++++++
 srcpkgs/libkkc/template                    |  46 +++++++
 7 files changed, 213 insertions(+)
 create mode 120000 srcpkgs/libkkc-devel
 create mode 120000 srcpkgs/libkkc-utils
 create mode 100644 srcpkgs/libkkc/patches/musl-locale.patch
 create mode 100644 srcpkgs/libkkc/patches/no-ssp-static.patch
 create mode 100644 srcpkgs/libkkc/patches/python3.patch
 create mode 100644 srcpkgs/libkkc/template

diff --git a/common/shlibs b/common/shlibs
index 9049007d1ac2..7e6f687f7f32 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3112,6 +3112,7 @@ libopenglrecorder.so.0 libopenglrecorder-0.1.0_1
 libgpod.so.4 libgpod-0.8.3_1
 libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
+libkkc.so.2 libkkc-0.3.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
diff --git a/srcpkgs/libkkc-devel b/srcpkgs/libkkc-devel
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-devel
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc-utils b/srcpkgs/libkkc-utils
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-utils
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc/patches/musl-locale.patch b/srcpkgs/libkkc/patches/musl-locale.patch
new file mode 100644
index 000000000000..5ae9e6eb2c7e
--- /dev/null
+++ b/srcpkgs/libkkc/patches/musl-locale.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -6710,7 +6710,7 @@ fi
+ 
+     ;;
+     *)
+-    DATADIRNAME=lib
++    DATADIRNAME=share
+     ;;
+     esac
+ fi
diff --git a/srcpkgs/libkkc/patches/no-ssp-static.patch b/srcpkgs/libkkc/patches/no-ssp-static.patch
new file mode 100644
index 000000000000..ea5013582061
--- /dev/null
+++ b/srcpkgs/libkkc/patches/no-ssp-static.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -18480,7 +18480,7 @@ $as_echo "yes" >&6; }
+ fi
+ 
+ # libstdc++ needs to be linked with libmarisa-glib.a
+-MARISA_GLIB_STATIC_DEPENDENCIES="$postdeps_CXX"
++MARISA_GLIB_STATIC_DEPENDENCIES="-lstdc++"
+ 
+ 
+ LIBKKC_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS"
diff --git a/srcpkgs/libkkc/patches/python3.patch b/srcpkgs/libkkc/patches/python3.patch
new file mode 100644
index 000000000000..91d3f6956e88
--- /dev/null
+++ b/srcpkgs/libkkc/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/data/templates/libkkc-data/tools/genfilter.py b/data/templates/libkkc-data/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/data/templates/libkkc-data/tools/genfilter.py
++++ b/data/templates/libkkc-data/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+diff --git a/data/templates/libkkc-data/tools/sortlm.py b/data/templates/libkkc-data/tools/sortlm.py
+index a0dd8fe..40f0837 100644
+--- a/data/templates/libkkc-data/tools/sortlm.py
++++ b/data/templates/libkkc-data/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc/template b/srcpkgs/libkkc/template
new file mode 100644
index 000000000000..dc4d76a771ca
--- /dev/null
+++ b/srcpkgs/libkkc/template
@@ -0,0 +1,46 @@
+# Template file for 'libkkc'
+pkgname=libkkc
+version=0.3.5
+revision=1
+build_style=gnu-configure
+build_helper=gir
+configure_args="--disable-static --disable-silent-rules"
+make_build_args="V=1"
+hostmakedepends="pkg-config glib-devel gettext intltool python3-marisa
+ $(vopt_if gir vala)"
+makedepends="libglib-devel libgee08-devel json-glib-devel marisa-devel
+ $(vopt_if gir vala-devel)"
+depends="libkkc-data"
+short_desc="Japanese Kana Kanji conversion input method library"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${version}/libkkc-${version}.tar.gz"
+checksum=89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef
+patch_args=-Np1
+python_version=3
+
+build_options="gir"
+build_options_default="gir"
+
+libkkc-utils_package() {
+	short_desc+=" - utils"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/locale
+	}
+}
+
+libkkc-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/share/libkkc/templates
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+			vmove usr/share/vala
+		fi
+	}
+}

From cac5d464247fb6459fd3528839ea77c9092dc2dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 31 Mar 2021 22:28:30 +0700
Subject: [PATCH 27/29] New package: skkdic-20210106

---
 srcpkgs/skkdic-extra                         |  1 +
 srcpkgs/skkdic/patches/010_assoc.patch       | 24 +++++++++++
 srcpkgs/skkdic/patches/dump-dict-lists.patch | 12 ++++++
 srcpkgs/skkdic/template                      | 45 ++++++++++++++++++++
 4 files changed, 82 insertions(+)
 create mode 120000 srcpkgs/skkdic-extra
 create mode 100644 srcpkgs/skkdic/patches/010_assoc.patch
 create mode 100644 srcpkgs/skkdic/patches/dump-dict-lists.patch
 create mode 100644 srcpkgs/skkdic/template

diff --git a/srcpkgs/skkdic-extra b/srcpkgs/skkdic-extra
new file mode 120000
index 000000000000..eb0ad40ae696
--- /dev/null
+++ b/srcpkgs/skkdic-extra
@@ -0,0 +1 @@
+skkdic
\ No newline at end of file
diff --git a/srcpkgs/skkdic/patches/010_assoc.patch b/srcpkgs/skkdic/patches/010_assoc.patch
new file mode 100644
index 000000000000..14ea32e8f534
--- /dev/null
+++ b/srcpkgs/skkdic/patches/010_assoc.patch
@@ -0,0 +1,24 @@
+Subject: assoc: fix incorrect words
+Origin: upstream, https://github.com/skk-dev/dict/commit/fcd7503d041b344014c226da078ccd14f8081233
+Bug: https://github.com/skk-dev/dict/pull/26
+
+--- a/SKK-JISYO.assoc
++++ b/SKK-JISYO.assoc
+@@ -573,7 +573,7 @@ $ /
+ 12¤­¤å¤¦ /½½ÆóµÜ/ÇòÍӵܡ¦¶âµíµÜ¡¦ÁлùµÜ¡¦µð³ªµÜ¡¦»â»ÒµÜ¡¦½è½÷µÜ¡¦Å·ÇéµÜ¡¦Å·éùµÜ¡¦¿ÍÇϵܡ¦Ëá滵ܡ¦ÊõÉӵܡ¦ÁеûµÜ/¤ª¤Ò¤Ä¤¸ºÂ¡¦¤ª¤¦¤·ºÂ¡¦¤Õ¤¿¤´ºÂ¡¦¤«¤ËºÂ¡¦¤·¤·ºÂ¡¦¤ª¤È¤áºÂ¡¦¤Æ¤ó¤Ó¤óºÂ¡¦¤µ¤½¤êºÂ¡¦¤¤¤ÆºÂ¡¦¤ä¤®ºÂ¡¦¤ß¤º¤¬¤áºÂ¡¦¤¦¤ªºÂ/
+ 12¤· /½½Æó»Ù/»Ò±¯ÆÒ±¬Ã¤Ì¦¸á̤¿½ÆÓØü°ç/
+ 13 /XIII;[¥í¡¼¥Þ¿ô»ú]/
+-14 /XVI;[¥í¡¼¥Þ¿ô»ú]/
++14 /XIV;[¥í¡¼¥Þ¿ô»ú]/
+ 15 /XV;[¥í¡¼¥Þ¿ô»ú]/
+ 16 /XVI;[¥í¡¼¥Þ¿ô»ú]/
+ 17 /XVII;[¥í¡¼¥Þ¿ô»ú]/
+@@ -593,7 +593,7 @@ $ /
+ 22 /XXII;[¥í¡¼¥Þ¿ô»ú]/
+ 226 /IM Used;[HTTP]/
+ 23 /XXIII;[¥í¡¼¥Þ¿ô»ú]/
+-24 /XXVI;[¥í¡¼¥Þ¿ô»ú]/
++24 /XXIV;[¥í¡¼¥Þ¿ô»ú]/
+ 24¤»¤Ã¤­ /Æó½½»ÍÀᵤ/¾®´¨¡¦Âç´¨¡¦Î©½Õ¡¦±«¿å¡¦·¼ê¯¡¦½Õʬ¡¦À¶ÌÀ¡¦¹ò±«¡¦Î©²Æ¡¦¾®Ëþ¡¦çê¼ï¡¦²Æ»ê¡¦¾®½ë¡¦Âç½ë¡¦Î©½©¡¦½è½ë¡¦ÇòϪ¡¦½©Ê¬¡¦´¨Ïª¡¦Áú¹ß¡¦Î©Åß¡¦¾®À㡦ÂçÀ㡦Åß»ê/
+ 25 /XXV;[¥í¡¼¥Þ¿ô»ú]/
+ 26 /XXVI;[¥í¡¼¥Þ¿ô»ú]/
diff --git a/srcpkgs/skkdic/patches/dump-dict-lists.patch b/srcpkgs/skkdic/patches/dump-dict-lists.patch
new file mode 100644
index 000000000000..c9d436218f2a
--- /dev/null
+++ b/srcpkgs/skkdic/patches/dump-dict-lists.patch
@@ -0,0 +1,12 @@
+Index: skk-dev-dict-7497806/Makefile
+===================================================================
+--- skk-dev-dict-7497806.orig/Makefile
++++ skk-dev-dict-7497806/Makefile
+@@ -231,4 +231,7 @@ IVD_Sequences.txt:
+ IVD_Collections.txt:
+ 	test -f IVD_Collections.txt || $(CURL) -o IVD_Collections.txt https://unicode.org/ivd/data/2017-12-12/IVD_Collections.txt
+ 
++xbps-list:
++	@echo $(SRCS)
++
+ # end of Makefile.
diff --git a/srcpkgs/skkdic/template b/srcpkgs/skkdic/template
new file mode 100644
index 000000000000..29089715e23b
--- /dev/null
+++ b/srcpkgs/skkdic/template
@@ -0,0 +1,45 @@
+# Template file for 'skkdic'
+pkgname=skkdic
+version=20210106
+revision=1
+create_wrksrc=yes
+short_desc="SKK dictionaries"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="http://openlab.ring.gr.jp/skk/dic.html"
+distfiles="${DEBIAN_SITE}/main/s/skkdic/skkdic_${version}.orig.tar.gz"
+checksum=625aef9ce0294e2ca8efcff3241bda9aa5103d2e387049b67de144c916556c73
+patch_args=-Np1
+
+do_extract() {
+	local _pkgver=${pkgname}-${version}
+	bsdtar --strip-components=1 \
+		-xf ${XBPS_SRCDISTDIR}/${_pkgver}/skkdic_${version}.orig.tar.gz
+}
+
+post_patch() {
+	_filelist="$(grep -El 'coding: euc-(jp|jis-2004)' $(make xbps-list))"
+	for _file in $_filelist
+	do
+		iconv -f euc-jp -t utf-8 "$_file" >"xbps-${_file}"
+		sed -E 's/coding: euc-(jp|jis-2004)/coding: utf-8/' \
+			"xbps-${_file}" >"${_file}"
+	done
+}
+
+
+do_install() {
+	vinstall SKK-JISYO.L 644 usr/share/skk
+}
+
+skkdic-extra_package() {
+	short_desc+=" - extra"
+	pkg_install() {
+		for _file in $(make xbps-list)
+		do
+			if [ "$_file" != SKK-JISYO.L ]; then
+				vinstall "$_file" 644 usr/share/skk
+			fi
+		done
+	}
+}

From f9a822f2fb92b56ed4c658d5f97b87ae048e5788 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 31 Mar 2021 23:02:28 +0700
Subject: [PATCH 28/29] New package: fcitx5-skk-5.0.5

---
 srcpkgs/fcitx5-skk-config   |  1 +
 srcpkgs/fcitx5-skk/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-skk-config
 create mode 100644 srcpkgs/fcitx5-skk/template

diff --git a/srcpkgs/fcitx5-skk-config b/srcpkgs/fcitx5-skk-config
new file mode 120000
index 000000000000..aafbfd729aa8
--- /dev/null
+++ b/srcpkgs/fcitx5-skk-config
@@ -0,0 +1 @@
+fcitx5-skk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-skk/template b/srcpkgs/fcitx5-skk/template
new file mode 100644
index 000000000000..4e857ba795da
--- /dev/null
+++ b/srcpkgs/fcitx5-skk/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-skk'
+pkgname=fcitx5-skk
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libskk-devel libgee08-devel json-glib-devel"
+depends="fcitx5 skkdic"
+short_desc="Fcitx5 - SKK engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-skk/fcitx5-skk-${version}.tar.xz"
+checksum=53d60da0386c4f97f5aa094c80f763e39bcb13af30b338c564304cfe657b88cd
+
+fcitx5-skk-config_package() {
+	short_desc+=" - config"
+	depends="fcitx5-skk"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

From d0d82e85f11077fe9689b59e02c205f66328475c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 22:43:59 +0700
Subject: [PATCH 29/29] New package: fcitx5-kkc-5.0.5

---
 srcpkgs/fcitx5-kkc-config   |  1 +
 srcpkgs/fcitx5-kkc/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-kkc-config
 create mode 100644 srcpkgs/fcitx5-kkc/template

diff --git a/srcpkgs/fcitx5-kkc-config b/srcpkgs/fcitx5-kkc-config
new file mode 120000
index 000000000000..4686c1fbe9b3
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc-config
@@ -0,0 +1 @@
+fcitx5-kkc
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-kkc/template b/srcpkgs/fcitx5-kkc/template
new file mode 100644
index 000000000000..36750cc55ccb
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-kkc'
+pkgname=fcitx5-kkc
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libkkc-devel libgee08-devel json-glib-devel"
+depends="fcitx5 skkdic"
+short_desc="Fcitx5 - kkc engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-kkc/fcitx5-kkc-${version}.tar.xz"
+checksum=0e5fc4a8cd3dce8fa3774e6f304013869709aaa7cda9d9420386841e6d850b92
+
+fcitx5-kkc-config_package() {
+	short_desc+=" - config"
+	depends="fcitx5-kkc>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (18 preceding siblings ...)
  2021-04-01  0:09 ` sgn
@ 2021-04-06 20:45 ` noarchwastaken
  2021-04-07  0:11 ` fcitx5 sgn
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: noarchwastaken @ 2021-04-06 20:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by noarchwastaken on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-814428255

Comment:
Hi @sgn , just curious, are the new Japanese IMEs ready for testing?

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re:  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (19 preceding siblings ...)
  2021-04-06 20:45 ` fcitx5 noarchwastaken
@ 2021-04-07  0:11 ` sgn
  2021-04-08  0:13 ` [PR PATCH] [Updated] fcitx5 sgn
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-04-07  0:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29664#issuecomment-814511514

Comment:
It should be. I don't have time to test, though.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (20 preceding siblings ...)
  2021-04-07  0:11 ` fcitx5 sgn
@ 2021-04-08  0:13 ` sgn
  2021-04-08 15:19 ` sgn
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-04-08  0:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 93186 bytes --]

From 763e60d28ad6bbb33a6124656ad20c84a5c428c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/29] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 70be7e00c51d..cba6e2e59ee0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From 4b1e2513194c45bcf870dff7941c33cbee3a07fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/29] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++
 srcpkgs/fcitx5/template                       |  69 +++++++
 srcpkgs/libfcitx5                             |   1 +
 srcpkgs/libfcitx5-devel                       |   1 +
 7 files changed, 314 insertions(+)
 create mode 120000 srcpkgs/fcitx5-icons
 create mode 100644 srcpkgs/fcitx5/patches/cross-config-template.patch
 create mode 100644 srcpkgs/fcitx5/patches/no-which.patch
 create mode 100644 srcpkgs/fcitx5/template
 create mode 120000 srcpkgs/libfcitx5
 create mode 120000 srcpkgs/libfcitx5-devel

diff --git a/common/shlibs b/common/shlibs
index cba6e2e59ee0..6482674cca68 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2120,6 +2120,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 000000000000..99ac64afc615
--- /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 000000000000..69a988f3c877
--- /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 000000000000..ae553dd1535c
--- /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 000000000000..8263e9be3f18
--- /dev/null
+++ b/srcpkgs/fcitx5/template
@@ -0,0 +1,69 @@
+# Template file for 'fcitx5'
+pkgname=fcitx5
+version=5.0.6
+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 <congdanhqx@gmail.com>"
+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="47a454da8b7a2b6c983a69e2f501f402eb54a732a01b17ff6f49b915c7d20b9f
+ 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 000000000000..99ac64afc615
--- /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 000000000000..99ac64afc615
--- /dev/null
+++ b/srcpkgs/libfcitx5-devel
@@ -0,0 +1 @@
+fcitx5
\ No newline at end of file

From d5e6a396b27c331e82cc3f01b963deaad911ea8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 00:21:37 +0700
Subject: [PATCH 03/29] New package: fcitx5-gtk-5.0.5

---
 common/shlibs               |  1 +
 srcpkgs/fcitx5-gtk+2        |  1 +
 srcpkgs/fcitx5-gtk+3        |  1 +
 srcpkgs/fcitx5-gtk-devel    |  1 +
 srcpkgs/fcitx5-gtk/template | 71 +++++++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-gtk4         |  1 +
 6 files changed, 76 insertions(+)
 create mode 120000 srcpkgs/fcitx5-gtk+2
 create mode 120000 srcpkgs/fcitx5-gtk+3
 create mode 120000 srcpkgs/fcitx5-gtk-devel
 create mode 100644 srcpkgs/fcitx5-gtk/template
 create mode 120000 srcpkgs/fcitx5-gtk4

diff --git a/common/shlibs b/common/shlibs
index 6482674cca68..92cde1fb1d80 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2123,6 +2123,7 @@ 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
+libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_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-gtk+2 b/srcpkgs/fcitx5-gtk+2
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+2
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk+3 b/srcpkgs/fcitx5-gtk+3
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk+3
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk-devel b/srcpkgs/fcitx5-gtk-devel
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk-devel
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-gtk/template b/srcpkgs/fcitx5-gtk/template
new file mode 100644
index 000000000000..06a54a221d65
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk/template
@@ -0,0 +1,71 @@
+# Template file for 'fcitx5-gtk'
+pkgname=fcitx5-gtk
+version=5.0.5
+revision=1
+build_style=cmake
+build_helper=gir
+configure_args="$(vopt_bool gir ENABLE_GIR)"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel"
+makedepends="libfcitx5-devel libglib-devel fmt-devel
+ gtk+-devel gtk+3-devel gtk4-devel"
+short_desc="Fcitx v5 - GTK common"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-gtk/fcitx5-gtk-${version}.tar.xz"
+checksum=bf30f91db0c3809a0354b5cdf0be46ad5da9dc06e2c72e2cc24c4b180dc1f162
+lib32disabled=yes
+
+build_options="gir"
+build_options_default="gir"
+
+post_configure() {
+	find build -name cmake_install.cmake -exec \
+		sed -i -e 's,"//\+usr,"/usr,' {} +
+}
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,/usr,${_IMPORT_PREFIX},g' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+fcitx5-gtk+2_package() {
+	short_desc="${short_desc/common/+2 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-2.0
+	}
+}
+
+fcitx5-gtk+3_package() {
+	short_desc="${short_desc/common/+3 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-3.0
+	}
+}
+
+fcitx5-gtk4_package() {
+	short_desc="${short_desc/common/4 IM Modules}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/lib/gtk-4.0
+	}
+}
+
+fcitx5-gtk-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-gtk>=${version}_${revision} libglib-devel"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+		fi
+	}
+}
diff --git a/srcpkgs/fcitx5-gtk4 b/srcpkgs/fcitx5-gtk4
new file mode 120000
index 000000000000..de83ca580801
--- /dev/null
+++ b/srcpkgs/fcitx5-gtk4
@@ -0,0 +1 @@
+fcitx5-gtk
\ No newline at end of file

From b293bc648c2bc330b48daac443d436bafd7377bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 01:00:18 +0700
Subject: [PATCH 04/29] New package: fcitx5-qt5-5.0.4

---
 common/shlibs               |  2 ++
 srcpkgs/fcitx5-qt5-devel    |  1 +
 srcpkgs/fcitx5-qt5/template | 33 +++++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-qt5/update   |  1 +
 4 files changed, 37 insertions(+)
 create mode 120000 srcpkgs/fcitx5-qt5-devel
 create mode 100644 srcpkgs/fcitx5-qt5/template
 create mode 100644 srcpkgs/fcitx5-qt5/update

diff --git a/common/shlibs b/common/shlibs
index 92cde1fb1d80..56f99f59a9bb 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2124,6 +2124,8 @@ libFcitx5Utils.so.2 libfcitx5-5.0.5_1
 libFcitx5Core.so.7 libfcitx5-5.0.5_1
 libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
+libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
+libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_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-qt5-devel b/srcpkgs/fcitx5-qt5-devel
new file mode 120000
index 000000000000..b06bf33725d5
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5-devel
@@ -0,0 +1 @@
+fcitx5-qt5
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-qt5/template b/srcpkgs/fcitx5-qt5/template
new file mode 100644
index 000000000000..79da6b401796
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-qt5'
+pkgname=fcitx5-qt5
+version=5.0.4
+revision=1
+wrksrc=fcitx5-qt-$version
+build_style=cmake
+configure_args="-DENABLE_QT4=OFF -DENABLE_QT5=ON -DENABLE_QT6=OFF"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules qt5-qmake qt5-host-tools"
+makedepends="libfcitx5-devel fmt-devel qt5-devel libxkbcommon-devel"
+short_desc="Flexible Context-aware Input Tool with eXtension v5 - Qt5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later, BSD-3-Clause"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-qt/fcitx5-qt-${version}.tar.xz"
+checksum=1686d3508b21bb38133ff3a8528652d75c3fe4bd8eb1dbe5df573ed78038a021
+lib32disabled=yes
+
+post_install() {
+	sed -e 's/<year.*owner>/2012-2021 CSSlayer <wengxt@gmail.com>/' \
+		LICENSES/BSD-3-Clause.txt >LICENSE
+	vlicense LICENSE
+}
+
+fcitx5-qt5-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision} qt5-devel"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/fcitx5-qt5/update b/srcpkgs/fcitx5-qt5/update
new file mode 100644
index 000000000000..92b65ebc90e4
--- /dev/null
+++ b/srcpkgs/fcitx5-qt5/update
@@ -0,0 +1 @@
+pkgname=fcitx5-qt

From 010894a4ac403c96ecc452e686d1b88d298d7ea1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:18:21 +0700
Subject: [PATCH 05/29] New package: fcitx5-rime-5.0.5

---
 srcpkgs/fcitx5-rime-icons    |  1 +
 srcpkgs/fcitx5-rime/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-rime-icons
 create mode 100644 srcpkgs/fcitx5-rime/template

diff --git a/srcpkgs/fcitx5-rime-icons b/srcpkgs/fcitx5-rime-icons
new file mode 120000
index 000000000000..2de077b5f2e3
--- /dev/null
+++ b/srcpkgs/fcitx5-rime-icons
@@ -0,0 +1 @@
+fcitx5-rime
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-rime/template b/srcpkgs/fcitx5-rime/template
new file mode 100644
index 000000000000..216df93b017e
--- /dev/null
+++ b/srcpkgs/fcitx5-rime/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-rime'
+pkgname=fcitx5-rime
+version=5.0.5
+revision=1
+build_style=cmake
+configure_args="-DRIME_DATA_DIR=/usr/share/rime-data"
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel librime-devel"
+depends="brise fcitx5-rime-icons"
+short_desc="Fcitx v5 - RIME engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-rime/fcitx5-rime-${version}.tar.xz"
+checksum=7845893c572bfe0e3f19df91a8f25cfcc733990e6da7609850f89bc02907220a
+lib32disabled=yes
+
+fcitx5-rime-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 86fa57ca94453c7a880d105e16a170a4484250b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 09:31:33 +0700
Subject: [PATCH 06/29] New package: fcitx5-lua-5.0.4

---
 srcpkgs/fcitx5-lua-devel    |  1 +
 srcpkgs/fcitx5-lua/template | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 120000 srcpkgs/fcitx5-lua-devel
 create mode 100644 srcpkgs/fcitx5-lua/template

diff --git a/srcpkgs/fcitx5-lua-devel b/srcpkgs/fcitx5-lua-devel
new file mode 120000
index 000000000000..afec5c01e1e0
--- /dev/null
+++ b/srcpkgs/fcitx5-lua-devel
@@ -0,0 +1 @@
+fcitx5-lua
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-lua/template b/srcpkgs/fcitx5-lua/template
new file mode 100644
index 000000000000..30f51aa1c42e
--- /dev/null
+++ b/srcpkgs/fcitx5-lua/template
@@ -0,0 +1,33 @@
+# Template file for 'fcitx5-lua'
+pkgname=fcitx5-lua
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel lua53-devel"
+depends="fcitx5"
+checkdepends="fcitx5"
+short_desc="Lua scripting support for fcitx5"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://github.com/fcitx/fcitx5-lua"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-lua/fcitx5-lua-${version}.tar.xz"
+checksum=7c8899cb6f05074263e66b95a8717594f9d5c5c1e693bfe9cf4660bbba1f9336
+lib32disabled=yes
+
+pre_build() {
+	mkdir -p native
+	$CXX_FOR_BUILD $CXXFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD \
+		-o native/file2cstring src/file2cstring/file2cstring.cpp
+	PATH="${wrksrc}/native:$PATH"
+}
+
+fcitx5-lua-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 8aca97bf1f0e03baa30ff7bc1f6fb6c0da481746 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:02:20 +0700
Subject: [PATCH 07/29] New package: fcitx5-configtool-5.0.4

---
 srcpkgs/fcitx5-configtool/template | 30 ++++++++++++++++++++++++++++++
 srcpkgs/fcitx5-migrator            |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 srcpkgs/fcitx5-configtool/template
 create mode 120000 srcpkgs/fcitx5-migrator

diff --git a/srcpkgs/fcitx5-configtool/template b/srcpkgs/fcitx5-configtool/template
new file mode 100644
index 000000000000..15507872e601
--- /dev/null
+++ b/srcpkgs/fcitx5-configtool/template
@@ -0,0 +1,30 @@
+# Template file for 'fcitx5-configtool'
+pkgname=fcitx5-configtool
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="cldr-emoji-annotation pkg-config gettext doxygen
+ extra-cmake-modules glib-devel qt5-qmake qt5-host-tools xkeyboard-config
+ AppStream kcoreaddons"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libglib-devel qt5-devel qt5-x11extras-devel kitemviews-devel
+ qt5-quickcontrols2-devel qt5-declarative-devel kcoreaddons-devel
+ ki18n-devel kpackage-devel kdeclarative-devel kirigami2-devel
+ libxkbcommon-devel iso-codes libX11-devel libxkbfile-devel"
+short_desc="Fcitx v5 - config tool"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-configtool/fcitx5-configtool-${version}.tar.xz"
+checksum=1c835e236d013e84c88ff442332003fc69531191d4b3cbf54e85e29fc57d9d11
+lib32disabled=yes
+
+fcitx5-migrator_package() {
+	short_desc="${short_desc/config/migration}"
+	lib32disabled=yes
+	pkg_install() {
+		vmove usr/bin/fcitx5-migrator
+		vmove "usr/lib/libFcitx5Migrator.so*"
+		vmove usr/share/applications/org.fcitx.fcitx5-migrator.desktop
+	}
+}
diff --git a/srcpkgs/fcitx5-migrator b/srcpkgs/fcitx5-migrator
new file mode 120000
index 000000000000..e54fa5c62107
--- /dev/null
+++ b/srcpkgs/fcitx5-migrator
@@ -0,0 +1 @@
+fcitx5-configtool
\ No newline at end of file

From da924d6325febed7a32819d12702241882f87d94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 22 Mar 2021 22:25:14 +0700
Subject: [PATCH 08/29] New package: fcitx5-m17n-5.0.4

---
 srcpkgs/fcitx5-m17n/template | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 srcpkgs/fcitx5-m17n/template

diff --git a/srcpkgs/fcitx5-m17n/template b/srcpkgs/fcitx5-m17n/template
new file mode 100644
index 000000000000..597d193e3e00
--- /dev/null
+++ b/srcpkgs/fcitx5-m17n/template
@@ -0,0 +1,16 @@
+# Template file for 'fcitx5-m17n'
+pkgname=fcitx5-m17n
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel m17n-lib-devel"
+depends="m17n-db fcitx5"
+checkdepends="$depends"
+short_desc="Fcitx v5 - m17n engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-m17n/fcitx5-m17n-${version}.tar.xz"
+checksum=f687f3f398e5d4be34e3ec70962f009ad6b9eb9b1dc33f7c2a868aca6ba3c3c2
+lib32disabled=yes

From c0ba7a960029d6a132425f94e45fabfd73e55ef6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 18:02:57 +0700
Subject: [PATCH 09/29] New package: fcitx5-chewing-5.0.5

---
 srcpkgs/fcitx5-chewing-icons    |  1 +
 srcpkgs/fcitx5-chewing/template | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chewing-icons
 create mode 100644 srcpkgs/fcitx5-chewing/template

diff --git a/srcpkgs/fcitx5-chewing-icons b/srcpkgs/fcitx5-chewing-icons
new file mode 120000
index 000000000000..88c258a7ebb9
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing-icons
@@ -0,0 +1 @@
+fcitx5-chewing
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chewing/template b/srcpkgs/fcitx5-chewing/template
new file mode 100644
index 000000000000..83dadccc2b3a
--- /dev/null
+++ b/srcpkgs/fcitx5-chewing/template
@@ -0,0 +1,22 @@
+# Template file for 'fcitx5-chewing'
+pkgname=fcitx5-chewing
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules"
+makedepends="libfcitx5-devel fmt-devel libchewing-devel"
+short_desc="Fcitx5 - chewing engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chewing/fcitx5-chewing-${version}.tar.xz"
+checksum=9c2f208796198daa6c37d9918929f0301792c1611afbc14155ef4dd69d699163
+lib32disabled=yes
+
+fcitx5-chewing-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-chewing<=0.2.3_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 47ec934ebfdc774eac0f8fd9fba983070391076e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 23 Mar 2021 22:46:14 +0700
Subject: [PATCH 10/29] New package: libime-1.0.5

---
 common/shlibs            |  3 ++
 srcpkgs/libime-devel     |  1 +
 srcpkgs/libime-migration |  1 +
 srcpkgs/libime-utils     |  1 +
 srcpkgs/libime/template  | 64 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 70 insertions(+)
 create mode 120000 srcpkgs/libime-devel
 create mode 120000 srcpkgs/libime-migration
 create mode 120000 srcpkgs/libime-utils
 create mode 100644 srcpkgs/libime/template

diff --git a/common/shlibs b/common/shlibs
index 56f99f59a9bb..307d5c6df810 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3110,6 +3110,9 @@ libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
+libIMECore.so.0 libime-1.0.5_1
+libIMEPinyin.so.0 libime-1.0.5_1
+libIMETable.so.0 libime-1.0.5_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-devel b/srcpkgs/libime-devel
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-devel
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-migration b/srcpkgs/libime-migration
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-migration
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime-utils b/srcpkgs/libime-utils
new file mode 120000
index 000000000000..0e6317ec164c
--- /dev/null
+++ b/srcpkgs/libime-utils
@@ -0,0 +1 @@
+libime
\ No newline at end of file
diff --git a/srcpkgs/libime/template b/srcpkgs/libime/template
new file mode 100644
index 000000000000..dbc2fd35c7b2
--- /dev/null
+++ b/srcpkgs/libime/template
@@ -0,0 +1,64 @@
+# Template file for 'libime'
+pkgname=libime
+version=1.0.5
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3"
+makedepends="libfcitx5-devel boost-devel"
+short_desc="Library to support generic input method implementation"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_lm_sc_version=20140820
+_dict_version=20210302
+distfiles="https://download.fcitx-im.org/fcitx5/libime/libime-${version}.tar.xz
+ https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ https://download.fcitx-im.org/data/dict.utf8-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/table.tar.gz"
+checksum="212ea28dbca96372e67a31e4b70eb6c98528dcfd64d8b581074005d94fe5b254
+ 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+ cd43f97749f38e65fc1f706b981a3c1991599770268932dbb11b2ab90c087646
+ 6196053c724125e3ae3d8bd6b2f9172d0c83b65b0d410d3cde63b7a8d6ab87b7"
+skip_extraction="
+ lm_sc.3gm.arpa-${_lm_sc_version}.tar.bz2
+ dict.utf8-${_dict_version}.tar.xz
+ table.tar.gz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/${_file} data
+	done
+}
+
+post_install() {
+	sed -i '/INTERFACE_INCLUDE_DIRECTORIES/s,"/usr,"${_IMPORT_PREFIX},' \
+		"${DESTDIR}/usr/lib/cmake"/*/*Targets.cmake
+}
+
+libime-migration_package() {
+	short_desc+=" - migration tools"
+	pkg_install() {
+		vmove "usr/bin/libime_migrate_*"
+	}
+}
+
+libime-utils_package() {
+	short_desc+=" - utilities"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-devel_package() {
+	short_desc+=" - development files"
+	depends="boost-devel libime-utils>=${version}_${revision}
+	 libime>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove "usr/lib/*.so"
+	}
+}

From 5ce9ac8631381c292fdc4e5ac3ddbf2b67d67952 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:17:34 +0700
Subject: [PATCH 11/29] fcitx-chewing: use shared icons with fcitx5

---
 srcpkgs/fcitx-chewing/template | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/fcitx-chewing/template b/srcpkgs/fcitx-chewing/template
index 65c99624edfc..8f2c9c4ce432 100644
--- a/srcpkgs/fcitx-chewing/template
+++ b/srcpkgs/fcitx-chewing/template
@@ -1,13 +1,18 @@
 # Template file for 'fcitx-chewing'
 pkgname=fcitx-chewing
 version=0.2.3
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config"
 makedepends="fcitx-devel libchewing-devel"
+depends="fcitx5-chewing-icons"
 short_desc="Fcitx wrapper for Chewing IM engine"
 maintainer="Robert Stancil <robert.stancil@mavs.uta.edu>"
 license="GPL-2.0-only"
 homepage="https://www.fcitx-im.org/wiki/Chewing"
 distfiles="https://github.com/fcitx/fcitx-chewing/archive/${version}.tar.gz"
 checksum=ad20eb7b4911cdfb88224f4883d1778253e30180a84898dfcbf8ece36b1182fc
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 0a02178c51cd7c934fe3e0352c8de0e5436a661b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:32:12 +0700
Subject: [PATCH 12/29] New package: fcitx5-chinese-addons-5.0.5

---
 srcpkgs/fcitx5-chinese-addons-devel           |  1 +
 srcpkgs/fcitx5-chinese-addons-icons           |  1 +
 .../fcitx5-chinese-addons-pinyin-dict-manager |  1 +
 srcpkgs/fcitx5-chinese-addons/template        | 58 +++++++++++++++++++
 4 files changed, 61 insertions(+)
 create mode 120000 srcpkgs/fcitx5-chinese-addons-devel
 create mode 120000 srcpkgs/fcitx5-chinese-addons-icons
 create mode 120000 srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
 create mode 100644 srcpkgs/fcitx5-chinese-addons/template

diff --git a/srcpkgs/fcitx5-chinese-addons-devel b/srcpkgs/fcitx5-chinese-addons-devel
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-devel
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-icons b/srcpkgs/fcitx5-chinese-addons-icons
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-icons
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager b/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
new file mode 120000
index 000000000000..20d63bef8026
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons-pinyin-dict-manager
@@ -0,0 +1 @@
+fcitx5-chinese-addons
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-chinese-addons/template b/srcpkgs/fcitx5-chinese-addons/template
new file mode 100644
index 000000000000..a37a025d7af0
--- /dev/null
+++ b/srcpkgs/fcitx5-chinese-addons/template
@@ -0,0 +1,58 @@
+# Template file for 'fcitx5-chinese-addons'
+pkgname=fcitx5-chinese-addons
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules qt5-qmake
+ qt5-host-tools libime-utils"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libcurl-devel qt5-webkit-devel boost-devel libime-devel fcitx5-qt5-devel"
+depends="fcitx5-chinese-addons-icons"
+short_desc="Fcitx5 - Chinese related addon"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later, LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_pytable_version=20121124
+_pystroke_version=20121124
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-${version}.tar.xz
+ http://download.fcitx-im.org/data/py_table-${_pytable_version}.tar.gz
+ http://download.fcitx-im.org/data/py_stroke-${_pystroke_version}.tar.gz"
+checksum="7917c29643d0bfe489cda2f75201059b8e52cc3c06f86b3059ee0844b33a2048
+ 42146ac97de6c13d55f9e99ed873915f4c66739e9c11532a34556badf9792c04
+ 8eb128a9bfa43952e67cf2fcee1fd134c6f4cfd317bc2f6c38a615f5eb64e248"
+skip_extraction="
+ py_table-${_pytable_version}.tar.gz
+ py_stroke-${_pystroke_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file modules/pinyinhelper
+	done
+}
+
+fcitx5-chinese-addons-icons_package() {
+	short_desc+=" - icons"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}
+
+fcitx5-chinese-addons-pinyin-dict-manager_package() {
+	short_desc+=" - Pinyin Dictionaries Manager"
+	depends="fcitx5-chinese-addons>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}
+
+fcitx5-chinese-addons-devel_package() {
+	short_desc+=" - development files"
+	depends="fcitx5-chinese-addons>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+	}
+}

From 5cdc5817d74e901fe8f0e28ca788abb97a12a6ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 18:21:50 +0700
Subject: [PATCH 13/29] fcitx: use shared icons with fcitx5

---
 srcpkgs/fcitx/template | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx/template b/srcpkgs/fcitx/template
index 8163dee0ca5e..00675b1fedc0 100644
--- a/srcpkgs/fcitx/template
+++ b/srcpkgs/fcitx/template
@@ -1,7 +1,7 @@
 # Template file for 'fcitx'
 pkgname=fcitx
 version=4.2.9.8
-revision=3
+revision=4
 build_style=cmake
 build_helper=gir
 short_desc="Flexible Context-aware Input Tool with eXtension"
@@ -15,6 +15,7 @@ hostmakedepends="pkg-config doxygen extra-cmake-modules glib-devel"
 makedepends="iso-codes gettext-devel enchant-devel libxml2-devel
  json-c-devel opencc-devel
  libxkbfile-devel icu-devel dbus-devel gtk+-devel gtk+3-devel"
+depends="fcitx5-icons fcitx5-chinese-addons-icons"
 lib32disabled=yes
 configure_args="-DCMAKE_BUILD_TYPE=None
  -DSYSCONFDIR=/etc -DFORCE_OPENCC=OFF -DFORCE_PRESAGE=OFF
@@ -54,6 +55,14 @@ pre_build() {
 	LDFLAGS+=" -Wl,--rpath-link=$wrksrc/build/src/lib/fcitx-utils"
 }
 
+post_install() {
+	find $DESTDIR/usr/share/icons -depth \
+		-name 'fcitx-kbd.*' -prune -o \
+		-name 'fcitx-vk-active.*' -prune -o \
+		-name 'fcitx-vk-inactive.*' -prune -o \
+		-type f -delete
+}
+
 libfcitx_package() {
 	short_desc+=" - shared libraries"
 	pkg_install() {
@@ -68,7 +77,7 @@ libfcitx_package() {
 	}
 }
 fcitx-devel_package() {
-	depends="libfcitx-${version}_${revision} glib-devel"
+	depends="libfcitx>=${version}_${revision} glib-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/bin/fcitx4-config

From 7c30a5be4fdb9ce05e18b87be2372628f1d9c6c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 19:41:51 +0700
Subject: [PATCH 14/29] New package: libime-jyutping-1.0.2

---
 common/shlibs                    |  1 +
 srcpkgs/libime-jyutping-devel    |  1 +
 srcpkgs/libime-jyutping-tools    |  1 +
 srcpkgs/libime-jyutping/template | 47 ++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 120000 srcpkgs/libime-jyutping-devel
 create mode 120000 srcpkgs/libime-jyutping-tools
 create mode 100644 srcpkgs/libime-jyutping/template

diff --git a/common/shlibs b/common/shlibs
index 307d5c6df810..a4d889e0dce2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3113,6 +3113,7 @@ librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
 libIMEPinyin.so.0 libime-1.0.5_1
 libIMETable.so.0 libime-1.0.5_1
+libIMEJyutping.so.1 libime-jyutping-1.0.2_1
 libairspy.so.0 libairspy-1.0.9_1
 libKF5KDcraw.so.5 libkdcraw5-17.04.3_1
 libKF5Kipi.so.32.0.0 libkipi5-17.04.3_1
diff --git a/srcpkgs/libime-jyutping-devel b/srcpkgs/libime-jyutping-devel
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-devel
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping-tools b/srcpkgs/libime-jyutping-tools
new file mode 120000
index 000000000000..6f00a5aa5460
--- /dev/null
+++ b/srcpkgs/libime-jyutping-tools
@@ -0,0 +1 @@
+libime-jyutping
\ No newline at end of file
diff --git a/srcpkgs/libime-jyutping/template b/srcpkgs/libime-jyutping/template
new file mode 100644
index 000000000000..46a5ad944e88
--- /dev/null
+++ b/srcpkgs/libime-jyutping/template
@@ -0,0 +1,47 @@
+# Template file for 'libime-jyutping'
+pkgname=libime-jyutping
+version=1.0.2
+revision=1
+build_style=cmake
+build_helper=qemu
+hostmakedepends="pkg-config gettext extra-cmake-modules python3 libime-utils"
+makedepends="libfcitx5-devel boost-devel libime-devel
+ fcitx5-chinese-addons-devel fmt-devel"
+short_desc="Libraries for jyutping 粵拼 by libime"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_dict_version=20180104
+_model_version=20180103
+distfiles="https://download.fcitx-im.org/fcitx5/libime-jyutping/libime-jyutping-${version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-dict-${_dict_version}.tar.xz
+ https://download.fcitx-im.org/data/jyutping-model-${_model_version}.tar.xz"
+checksum="8e948b4d1a1c1586c7e7c2b61e2d4d3d4e83996a791ef685388bed6f681433b3
+ e3a5b13edb8efa2f764245a3232f99ba7e7670e22b8cbe666a4fffa84b35f35b
+ 4f07229e2080f0ee30ce51b016409f260af82a58dd406a01ea5981b59ca87071"
+skip_extraction="jyutping-dict-${_dict_version}.tar.xz
+ jyutping-model-${_model_version}.tar.xz"
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	local _file
+	for _file in ${skip_extraction}; do
+		cp ${_srcdistdir}/$_file data
+	done
+}
+
+libime-jyutping-tools_package() {
+	short_desc+=" - tools"
+	pkg_install() {
+		vmove usr/bin
+	}
+}
+
+libime-jyutping-devel_package() {
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/lib/cmake
+	}
+}

From 724c982084cc3de66259bba2813c673e7b9dc467 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 20:18:25 +0700
Subject: [PATCH 15/29] libpinyin: split libzhuyin

---
 common/shlibs                  |  1 +
 srcpkgs/libpinyin-common       |  1 +
 srcpkgs/libpinyin-common-devel |  1 +
 srcpkgs/libpinyin-utils        |  1 +
 srcpkgs/libpinyin/template     | 58 ++++++++++++++++++++++++++++++----
 srcpkgs/libzhuyin              |  1 +
 srcpkgs/libzhuyin-devel        |  1 +
 7 files changed, 57 insertions(+), 7 deletions(-)
 create mode 120000 srcpkgs/libpinyin-common
 create mode 120000 srcpkgs/libpinyin-common-devel
 create mode 120000 srcpkgs/libpinyin-utils
 create mode 120000 srcpkgs/libzhuyin
 create mode 120000 srcpkgs/libzhuyin-devel

diff --git a/common/shlibs b/common/shlibs
index a4d889e0dce2..f923351ba0d3 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3541,6 +3541,7 @@ libcaf_openssl.so.0.18.0 zeek-4.0.0_1
 libbinpac.so.0 zeek-3.2.4_2
 libllhttp.so.1 llhttp-1.0.1_1
 libpinyin.so.13 libpinyin-2.2.1_1
+libzhuyin.so.13 libzhuyin-2.6.0_3
 libuhd.so.4.0.0 uhd-4.0.0.0_1
 libeditline.so.1 editline-1.16.0_1
 libgnuradio-rds.so.1 gnuradio-rds-3.8.0_1
diff --git a/srcpkgs/libpinyin-common b/srcpkgs/libpinyin-common
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-common-devel b/srcpkgs/libpinyin-common-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-common-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin-utils b/srcpkgs/libpinyin-utils
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libpinyin-utils
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libpinyin/template b/srcpkgs/libpinyin/template
index 7d141b6a086b..31811cac10f6 100644
--- a/srcpkgs/libpinyin/template
+++ b/srcpkgs/libpinyin/template
@@ -1,12 +1,13 @@
 # Template file for 'libpinyin'
 pkgname=libpinyin
 version=2.6.0
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--enable-libzhuyin"
 hostmakedepends="intltool libtool pkg-config autoconf-archive autoconf automake"
 makedepends="db-devel libglib-devel"
-short_desc="Support library for PinYin and ZhuYin (Bopofomo)"
+depends="libpinyin-common>=${version}_${revision}"
+short_desc="Support library for PinYin"
 maintainer="Ben Sung Hsu <pobetiger+github@gmail.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/libpinyin/libpinyin"
@@ -26,13 +27,56 @@ pre_configure() {
 	NOCONFIGURE=1 ./autogen.sh
 }
 
+libpinyin-common_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/lib/libpinyin
+	}
+}
+
+libzhuyin_package() {
+	short_desc="${short_desc/PinYin/ZhuYin}"
+	depends="libpinyin-common>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libzhuyin.so.*"
+	}
+}
+
+libpinyin-utils_package() {
+	short_desc="Support utilities for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/man/man1
+	}
+}
+
+libpinyin-common-devel_package() {
+	short_desc="Common files for libpinyin and libzhuyin"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/novel*"
+	}
+}
+
 libpinyin-devel_package() {
-	depends="libglib-devel libpinyin-${version}_${revision}"
+	depends="libglib-devel libpinyin-${version}_${revision}
+	 libpinyin-common-devel-${version}_${revision}"
 	short_desc+=" - development files"
 	pkg_install() {
-		vmove usr/include
-		vmove usr/lib/pkgconfig
-		vmove "usr/lib/*.so"
-		vmove "usr/lib/*.a"
+		vmove "usr/include/libpinyin-2.6.0/pinyin*"
+		vmove usr/lib/pkgconfig/libpinyin.pc
+		vmove "usr/lib/libpinyin.so"
+		vmove "usr/lib/libpinyin.a"
+	}
+}
+
+libzhuyin-devel_package() {
+	depends="libglib-devel libzhuyin-${version}_${revision}
+	 libpinyin-devel-${version}_${revision}"
+	short_desc="${short_desc/PinYin/ZhuYin} - development files"
+	pkg_install() {
+		vmove "usr/include/libpinyin-2.6.0/zhuyin*"
+		vmove usr/lib/pkgconfig/libzhuyin.pc
+		vmove usr/lib/libzhuyin.a
+		vmove usr/lib/libzhuyin.so
 	}
 }
diff --git a/srcpkgs/libzhuyin b/srcpkgs/libzhuyin
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file
diff --git a/srcpkgs/libzhuyin-devel b/srcpkgs/libzhuyin-devel
new file mode 120000
index 000000000000..b9910dce3c19
--- /dev/null
+++ b/srcpkgs/libzhuyin-devel
@@ -0,0 +1 @@
+libpinyin
\ No newline at end of file

From f8933d9810682d4ae213861d1b6ca87717e0639e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 25 Mar 2021 22:34:18 +0700
Subject: [PATCH 16/29] New package: fcitx5-zhuyin-5.0.4

---
 srcpkgs/fcitx5-zhuyin/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/fcitx5-zhuyin/template

diff --git a/srcpkgs/fcitx5-zhuyin/template b/srcpkgs/fcitx5-zhuyin/template
new file mode 100644
index 000000000000..4e55fb1bec5d
--- /dev/null
+++ b/srcpkgs/fcitx5-zhuyin/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-zhuyin'
+pkgname=fcitx5-zhuyin
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext doxygen extra-cmake-modules libzhuyin"
+makedepends="libfcitx5-devel fmt-devel opencc-devel fcitx5-lua-devel
+ libzhuyin-devel libpinyin-utils"
+short_desc="Fcitx5 - zhuyin IME"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+_model_version=20161206
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-zhuyin/fcitx5-zhuyin-${version}.tar.xz
+ https://download.fcitx-im.org/data/model.text.${_model_version}.tar.gz"
+checksum="3b692408bcbd816fec84c7ad73ec4e4816b686a072eb9d671aaa8be079fc3728
+ 5c7024e5735389c471f54b867eda0d98c5a40a5e5e75333a9febac107508f704"
+skip_extraction="model.text.${_model_version}.tar.gz"
+lib32disabled=yes
+
+post_extract() {
+	local _srcdistdir=${XBPS_SRCDISTDIR}/${pkgname}-${version}
+	cp ${_srcdistdir}/$skip_extraction data
+}

From 2ece326f585c9fc34b8ef9183a2177066e887748 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:19:17 +0700
Subject: [PATCH 17/29] New package: fcitx5-table-extra-5.0.3

---
 srcpkgs/fcitx5-table-extra/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-extra/template

diff --git a/srcpkgs/fcitx5-table-extra/template b/srcpkgs/fcitx5-table-extra/template
new file mode 100644
index 000000000000..200b8eec5d5c
--- /dev/null
+++ b/srcpkgs/fcitx5-table-extra/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-extra'
+pkgname=fcitx5-table-extra
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Boshiamy, Zhengma, Cangjie, and Quick table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="Public Domain"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-extra/fcitx5-table-extra-${version}.tar.xz"
+checksum=2cecbd235623cb803befb3550d5b520f972f5b3ea8044c27d3786e5d59e3fb5d

From 9cf0de7d6b5728357a5559f73561d4ecccf5d297 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:31:31 +0700
Subject: [PATCH 18/29] New package: fcitx5-table-other-5.0.4

---
 srcpkgs/fcitx5-table-other/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/fcitx5-table-other/template

diff --git a/srcpkgs/fcitx5-table-other/template b/srcpkgs/fcitx5-table-other/template
new file mode 100644
index 000000000000..6ba05d834a23
--- /dev/null
+++ b/srcpkgs/fcitx5-table-other/template
@@ -0,0 +1,14 @@
+# Template file for 'fcitx5-table-other'
+pkgname=fcitx5-table-other
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="gettext libime-utils extra-cmake-modules"
+makedepends="libfcitx5-devel libime-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - non-Chinese table"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-table-other/fcitx5-table-other-${version}.tar.xz"
+checksum=a0f6747ad78cd5d113cdcb14d56d11579ba1b425741a532a6b904042be176b41

From af1c4bce3c18bc2478db82b86eddf66068c5403c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:14 +0700
Subject: [PATCH 19/29] New package: fcitx5-hangul-5.0.3

---
 srcpkgs/fcitx5-hangul-icons    |  1 +
 srcpkgs/fcitx5-hangul/template | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 120000 srcpkgs/fcitx5-hangul-icons
 create mode 100644 srcpkgs/fcitx5-hangul/template

diff --git a/srcpkgs/fcitx5-hangul-icons b/srcpkgs/fcitx5-hangul-icons
new file mode 120000
index 000000000000..aeca5d0f662c
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul-icons
@@ -0,0 +1 @@
+fcitx5-hangul
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-hangul/template b/srcpkgs/fcitx5-hangul/template
new file mode 100644
index 000000000000..0e8116ae535d
--- /dev/null
+++ b/srcpkgs/fcitx5-hangul/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-hangul'
+pkgname=fcitx5-hangul
+version=5.0.3
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="libhangul-devel libfcitx5-devel"
+depends="fcitx5-hangul-icons"
+short_desc="Fcitx5 - Hangul support"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-hangul/fcitx5-hangul-${version}.tar.xz"
+checksum=e02d3d59e22a60e65099eaa0e5e394481a770a401c83b9979f754678c100f1e6
+lib32disabled=yes
+
+fcitx5-hangul-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-hangul<=0.3.1_1"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From 453351a83f916fd37609552e517abff6631b2f0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Fri, 26 Mar 2021 18:39:25 +0700
Subject: [PATCH 20/29] fcitx-hangul: use shared icons with fcitx5

---
 srcpkgs/fcitx-hangul/template | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/fcitx-hangul/template b/srcpkgs/fcitx-hangul/template
index 3c65ec6a5f4e..d1b50e2d6237 100644
--- a/srcpkgs/fcitx-hangul/template
+++ b/srcpkgs/fcitx-hangul/template
@@ -1,15 +1,20 @@
 # Template file for 'fcitx-hangul'
 pkgname=fcitx-hangul
 version=0.3.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="intltool pkg-config libfcitx"
 makedepends="libhangul-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-hangul-icons"
 short_desc="Hangul (Korean) support for fcitx"
-homepage="https://github.com/fcitx/fcitx-hangul"
+maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-only"
+homepage="https://github.com/fcitx/fcitx-hangul"
 distfiles="https://download.fcitx-im.org/fcitx-hangul/fcitx-hangul-${version}.tar.xz"
 checksum=6dd5fd5956924c85af92ebefaef1e113e38fa814355fbb0f07c26049c3014437
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 822df4a6a804eb8ce1ec6852e14d8562c39cc00e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 18:42:50 +0700
Subject: [PATCH 21/29] New package: anthy-unicode-1.0.0.20201109

---
 common/shlibs                  |  3 +++
 srcpkgs/anthy-unicode-devel    |  1 +
 srcpkgs/anthy-unicode/template | 37 ++++++++++++++++++++++++++++++++++
 srcpkgs/libanthy-unicode       |  1 +
 4 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/anthy-unicode-devel
 create mode 100644 srcpkgs/anthy-unicode/template
 create mode 120000 srcpkgs/libanthy-unicode

diff --git a/common/shlibs b/common/shlibs
index f923351ba0d3..7d6f80737c85 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2334,6 +2334,9 @@ liboath.so.0 oath-toolkit-2.6.0_2
 libanthy.so.1 libanthy-0.4_1
 libanthydic.so.1 libanthy-0.4_1
 libanthyinput.so.0 libanthy-0.4_1
+libanthy-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthydic-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
+libanthyinput-unicode.so.0 libanthy-unicode-1.0.0.20201109_1
 libanthygobject-1.0.so.5 ibus-anthy-1.5.6_1
 libtbbmalloc_proxy_debug.so.2 tbb-4.3_1
 libtbbmalloc_proxy.so.2 tbb-4.3_1
diff --git a/srcpkgs/anthy-unicode-devel b/srcpkgs/anthy-unicode-devel
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/anthy-unicode-devel
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file
diff --git a/srcpkgs/anthy-unicode/template b/srcpkgs/anthy-unicode/template
new file mode 100644
index 000000000000..f7c4ae32a5bb
--- /dev/null
+++ b/srcpkgs/anthy-unicode/template
@@ -0,0 +1,37 @@
+# Template file for 'anthy-unicode'
+pkgname=anthy-unicode
+version=1.0.0.20201109
+revision=1
+build_style=gnu-configure
+configure_args="--disable-static"
+short_desc="Japanese character set input library for Unicode"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.0-or-later, GPL-2.0-only, Public Domain"
+homepage="https://github.com/fujiwarat/anthy-unicode/wiki"
+distfiles="https://github.com/fujiwarat/anthy-unicode/releases/download/${version}/${pkgname}-${version}.tar.gz"
+checksum=7d595bd422222bd67d7944f0c29f7d739fe677e4b885de3d4f0dae417b674381
+nocross='execute lt-mkdepgraph'
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/*.la
+}
+
+libanthy-unicode_package() {
+	short_desc+=" - libraries"
+	conf_files="/etc/anthy-unicode.conf"
+	pkg_install() {
+		vmove etc/anthy-unicode.conf
+		vmove "usr/lib/*.so.*"
+		vmove usr/share
+	}
+}
+
+anthy-unicode-devel_package() {
+	short_desc+=" - development files"
+	depends="libanthy-unicode-${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}
diff --git a/srcpkgs/libanthy-unicode b/srcpkgs/libanthy-unicode
new file mode 120000
index 000000000000..db3b51372104
--- /dev/null
+++ b/srcpkgs/libanthy-unicode
@@ -0,0 +1 @@
+anthy-unicode
\ No newline at end of file

From cf300fda778c46669641fd49c1ac11235e899880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:38 +0700
Subject: [PATCH 22/29] New package: fcitx5-anthy-5.0.4

---
 srcpkgs/fcitx5-anthy-icons                    |  1 +
 .../fcitx5-anthy/patches/fix-build-musl.patch | 18 +++++++++++++++
 srcpkgs/fcitx5-anthy/template                 | 23 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 120000 srcpkgs/fcitx5-anthy-icons
 create mode 100644 srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
 create mode 100644 srcpkgs/fcitx5-anthy/template

diff --git a/srcpkgs/fcitx5-anthy-icons b/srcpkgs/fcitx5-anthy-icons
new file mode 120000
index 000000000000..6fee45a4d396
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy-icons
@@ -0,0 +1 @@
+fcitx5-anthy
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
new file mode 100644
index 000000000000..bc19b7c5c406
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/patches/fix-build-musl.patch
@@ -0,0 +1,18 @@
+Index: fcitx5-anthy-5.0.4/src/utils.h
+===================================================================
+--- fcitx5-anthy-5.0.4.orig/src/utils.h
++++ fcitx5-anthy-5.0.4/src/utils.h
+@@ -28,11 +28,11 @@ bool key_is_keypad(const fcitx::Key &key
+ std::string keypad_to_string(const fcitx::KeyEvent &key);
+ void launch_program(std::string command);
+ 
+-bool surrounding_get_safe_delta(uint from, uint to, int32_t *delta);
++bool surrounding_get_safe_delta(unsigned from, unsigned to, int32_t *delta);
+ 
+ bool surrounding_get_anchor_pos_from_selection(
+     const std::string &surrounding_text, const std::string &selected_text,
+-    uint cursor_pos, uint *anchor_pos);
++    unsigned cursor_pos, unsigned *anchor_pos);
+ 
+ inline char get_ascii_code(const fcitx::Key &key) {
+     auto chr = fcitx::Key::keySymToUnicode(key.sym());
diff --git a/srcpkgs/fcitx5-anthy/template b/srcpkgs/fcitx5-anthy/template
new file mode 100644
index 000000000000..a2bec24b3080
--- /dev/null
+++ b/srcpkgs/fcitx5-anthy/template
@@ -0,0 +1,23 @@
+# Template file for 'fcitx5-anthy'
+pkgname=fcitx5-anthy
+version=5.0.4
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules"
+makedepends="anthy-unicode-devel libfcitx5-devel"
+depends="fcitx5"
+short_desc="Fcitx5 - Anthy engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-anthy/fcitx5-anthy-${version}.tar.xz"
+checksum=6e15c0e32508db3e6b233efb99677a7b4b4478950a57bb76bd509355276b9636
+patch_args=-Np1
+
+fcitx5-anthy-icons_package() {
+	short_desc+=" - icons"
+	conflicts="fcitx-anthy<=0.2.3_2"
+	pkg_install() {
+		vmove usr/share/icons
+	}
+}

From fd8a2ea3e74108473d9a03a9d82c53ff7e805ef3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 20:03:31 +0700
Subject: [PATCH 23/29] fcitx-anthy: use shared icons with fcitx5

---
 srcpkgs/fcitx-anthy/template | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/fcitx-anthy/template b/srcpkgs/fcitx-anthy/template
index d03499e83c3e..053db036dec4 100644
--- a/srcpkgs/fcitx-anthy/template
+++ b/srcpkgs/fcitx-anthy/template
@@ -1,10 +1,10 @@
 # Template file for 'fcitx-anthy'
 pkgname=fcitx-anthy
 version=0.2.3
-revision=2
+revision=3
 build_style=cmake
 makedepends="anthy-devel fcitx-devel"
-depends="fcitx>=4.2.9"
+depends="fcitx>=4.2.9 fcitx5-anthy-icons"
 short_desc="Fcitx wrapper for Anthy IM engine"
 maintainer="Matthias von Faber <mvf@gmx.eu>"
 license="GPL-2.0-or-later"
@@ -13,3 +13,7 @@ distfiles="https://github.com/fcitx/fcitx-anthy/archive/${version}.tar.gz"
 checksum=31826a49a7ff743f830e1279527301abce9e669bc176934c76775999299421a8
 
 CXXFLAGS='-D_GNU_SOURCE'
+
+post_install() {
+	rm -rf ${DESTDIR}/usr/share/icons
+}

From 417a18a383629bc3df4205e0cce46fc6cc641a0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 28 Mar 2021 22:03:06 +0700
Subject: [PATCH 24/29] marisa: build python3 bindings

---
 srcpkgs/marisa/template | 41 +++++++++++++++++++++++++++++++++++++++--
 srcpkgs/python3-marisa  |  1 +
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 120000 srcpkgs/python3-marisa

diff --git a/srcpkgs/marisa/template b/srcpkgs/marisa/template
index 2aebc8712f5b..95e0403a7fef 100644
--- a/srcpkgs/marisa/template
+++ b/srcpkgs/marisa/template
@@ -1,10 +1,11 @@
 # Template file for 'marisa'
 pkgname=marisa
 version=0.2.6
-revision=1
+revision=2
 wrksrc="${pkgname}-trie-$version"
 build_style=gnu-configure
-hostmakedepends="autoconf automake libtool"
+hostmakedepends="autoconf automake libtool python3-setuptools swig"
+makedepends="python3-devel"
 short_desc="Matching Algorithm with Recursively Implemented StorAge"
 maintainer="Yuxuan Shui <yshuiv7@gmail.com>"
 license="BSD-2-Clause, LGPL-2.1-or-later"
@@ -16,14 +17,50 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64*) configure_args+=" --enable-popcnt --enable-sse2";;
 esac
 
+CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+CXXFLAGS="$CFLAGS"
+LDFLAGS="-L${XBPS_CROSS_BASE}/${py3_lib}"
+
+_python_env() {
+	local f
+	CFLAGS+=" -I${wrksrc}/include"
+	LDFLAGS+=" -L${wrksrc}/lib/marisa/.libs"
+	export PYPREFIX="${XBPS_CROSS_BASE}"
+	export LDSHARED="${CXX} -shared ${LDFLAGS}"
+	export PYTHONPATH=${XBPS_CROSS_BASE}/${py3_lib}
+	for f in ${XBPS_CROSS_BASE}/${py3_lib}/_sysconfigdata_*; do
+		f=${f##*/}
+		export _PYTHON_SYSCONFIGDATA_NAME=${f%.py}
+	done
+}
+
 pre_configure() {
 	autoreconf -fi
 }
 
+post_build() {
+	make -C bindings
+	cd ${wrksrc}/bindings/python
+	_python_env
+	python3 setup.py build
+	cd ${wrksrc}
+}
+
 post_install() {
 	vlicense COPYING.md
 }
 
+python3-marisa_package() {
+	short_desc+=" - Python 3 bindings"
+	depends="python3"
+	pkg_install() {
+		cd ${wrksrc}/bindings/python
+		_python_env
+		python3 setup.py install --root=${PKGDESTDIR} --prefix=/usr
+		cd ${wrksrc}
+	}
+}
+
 marisa-devel_package() {
 	depends="marisa-${version}_${revision}"
 	short_desc+=" - development files"
diff --git a/srcpkgs/python3-marisa b/srcpkgs/python3-marisa
new file mode 120000
index 000000000000..4ebb55bc8b9f
--- /dev/null
+++ b/srcpkgs/python3-marisa
@@ -0,0 +1 @@
+marisa
\ No newline at end of file

From e5fae14d878938fdb1d9a51a1811456f446d2f5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:49:25 +0700
Subject: [PATCH 25/29] New package: libkkc-data-0.2.7

---
 srcpkgs/libkkc-data/patches/python3.patch | 138 ++++++++++++++++++++++
 srcpkgs/libkkc-data/template              |  14 +++
 2 files changed, 152 insertions(+)
 create mode 100644 srcpkgs/libkkc-data/patches/python3.patch
 create mode 100644 srcpkgs/libkkc-data/template

diff --git a/srcpkgs/libkkc-data/patches/python3.patch b/srcpkgs/libkkc-data/patches/python3.patch
new file mode 100644
index 000000000000..70bfdcc0d372
--- /dev/null
+++ b/srcpkgs/libkkc-data/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ taken from libkkc
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/tools/genfilter.py b/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/tools/genfilter.py
++++ b/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+index a0dd8fe..40f0837 100644
+--- a/tools/sortlm.py
++++ b/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc-data/template b/srcpkgs/libkkc-data/template
new file mode 100644
index 000000000000..ffbfa76c4247
--- /dev/null
+++ b/srcpkgs/libkkc-data/template
@@ -0,0 +1,14 @@
+# Template file for 'libkkc-data'
+pkgname=libkkc-data
+_libkkc_version=0.3.5
+version=0.2.7
+revision=1
+build_style=gnu-configure
+hostmakedepends="python3-marisa"
+short_desc="Japanese Kana Kanji conversion input method library - data"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${_libkkc_version}/libkkc-data-${version}.tar.xz"
+checksum=9e678755a030043da68e37a4049aa296c296869ff1fb9e6c70026b2541595b99
+patch_args=-Np1

From 177a8387c24dd6fc0e659e214ace97dba5bbb329 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 21:24:13 +0700
Subject: [PATCH 26/29] New package: libkkc-0.3.5

---
 common/shlibs                              |   1 +
 srcpkgs/libkkc-devel                       |   1 +
 srcpkgs/libkkc-utils                       |   1 +
 srcpkgs/libkkc/patches/musl-locale.patch   |  13 ++
 srcpkgs/libkkc/patches/no-ssp-static.patch |  13 ++
 srcpkgs/libkkc/patches/python3.patch       | 138 +++++++++++++++++++++
 srcpkgs/libkkc/template                    |  46 +++++++
 7 files changed, 213 insertions(+)
 create mode 120000 srcpkgs/libkkc-devel
 create mode 120000 srcpkgs/libkkc-utils
 create mode 100644 srcpkgs/libkkc/patches/musl-locale.patch
 create mode 100644 srcpkgs/libkkc/patches/no-ssp-static.patch
 create mode 100644 srcpkgs/libkkc/patches/python3.patch
 create mode 100644 srcpkgs/libkkc/template

diff --git a/common/shlibs b/common/shlibs
index 7d6f80737c85..f71d08678991 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3111,6 +3111,7 @@ libopenglrecorder.so.0 libopenglrecorder-0.1.0_1
 libgpod.so.4 libgpod-0.8.3_1
 libi2c.so.0 i2c-tools-4.0_1
 libmarisa.so.0 marisa-0.2.5_1
+libkkc.so.2 libkkc-0.3.5_1
 libopencc.so.1.1 opencc-1.1.1_1
 librime.so.1 librime-1.2.9_1
 libIMECore.so.0 libime-1.0.5_1
diff --git a/srcpkgs/libkkc-devel b/srcpkgs/libkkc-devel
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-devel
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc-utils b/srcpkgs/libkkc-utils
new file mode 120000
index 000000000000..9ea4317c5dca
--- /dev/null
+++ b/srcpkgs/libkkc-utils
@@ -0,0 +1 @@
+libkkc
\ No newline at end of file
diff --git a/srcpkgs/libkkc/patches/musl-locale.patch b/srcpkgs/libkkc/patches/musl-locale.patch
new file mode 100644
index 000000000000..5ae9e6eb2c7e
--- /dev/null
+++ b/srcpkgs/libkkc/patches/musl-locale.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -6710,7 +6710,7 @@ fi
+ 
+     ;;
+     *)
+-    DATADIRNAME=lib
++    DATADIRNAME=share
+     ;;
+     esac
+ fi
diff --git a/srcpkgs/libkkc/patches/no-ssp-static.patch b/srcpkgs/libkkc/patches/no-ssp-static.patch
new file mode 100644
index 000000000000..ea5013582061
--- /dev/null
+++ b/srcpkgs/libkkc/patches/no-ssp-static.patch
@@ -0,0 +1,13 @@
+Index: libkkc-0.3.5/configure
+===================================================================
+--- libkkc-0.3.5.orig/configure
++++ libkkc-0.3.5/configure
+@@ -18480,7 +18480,7 @@ $as_echo "yes" >&6; }
+ fi
+ 
+ # libstdc++ needs to be linked with libmarisa-glib.a
+-MARISA_GLIB_STATIC_DEPENDENCIES="$postdeps_CXX"
++MARISA_GLIB_STATIC_DEPENDENCIES="-lstdc++"
+ 
+ 
+ LIBKKC_CFLAGS="$GIO_CFLAGS $GEE_CFLAGS $JSON_GLIB_CFLAGS"
diff --git a/srcpkgs/libkkc/patches/python3.patch b/srcpkgs/libkkc/patches/python3.patch
new file mode 100644
index 000000000000..91d3f6956e88
--- /dev/null
+++ b/srcpkgs/libkkc/patches/python3.patch
@@ -0,0 +1,138 @@
+From ba1c1bd3eb86d887fc3689c3142732658071b5f7 Mon Sep 17 00:00:00 2001
+From: Takao Fujiwara <tfujiwar@redhat.com>
+Date: Mon, 30 Jul 2018 15:26:37 +0900
+Subject: [PATCH] build: Enable python3
+
+---
+ data/templates/libkkc-data/tools/genfilter.py | 18 +++++++--------
+ data/templates/libkkc-data/tools/sortlm.py    | 23 ++++++++-----------
+ 2 files changed, 19 insertions(+), 22 deletions(-)
+
+diff --git a/data/templates/libkkc-data/tools/genfilter.py b/data/templates/libkkc-data/tools/genfilter.py
+index 5ffab32..0c5f75a 100644
+--- a/data/templates/libkkc-data/tools/genfilter.py
++++ b/data/templates/libkkc-data/tools/genfilter.py
+@@ -84,24 +84,24 @@ def __init__(self, infile, outfile, record_size):
+ 
+     def generate(self):
+         size = os.fstat(self.infile.fileno()).st_size
+-        n = size / self.record_size
++        n = size // self.record_size
+         m = int(math.ceil(-n*math.log10(ERROR_RATE) /
+                           math.pow(math.log10(2), 2)))
+-        m = (m/8 + 1)*8
++        m = (m//8 + 1)*8
+         inmem = mmap.mmap(self.infile.fileno(),
+                           size,
+                           access=mmap.ACCESS_READ)
+-        outmem = bytearray(m/8)
+-        for i in xrange(0, n):
++        outmem = bytearray(m//8)
++        for i in range(0, n):
+             offset = i*self.record_size
+             b0, b1 = struct.unpack("=LL", inmem[offset:offset+8])
+-            for k in xrange(0, 4):
++            for k in range(0, 4):
+                 h = murmur_hash3_32(b0, b1, k)
+                 h = int(h * (m / float(0xFFFFFFFF)))
+-                outmem[h/8] |= (1 << (h%8))
++                outmem[h//8] |= (1 << (h%8))
+         inmem.close()
+-        # Convert bytearray to str, for Python 2.6 compatibility.
+-        self.outfile.write(str(outmem))
++        # Convert bytearray to bytes, for Python 3 compatibility.
++        self.outfile.write(bytes(outmem))
+ 
+ if __name__ == '__main__':
+     import sys
+@@ -110,7 +110,7 @@ def generate(self):
+     parser = argparse.ArgumentParser(description='filter')
+     parser.add_argument('infile', type=argparse.FileType('r'),
+                         help='input file')
+-    parser.add_argument('outfile', type=argparse.FileType('w'),
++    parser.add_argument('outfile', type=argparse.FileType('wb'),
+                         help='output file')
+     parser.add_argument('record_size', type=int,
+                         help='record size')
+diff --git a/data/templates/libkkc-data/tools/sortlm.py b/data/templates/libkkc-data/tools/sortlm.py
+index a0dd8fe..40f0837 100644
+--- a/data/templates/libkkc-data/tools/sortlm.py
++++ b/data/templates/libkkc-data/tools/sortlm.py
+@@ -40,10 +40,10 @@ def __init__(self, infile, output_prefix):
+         self.__min_cost = 0.0
+ 
+     def read(self):
+-        print "reading N-grams"
++        print("reading N-grams")
+         self.__read_tries()
+         self.__read_ngrams()
+-        print "min cost = %lf" % self.__min_cost
++        print("min cost = %lf" % self.__min_cost)
+ 
+     def __read_tries(self):
+         while True:
+@@ -58,7 +58,7 @@ def __read_tries(self):
+             line = self.__infile.readline()
+             if line == "":
+                 break
+-            line = line.strip()
++            line = line.strip('\n')
+             if line == "":
+                 break
+             match = self.__ngram_line_regex.match(line)
+@@ -89,7 +89,7 @@ def __read_ngrams(self):
+                 line = self.__infile.readline()
+                 if line == "":
+                     break
+-                line = line.strip()
++                line = line.strip('\n')
+                 if line == "":
+                     break
+                 match = self.__ngram_line_regex.match(line)
+@@ -125,14 +125,11 @@ def __write_ngrams(self):
+         def quantize(cost, min_cost):
+             return max(0, min(65535, int(cost * 65535 / min_cost)))
+ 
+-        def cmp_header(a, b):
+-            return cmp(a[0], b[0])
+-
+-        print "writing 1-gram file"
++        print("writing 1-gram file")
+         unigram_offsets = {}
+         unigram_file = open("%s.1gram" % self.__output_prefix, "wb")
+         offset = 0
+-        for ids, value in sorted(self.__ngram_entries[0].iteritems()):
++        for ids, value in sorted(self.__ngram_entries[0].items()):
+             unigram_offsets[ids[0]] = offset
+             s = struct.pack("=HHH",
+                             quantize(value[0], self.__min_cost),
+@@ -143,13 +140,13 @@ def cmp_header(a, b):
+             offset += 1
+         unigram_file.close()
+ 
+-        print "writing 2-gram file"
++        print("writing 2-gram file")
+         bigram_offsets = {}
+         bigram_file = open("%s.2gram" % self.__output_prefix, "wb")
+         keys = self.__ngram_entries[1].keys()
+         items = [(struct.pack("=LL", ids[1], unigram_offsets[ids[0]]), ids) for ids in keys]
+         offset = 0
+-        for header, ids in sorted(items, cmp=cmp_header):
++        for header, ids in sorted(items, key=lambda x: x[0]):
+             value = self.__ngram_entries[1][ids]
+             bigram_offsets[ids] = offset
+             s = struct.pack("=HH",
+@@ -160,11 +157,11 @@ def cmp_header(a, b):
+         bigram_file.close()
+ 
+         if len(self.__ngram_entries[2]) > 0:
+-            print "writing 3-gram file"
++            print("writing 3-gram file")
+             trigram_file = open("%s.3gram" % self.__output_prefix, "wb")
+             keys = self.__ngram_entries[2].keys()
+             items = [(struct.pack("=LL", ids[2], bigram_offsets[(ids[0], ids[1])]), ids) for ids in keys]
+-            for header, ids in sorted(items, cmp=cmp_header):
++            for header, ids in sorted(items, key=lambda x: x[0]):
+                 value = self.__ngram_entries[2][ids]
+                 s = struct.pack("=H",
+                                 quantize(value[0], self.__min_cost))
diff --git a/srcpkgs/libkkc/template b/srcpkgs/libkkc/template
new file mode 100644
index 000000000000..dc4d76a771ca
--- /dev/null
+++ b/srcpkgs/libkkc/template
@@ -0,0 +1,46 @@
+# Template file for 'libkkc'
+pkgname=libkkc
+version=0.3.5
+revision=1
+build_style=gnu-configure
+build_helper=gir
+configure_args="--disable-static --disable-silent-rules"
+make_build_args="V=1"
+hostmakedepends="pkg-config glib-devel gettext intltool python3-marisa
+ $(vopt_if gir vala)"
+makedepends="libglib-devel libgee08-devel json-glib-devel marisa-devel
+ $(vopt_if gir vala-devel)"
+depends="libkkc-data"
+short_desc="Japanese Kana Kanji conversion input method library"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://github.com/ueno/libkkc"
+distfiles="https://github.com/ueno/libkkc/releases/download/v${version}/libkkc-${version}.tar.gz"
+checksum=89b07b042dae5726d306aaa1296d1695cb75c4516f4b4879bc3781fe52f62aef
+patch_args=-Np1
+python_version=3
+
+build_options="gir"
+build_options_default="gir"
+
+libkkc-utils_package() {
+	short_desc+=" - utils"
+	pkg_install() {
+		vmove usr/bin
+		vmove usr/share/locale
+	}
+}
+
+libkkc-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.so"
+		vmove usr/share/libkkc/templates
+		if [ "$build_option_gir" ]; then
+			vmove usr/share/gir-1.0
+			vmove usr/share/vala
+		fi
+	}
+}

From 8ef01cb821b6195534b8d9fb1dfe15dda2f21724 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 31 Mar 2021 22:28:30 +0700
Subject: [PATCH 27/29] New package: skkdic-20210106

---
 srcpkgs/skkdic-extra                         |  1 +
 srcpkgs/skkdic/patches/010_assoc.patch       | 24 +++++++++++
 srcpkgs/skkdic/patches/dump-dict-lists.patch | 12 ++++++
 srcpkgs/skkdic/template                      | 45 ++++++++++++++++++++
 4 files changed, 82 insertions(+)
 create mode 120000 srcpkgs/skkdic-extra
 create mode 100644 srcpkgs/skkdic/patches/010_assoc.patch
 create mode 100644 srcpkgs/skkdic/patches/dump-dict-lists.patch
 create mode 100644 srcpkgs/skkdic/template

diff --git a/srcpkgs/skkdic-extra b/srcpkgs/skkdic-extra
new file mode 120000
index 000000000000..eb0ad40ae696
--- /dev/null
+++ b/srcpkgs/skkdic-extra
@@ -0,0 +1 @@
+skkdic
\ No newline at end of file
diff --git a/srcpkgs/skkdic/patches/010_assoc.patch b/srcpkgs/skkdic/patches/010_assoc.patch
new file mode 100644
index 000000000000..14ea32e8f534
--- /dev/null
+++ b/srcpkgs/skkdic/patches/010_assoc.patch
@@ -0,0 +1,24 @@
+Subject: assoc: fix incorrect words
+Origin: upstream, https://github.com/skk-dev/dict/commit/fcd7503d041b344014c226da078ccd14f8081233
+Bug: https://github.com/skk-dev/dict/pull/26
+
+--- a/SKK-JISYO.assoc
++++ b/SKK-JISYO.assoc
+@@ -573,7 +573,7 @@ $ /
+ 12¤­¤å¤¦ /½½ÆóµÜ/ÇòÍӵܡ¦¶âµíµÜ¡¦ÁлùµÜ¡¦µð³ªµÜ¡¦»â»ÒµÜ¡¦½è½÷µÜ¡¦Å·ÇéµÜ¡¦Å·éùµÜ¡¦¿ÍÇϵܡ¦Ëá滵ܡ¦ÊõÉӵܡ¦ÁеûµÜ/¤ª¤Ò¤Ä¤¸ºÂ¡¦¤ª¤¦¤·ºÂ¡¦¤Õ¤¿¤´ºÂ¡¦¤«¤ËºÂ¡¦¤·¤·ºÂ¡¦¤ª¤È¤áºÂ¡¦¤Æ¤ó¤Ó¤óºÂ¡¦¤µ¤½¤êºÂ¡¦¤¤¤ÆºÂ¡¦¤ä¤®ºÂ¡¦¤ß¤º¤¬¤áºÂ¡¦¤¦¤ªºÂ/
+ 12¤· /½½Æó»Ù/»Ò±¯ÆÒ±¬Ã¤Ì¦¸á̤¿½ÆÓØü°ç/
+ 13 /XIII;[¥í¡¼¥Þ¿ô»ú]/
+-14 /XVI;[¥í¡¼¥Þ¿ô»ú]/
++14 /XIV;[¥í¡¼¥Þ¿ô»ú]/
+ 15 /XV;[¥í¡¼¥Þ¿ô»ú]/
+ 16 /XVI;[¥í¡¼¥Þ¿ô»ú]/
+ 17 /XVII;[¥í¡¼¥Þ¿ô»ú]/
+@@ -593,7 +593,7 @@ $ /
+ 22 /XXII;[¥í¡¼¥Þ¿ô»ú]/
+ 226 /IM Used;[HTTP]/
+ 23 /XXIII;[¥í¡¼¥Þ¿ô»ú]/
+-24 /XXVI;[¥í¡¼¥Þ¿ô»ú]/
++24 /XXIV;[¥í¡¼¥Þ¿ô»ú]/
+ 24¤»¤Ã¤­ /Æó½½»ÍÀᵤ/¾®´¨¡¦Âç´¨¡¦Î©½Õ¡¦±«¿å¡¦·¼ê¯¡¦½Õʬ¡¦À¶ÌÀ¡¦¹ò±«¡¦Î©²Æ¡¦¾®Ëþ¡¦çê¼ï¡¦²Æ»ê¡¦¾®½ë¡¦Âç½ë¡¦Î©½©¡¦½è½ë¡¦ÇòϪ¡¦½©Ê¬¡¦´¨Ïª¡¦Áú¹ß¡¦Î©Åß¡¦¾®À㡦ÂçÀ㡦Åß»ê/
+ 25 /XXV;[¥í¡¼¥Þ¿ô»ú]/
+ 26 /XXVI;[¥í¡¼¥Þ¿ô»ú]/
diff --git a/srcpkgs/skkdic/patches/dump-dict-lists.patch b/srcpkgs/skkdic/patches/dump-dict-lists.patch
new file mode 100644
index 000000000000..c9d436218f2a
--- /dev/null
+++ b/srcpkgs/skkdic/patches/dump-dict-lists.patch
@@ -0,0 +1,12 @@
+Index: skk-dev-dict-7497806/Makefile
+===================================================================
+--- skk-dev-dict-7497806.orig/Makefile
++++ skk-dev-dict-7497806/Makefile
+@@ -231,4 +231,7 @@ IVD_Sequences.txt:
+ IVD_Collections.txt:
+ 	test -f IVD_Collections.txt || $(CURL) -o IVD_Collections.txt https://unicode.org/ivd/data/2017-12-12/IVD_Collections.txt
+ 
++xbps-list:
++	@echo $(SRCS)
++
+ # end of Makefile.
diff --git a/srcpkgs/skkdic/template b/srcpkgs/skkdic/template
new file mode 100644
index 000000000000..29089715e23b
--- /dev/null
+++ b/srcpkgs/skkdic/template
@@ -0,0 +1,45 @@
+# Template file for 'skkdic'
+pkgname=skkdic
+version=20210106
+revision=1
+create_wrksrc=yes
+short_desc="SKK dictionaries"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-2.0-or-later"
+homepage="http://openlab.ring.gr.jp/skk/dic.html"
+distfiles="${DEBIAN_SITE}/main/s/skkdic/skkdic_${version}.orig.tar.gz"
+checksum=625aef9ce0294e2ca8efcff3241bda9aa5103d2e387049b67de144c916556c73
+patch_args=-Np1
+
+do_extract() {
+	local _pkgver=${pkgname}-${version}
+	bsdtar --strip-components=1 \
+		-xf ${XBPS_SRCDISTDIR}/${_pkgver}/skkdic_${version}.orig.tar.gz
+}
+
+post_patch() {
+	_filelist="$(grep -El 'coding: euc-(jp|jis-2004)' $(make xbps-list))"
+	for _file in $_filelist
+	do
+		iconv -f euc-jp -t utf-8 "$_file" >"xbps-${_file}"
+		sed -E 's/coding: euc-(jp|jis-2004)/coding: utf-8/' \
+			"xbps-${_file}" >"${_file}"
+	done
+}
+
+
+do_install() {
+	vinstall SKK-JISYO.L 644 usr/share/skk
+}
+
+skkdic-extra_package() {
+	short_desc+=" - extra"
+	pkg_install() {
+		for _file in $(make xbps-list)
+		do
+			if [ "$_file" != SKK-JISYO.L ]; then
+				vinstall "$_file" 644 usr/share/skk
+			fi
+		done
+	}
+}

From 45d75722b5e421ea8a7835620bfb0fd53685592c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 31 Mar 2021 23:02:28 +0700
Subject: [PATCH 28/29] New package: fcitx5-skk-5.0.5

---
 srcpkgs/fcitx5-skk-config   |  1 +
 srcpkgs/fcitx5-skk/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-skk-config
 create mode 100644 srcpkgs/fcitx5-skk/template

diff --git a/srcpkgs/fcitx5-skk-config b/srcpkgs/fcitx5-skk-config
new file mode 120000
index 000000000000..aafbfd729aa8
--- /dev/null
+++ b/srcpkgs/fcitx5-skk-config
@@ -0,0 +1 @@
+fcitx5-skk
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-skk/template b/srcpkgs/fcitx5-skk/template
new file mode 100644
index 000000000000..4e857ba795da
--- /dev/null
+++ b/srcpkgs/fcitx5-skk/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-skk'
+pkgname=fcitx5-skk
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libskk-devel libgee08-devel json-glib-devel"
+depends="fcitx5 skkdic"
+short_desc="Fcitx5 - SKK engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-skk/fcitx5-skk-${version}.tar.xz"
+checksum=53d60da0386c4f97f5aa094c80f763e39bcb13af30b338c564304cfe657b88cd
+
+fcitx5-skk-config_package() {
+	short_desc+=" - config"
+	depends="fcitx5-skk"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

From e74c90dd22a52489e962557144010f4e69c8513e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 30 Mar 2021 22:43:59 +0700
Subject: [PATCH 29/29] New package: fcitx5-kkc-5.0.5

---
 srcpkgs/fcitx5-kkc-config   |  1 +
 srcpkgs/fcitx5-kkc/template | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 120000 srcpkgs/fcitx5-kkc-config
 create mode 100644 srcpkgs/fcitx5-kkc/template

diff --git a/srcpkgs/fcitx5-kkc-config b/srcpkgs/fcitx5-kkc-config
new file mode 120000
index 000000000000..4686c1fbe9b3
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc-config
@@ -0,0 +1 @@
+fcitx5-kkc
\ No newline at end of file
diff --git a/srcpkgs/fcitx5-kkc/template b/srcpkgs/fcitx5-kkc/template
new file mode 100644
index 000000000000..36750cc55ccb
--- /dev/null
+++ b/srcpkgs/fcitx5-kkc/template
@@ -0,0 +1,24 @@
+# Template file for 'fcitx5-kkc'
+pkgname=fcitx5-kkc
+version=5.0.5
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config gettext extra-cmake-modules qt5-qmake
+ qt5-host-tools"
+makedepends="libfcitx5-devel fcitx5-gtk-devel fcitx5-qt5-devel
+ libkkc-devel libgee08-devel json-glib-devel"
+depends="fcitx5 skkdic"
+short_desc="Fcitx5 - kkc engine"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="GPL-3.0-or-later"
+homepage="https://fcitx-im.org/wiki/Fcitx"
+distfiles="https://download.fcitx-im.org/fcitx5/fcitx5-kkc/fcitx5-kkc-${version}.tar.xz"
+checksum=0e5fc4a8cd3dce8fa3774e6f304013869709aaa7cda9d9420386841e6d850b92
+
+fcitx5-kkc-config_package() {
+	short_desc+=" - config"
+	depends="fcitx5-kkc>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/fcitx5/qt5
+	}
+}

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PR PATCH] [Updated]  fcitx5
  2021-03-21 18:04 [PR PATCH] WIP: fcitx5 sgn
                   ` (21 preceding siblings ...)
  2021-04-08  0:13 ` [PR PATCH] [Updated] fcitx5 sgn
@ 2021-04-08 15:19 ` sgn
  2021-04-08 21:44 ` fcitx5 noarchwastaken
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: sgn @ 2021-04-08 15:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5
https://github.com/void-linux/void-packages/pull/29664

 fcitx5
Close #29499 
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29664.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-29664.patch --]
[-- Type: text/x-diff, Size: 92962 bytes --]

From 59aaf63f9b15f19ebedb01ff465c8614eb95b99a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 20:05:16 +0700
Subject: [PATCH 01/29] New package: xcb-imdkit-1.0.2

---
 common/shlibs               |  1 +
 srcpkgs/xcb-imdkit-devel    |  1 +
 srcpkgs/xcb-imdkit/template | 29 +++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+)
 create mode 120000 srcpkgs/xcb-imdkit-devel
 create mode 100644 srcpkgs/xcb-imdkit/template

diff --git a/common/shlibs b/common/shlibs
index 296b93e5f22b..79740a3d7623 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -256,6 +256,7 @@ libxcb-xkb.so.1 libxcb-1.10_1
 libxcb-xinput.so.0 libxcb-1.10_1
 libxcb-dri3.so.0 libxcb-1.10_1
 libxcb-present.so.0 libxcb-1.10_1
+libxcb-imdkit.so.1 xcb-imdkit-1.0.2_1
 libXdmcp.so.6 libXdmcp-1.0.2_1
 libpolkit-gobject-1.so.0 polkit-0.99_1
 libpolkit-agent-1.so.0 polkit-0.99_1
diff --git a/srcpkgs/xcb-imdkit-devel b/srcpkgs/xcb-imdkit-devel
new file mode 120000
index 000000000000..0044a6a371b3
--- /dev/null
+++ b/srcpkgs/xcb-imdkit-devel
@@ -0,0 +1 @@
+xcb-imdkit
\ No newline at end of file
diff --git a/srcpkgs/xcb-imdkit/template b/srcpkgs/xcb-imdkit/template
new file mode 100644
index 000000000000..3f1a99e9d3ce
--- /dev/null
+++ b/srcpkgs/xcb-imdkit/template
@@ -0,0 +1,29 @@
+# Template file for 'xcb-imdkit'
+pkgname=xcb-imdkit
+version=1.0.2
+revision=1
+build_style=cmake
+hostmakedepends="pkg-config extra-cmake-modules"
+makedepends="xcb-util-keysyms-devel xcb-util-devel uthash"
+short_desc="Implementation of xim protocol in xcb"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://github.com/fcitx/xcb-imdkit"
+distfiles="https://download.fcitx-im.org/fcitx5/xcb-imdkit/xcb-imdkit-${version}.tar.xz"
+checksum=801f9da5adc286fb42e43931ed5a2cf67dfe067c40da8d0fa599a29c6d93c799
+
+post_install() {
+	sed -i '/prefix=/!s,/usr,${exec_prefix},' \
+		"${DESTDIR}/usr/lib/pkgconfig"/*.pc
+}
+
+xcb-imdkit-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/pkgconfig
+		vmove "usr/lib/*.so"
+	}
+}

From b7142312efe18872d5ffa9f0e4a6e86d87442964 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 21 Mar 2021 22:12:45 +0700
Subject: [PATCH 02/29] New package: fcitx5-5.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/fcitx5-icons                          |   1 +
 .../patches/cross-config-template.patch       |  45 ++++
 srcpkgs/fcitx5/patches/no-which.patch         | 194 ++++++++++++++++++