From 6616f0441260700b9f5d62eb64ac03af35c14290 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Mon, 31 Jan 2022 14:51:30 +0800 Subject: gnu: fcitx5-gtk: Add GTK 4 support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/fcitx5.scm (fcitx5-gtk)[arguments]: : Enable GTK 4 IM module. : In 'patch-install-prefix', patch the install prefix of GTK 4 IM module. [inputs]: Add GTK 4. [outputs]: Add 'gtk4'. Signed-off-by: Ludovic Courtès --- gnu/packages/fcitx5.scm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'gnu/packages/fcitx5.scm') diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm index 66b07b4a51..768e84e55a 100644 --- a/gnu/packages/fcitx5.scm +++ b/gnu/packages/fcitx5.scm @@ -201,19 +201,23 @@ (define-public fcitx5-gtk (list (string-append "-DGOBJECT_INTROSPECTION_GIRDIR=" %output "/share/gir-1.0") (string-append "-DGOBJECT_INTROSPECTION_TYPELIBDIR=" - %output "/lib/girepository-1.0") - ;; TODO: Enable it when Guix has GTK4. - "-DENABLE_GTK4_IM_MODULE=Off") + %output "/lib/girepository-1.0")) #:phases (modify-phases %standard-phases (add-before 'configure 'patch-install-prefix (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out")) - (gtk2 (assoc-ref outputs "gtk2"))) + (gtk2 (assoc-ref outputs "gtk2")) + (gtk4 (assoc-ref outputs "gtk4"))) ;; Install GTK+ 2 input method module to its own output. (substitute* "gtk2/CMakeLists.txt" (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") - (string-append gtk2 "/lib"))))))))) + (string-append gtk2 "/lib"))) + + ;; Install for GTK 4. + (substitute* "gtk4/CMakeLists.txt" + (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") + (string-append gtk4 "/lib"))))))))) (inputs `(("fcitx5" ,fcitx5) ("fmt" ,fmt) @@ -221,6 +225,7 @@ (define-public fcitx5-gtk ("gobject-introspection" ,gobject-introspection) ("gtk2" ,gtk+-2) ("gtk3" ,gtk+) + ("gtk4" ,gtk) ("glib" ,glib) ("libx11" ,libx11) ("gettext" ,gettext-minimal))) @@ -228,7 +233,7 @@ (define-public fcitx5-gtk (list extra-cmake-modules pkg-config `(,glib "bin"))) ;for glib-genmarshal ;; TODO: Add "lib" output to reduce the closure size of "gtk2". - (outputs '("out" "gtk2")) + (outputs '("out" "gtk2" "gtk4")) (home-page "https://github.com/fcitx/fcitx5-gtk") (synopsis "Glib based D-Bus client and GTK IM module for Fcitx 5") (description "Fcitx5-gtk provides a Glib based D-Bus client and IM module -- cgit v1.2.3 From de744389092246fa95d00f17c8571e913f19de60 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Mon, 7 Feb 2022 13:55:26 +0800 Subject: gnu: fcitx5-gtk: Split IM module output for different version of GTK. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/fcitx5.scm (fcitx5-gtk)[arguments]: Use G-Expression. : Split input method module into different outputs for GTK2, GTK3 and GTK4. Now default output only provides GLib client of Fcitx5. [inputs]: Use label-less style inputs. [outputs]: Add new "gtk3" output. [synopsis]: Fix typo. [description]: Describe the functionality of each output. Signed-off-by: Ludovic Courtès --- gnu/packages/fcitx5.scm | 87 ++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 37 deletions(-) (limited to 'gnu/packages/fcitx5.scm') diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm index 768e84e55a..0be5e53863 100644 --- a/gnu/packages/fcitx5.scm +++ b/gnu/packages/fcitx5.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020 Zhu Zihao +;;; Copyright © 2020, 2022 Zhu Zihao ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. @@ -20,6 +20,7 @@ (define-module (gnu packages fcitx5) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) @@ -196,48 +197,60 @@ (define-public fcitx5-gtk (base32 "07ip4sxf3q895pp7mivv2bdwcmqjnwrmv9pg99jk73cw9bgyq00n")))) (build-system cmake-build-system) (arguments - `(#:tests? #f ;No test - #:configure-flags - (list (string-append "-DGOBJECT_INTROSPECTION_GIRDIR=" - %output "/share/gir-1.0") - (string-append "-DGOBJECT_INTROSPECTION_TYPELIBDIR=" - %output "/lib/girepository-1.0")) - #:phases - (modify-phases %standard-phases - (add-before 'configure 'patch-install-prefix - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (gtk2 (assoc-ref outputs "gtk2")) - (gtk4 (assoc-ref outputs "gtk4"))) - ;; Install GTK+ 2 input method module to its own output. - (substitute* "gtk2/CMakeLists.txt" - (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") - (string-append gtk2 "/lib"))) + (list + #:tests? #f ;No test + #:configure-flags + #~(list (string-append "-DGOBJECT_INTROSPECTION_GIRDIR=" + #$output "/share/gir-1.0") + (string-append "-DGOBJECT_INTROSPECTION_TYPELIBDIR=" + #$output "/lib/girepository-1.0")) + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'patch-install-prefix + (lambda _ + ;; Take care of different versions of GTK because this package + ;; provides IM module for GTK application to use input method. + (define (split-immodule gtk-version output) + (substitute* (string-append gtk-version "/CMakeLists.txt") + (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") + (string-append output "/lib")))) - ;; Install for GTK 4. - (substitute* "gtk4/CMakeLists.txt" - (("\\$\\{CMAKE_INSTALL_LIBDIR\\}") - (string-append gtk4 "/lib"))))))))) + (let ((gtk2 #$output:gtk2) + (gtk3 #$output:gtk3) + (gtk4 #$output:gtk4)) + (for-each split-immodule + '("gtk2" "gtk3" "gtk4") + (list gtk2 gtk3 gtk4)))))))) (inputs - `(("fcitx5" ,fcitx5) - ("fmt" ,fmt) - ("libxkbcommon" ,libxkbcommon) - ("gobject-introspection" ,gobject-introspection) - ("gtk2" ,gtk+-2) - ("gtk3" ,gtk+) - ("gtk4" ,gtk) - ("glib" ,glib) - ("libx11" ,libx11) - ("gettext" ,gettext-minimal))) + (list fcitx5 + fmt + libx11 + libxkbcommon + gettext-minimal + gobject-introspection + gtk+-2 + gtk+ + gtk + glib)) (native-inputs (list extra-cmake-modules pkg-config `(,glib "bin"))) ;for glib-genmarshal - ;; TODO: Add "lib" output to reduce the closure size of "gtk2". - (outputs '("out" "gtk2" "gtk4")) + (outputs '("out" "gtk2" "gtk3" "gtk4")) (home-page "https://github.com/fcitx/fcitx5-gtk") - (synopsis "Glib based D-Bus client and GTK IM module for Fcitx 5") - (description "Fcitx5-gtk provides a Glib based D-Bus client and IM module -for GTK+2/GTK+3 application.") + (synopsis "GLib-based D-Bus client and GTK IM module for Fcitx 5") + (description "Fcitx5-gtk provides the following functionality in the +corresponding output: + +@table @code +@item out +GLib-based D-Bus client of Fcitx5. +@item gtk2 +IM module for GTK+2 applications. +@item gtk3 +IM module for GTK+3 applications. +@item gtk4 +IM module for GTK4 applications. +@end table") (license license:lgpl2.1+))) (define-public fcitx5-qt -- cgit v1.2.3 From 93c3bcc3f2f8803c8b3118f55790a933756d17e6 Mon Sep 17 00:00:00 2001 From: Dominic Martinez Date: Mon, 21 Feb 2022 19:13:50 -0500 Subject: gnu: Add fcitx5-anthy. * gnu/packages/fcitx5.scm (fcitx5-anthy): New variable. Signed-off-by: Nicolas Goaziou --- gnu/packages/fcitx5.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gnu/packages/fcitx5.scm') diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm index 0be5e53863..13031d6d3d 100644 --- a/gnu/packages/fcitx5.scm +++ b/gnu/packages/fcitx5.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2022 Zhu Zihao ;;; Copyright © 2021 Tobias Geerinckx-Rice +;;; Copyright © 2022 Dominic Martinez ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu packages fcitx5) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages anthy) #:use-module (gnu packages boost) #:use-module (gnu packages curl) #:use-module (gnu packages datastructures) @@ -288,6 +290,30 @@ (define-public fcitx5-qt ;; and qt5/platforminputcontext. license:bsd-3)))) +(define-public fcitx5-anthy + (package + (name "fcitx5-anthy") + (version "5.0.9") + (source + (origin + (method url-fetch) + (uri (string-append "https://download.fcitx-im.org/fcitx5" + "/fcitx5-anthy/fcitx5-anthy-" + version ".tar.xz")) + (sha256 + (base32 "0i2ahfp1vh0cs3brcsfblzqwszal2qj1ncgb1hbc9v03s1j6bybk")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f)) ;; no tests + (inputs (list fcitx5 anthy gettext-minimal fmt)) + (native-inputs + (list extra-cmake-modules pkg-config)) + (home-page "https://github.com/fcitx/fcitx5-anthy") + (synopsis "Anthy Japanese language input for Fcitx 5") + (description "Fcitx5-Anthy provides Japanese input support to Fcitx5 using +the Anthy input method.") + (license license:gpl2+))) + (define-public fcitx5-chinese-addons (package (name "fcitx5-chinese-addons") -- cgit v1.2.3