From 62a640576ae1de9523fba593219fb50ac97b44c6 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Mon, 21 Mar 2022 09:16:38 +0800 Subject: [PATCH 3/4] gnu: Add fcitx5-gtk4. * gnu/packages/fcitx5.scm (fcitx5-gtk4): New variable. --- gnu/packages/fcitx5.scm | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm index 2d5917f3c0..be46a5036c 100644 --- a/gnu/packages/fcitx5.scm +++ b/gnu/packages/fcitx5.scm @@ -250,6 +250,48 @@ (define (split-immodule gtk-version output) @end table") (license license:lgpl2.1+))) +;; XXX: This package is separated from fcitx5-gtk for following reasons. +;; 1. GTK4 has a lot more dependencies, some of which maybe unavailable on +;; platforms other than x86_64. See . +;; 2. GTK4 now propagates pango@1.50, it will conflict with GTK3 and GTK2 +;; (propagates pango@1.48) if they're all in the inputs of same package. +;; See . +(define-public fcitx5-gtk4 + (package + (inherit fcitx5-gtk) + (name "fcitx5-gtk4") + (arguments + (list + #:tests? #f ;No test + #:configure-flags + #~(list (string-append "-DCMAKE_CXX_FLAGS=-I" + #$(this-package-input "fcitx5-gtk") + "/include/Fcitx5/GClient")) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'fix-gclient + (lambda* (#:key inputs #:allow-other-keys) + (define gclient + (search-input-file inputs "lib/libFcitx5GClient.so")) + ;; Force cmake search libFcitx5GClient.so in library search + ;; path instead of compiling again. + (substitute* "gtk4/CMakeLists.txt" + (("Fcitx5::GClient") + gclient)))) + (add-before 'build 'enter-gtk4-subdirectory + (lambda _ + (chdir "gtk4"))) + (add-after 'install 'leave-gtk4-subdirectory + (lambda _ + (chdir "..")))))) + (inputs + (modify-inputs (package-inputs fcitx5-gtk) + (delete "gtk+") + (prepend fcitx5-gtk gtk))) + (outputs '("out")) + (synopsis "GTK4 IM module for Fcitx 5") + (description "Fcitx5-gtk4 provides IM module for GTK4 applications."))) + (define-public fcitx5-qt (package (name "fcitx5-qt") -- 2.34.0