me
/
guix
Archived
1
0
Fork 0

gnu: fcitx5-gtk: Split IM module output for different version of GTK.

* gnu/packages/fcitx5.scm (fcitx5-gtk)[arguments]: Use G-Expression.

<phases>: 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 <ludo@gnu.org>
Zhu Zihao 2022-02-07 13:55:26 +08:00 committed by Ludovic Courtès
parent 6616f04412
commit de74438909
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 50 additions and 37 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com> ;;; Copyright © 2020, 2022 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -20,6 +20,7 @@
(define-module (gnu packages fcitx5) (define-module (gnu packages fcitx5)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
#:use-module (guix build-system copy) #:use-module (guix build-system copy)
@ -196,48 +197,60 @@ editors.")
(base32 "07ip4sxf3q895pp7mivv2bdwcmqjnwrmv9pg99jk73cw9bgyq00n")))) (base32 "07ip4sxf3q895pp7mivv2bdwcmqjnwrmv9pg99jk73cw9bgyq00n"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:tests? #f ;No test (list
#:tests? #f ;No test
#:configure-flags #:configure-flags
(list (string-append "-DGOBJECT_INTROSPECTION_GIRDIR=" #~(list (string-append "-DGOBJECT_INTROSPECTION_GIRDIR="
%output "/share/gir-1.0") #$output "/share/gir-1.0")
(string-append "-DGOBJECT_INTROSPECTION_TYPELIBDIR=" (string-append "-DGOBJECT_INTROSPECTION_TYPELIBDIR="
%output "/lib/girepository-1.0")) #$output "/lib/girepository-1.0"))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-before 'configure 'patch-install-prefix (add-before 'configure 'patch-install-prefix
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((out (assoc-ref outputs "out")) ;; Take care of different versions of GTK because this package
(gtk2 (assoc-ref outputs "gtk2")) ;; provides IM module for GTK application to use input method.
(gtk4 (assoc-ref outputs "gtk4"))) (define (split-immodule gtk-version output)
;; Install GTK+ 2 input method module to its own output. (substitute* (string-append gtk-version "/CMakeLists.txt")
(substitute* "gtk2/CMakeLists.txt"
(("\\$\\{CMAKE_INSTALL_LIBDIR\\}") (("\\$\\{CMAKE_INSTALL_LIBDIR\\}")
(string-append gtk2 "/lib"))) (string-append output "/lib"))))
;; Install for GTK 4. (let ((gtk2 #$output:gtk2)
(substitute* "gtk4/CMakeLists.txt" (gtk3 #$output:gtk3)
(("\\$\\{CMAKE_INSTALL_LIBDIR\\}") (gtk4 #$output:gtk4))
(string-append gtk4 "/lib"))))))))) (for-each split-immodule
'("gtk2" "gtk3" "gtk4")
(list gtk2 gtk3 gtk4))))))))
(inputs (inputs
`(("fcitx5" ,fcitx5) (list fcitx5
("fmt" ,fmt) fmt
("libxkbcommon" ,libxkbcommon) libx11
("gobject-introspection" ,gobject-introspection) libxkbcommon
("gtk2" ,gtk+-2) gettext-minimal
("gtk3" ,gtk+) gobject-introspection
("gtk4" ,gtk) gtk+-2
("glib" ,glib) gtk+
("libx11" ,libx11) gtk
("gettext" ,gettext-minimal))) glib))
(native-inputs (native-inputs
(list extra-cmake-modules pkg-config (list extra-cmake-modules pkg-config
`(,glib "bin"))) ;for glib-genmarshal `(,glib "bin"))) ;for glib-genmarshal
;; TODO: Add "lib" output to reduce the closure size of "gtk2". (outputs '("out" "gtk2" "gtk3" "gtk4"))
(outputs '("out" "gtk2" "gtk4"))
(home-page "https://github.com/fcitx/fcitx5-gtk") (home-page "https://github.com/fcitx/fcitx5-gtk")
(synopsis "Glib based D-Bus client and GTK IM module for Fcitx 5") (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 (description "Fcitx5-gtk provides the following functionality in the
for GTK+2/GTK+3 application.") 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+))) (license license:lgpl2.1+)))
(define-public fcitx5-qt (define-public fcitx5-qt