diff mbox series

[bug#53648] gnu: fcitx5-gtk: Add GTK 4 support.

Message ID 86ilu09yzs.fsf@163.com
State Accepted
Headers show
Series [bug#53648] gnu: fcitx5-gtk: Add GTK 4 support. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Zhu Zihao Jan. 31, 2022, 6:53 a.m. UTC

Comments

Zhu Zihao Feb. 6, 2022, 12:47 p.m. UTC | #1
ping.
M Feb. 6, 2022, 3:48 p.m. UTC | #2
Zhu Zihao schreef op ma 31-01-2022 om 14:53 [+0800]:
> -    (outputs '("out" "gtk2"))
> +    (outputs '("out" "gtk2" "gtk4"))

What's the point of building for three separate gtk versions?
Why not just build for gtk@4?

Also, if we go for multiple outputs, shouldn't the latest gtk version
go into "out" instead of the middle version gtk@3?

Greetings,
Maxime.
Zhu Zihao Feb. 6, 2022, 4:02 p.m. UTC | #3
Maxime Devos <maximedevos@telenet.be> writes:

> What's the point of building for three separate gtk versions?
> Why not just build for gtk@4?

Many packages still use GTK3, aren't they?

> Also, if we go for multiple outputs, shouldn't the latest gtk version
> go into "out" instead of the middle version gtk@3?

IMO, GTK3 is still majority, so put it under "out", and make gtk2 and
gtk4 separated.
M Feb. 6, 2022, 5:03 p.m. UTC | #4
Zhu Zihao schreef op ma 07-02-2022 om 00:02 [+0800]:
> Maxime Devos <maximedevos@telenet.be> writes:
> 
> > What's the point of building for three separate gtk versions?
> > Why not just build for gtk@4?
> 
> Many packages still use GTK3, aren't they?
> 
> > Also, if we go for multiple outputs, shouldn't the latest gtk
> version
> > go into "out" instead of the middle version gtk@3?
> 
> IMO, GTK3 is still majority, so put it under "out", and make gtk2 and
> gtk4 separated.

It doesn't seem relevant to me that most packages use gtk+@3,
since fcitx5-gtk is not most packages.  Majority is irrelevant here.

Anyways, we try to use the latest version of packages in Guix whenever
feasible (for features, for bugfixes, because eventually the old
versions will be unsupported upstream and to have less versions to
keep track of), and gtk@4 is the latest version of gtk, so it seems to
me that we should simplify things here by just using the latest version
of gtk, i.e., gtk@4.

Greetings,
Maximes
Zhu Zihao Feb. 7, 2022, 4:25 a.m. UTC | #5
Maxime Devos <maximedevos@telenet.be> writes:

> [[PGP Signed Part:Undecided]]
> Zhu Zihao schreef op ma 07-02-2022 om 00:02 [+0800]:
>> Maxime Devos <maximedevos@telenet.be> writes:
>> 
>> > What's the point of building for three separate gtk versions?
>> > Why not just build for gtk@4?
>> 
>> Many packages still use GTK3, aren't they?
>> 
>> > Also, if we go for multiple outputs, shouldn't the latest gtk
>> version
>> > go into "out" instead of the middle version gtk@3?
>> 
>> IMO, GTK3 is still majority, so put it under "out", and make gtk2 and
>> gtk4 separated.
>
> It doesn't seem relevant to me that most packages use gtk+@3,
> since fcitx5-gtk is not most packages.  Majority is irrelevant here.
>
> Anyways, we try to use the latest version of packages in Guix whenever
> feasible (for features, for bugfixes, because eventually the old
> versions will be unsupported upstream and to have less versions to
> keep track of), and gtk@4 is the latest version of gtk, so it seems to
> me that we should simplify things here by just using the latest version
> of gtk, i.e., gtk@4.
>
> Greetings,
> Maximes
>
> [[End of PGP Signed Part]]

It matters, because fcitx5-gtk is not a GTK *application*, it provides
IM module for GTK applications. Guix users may have both GTK3 & GTK4
application in same environment. If we drop gtk3 (or even gtk2), their
input method will be broken.

I just check the comment left by iyzsong, and I think it's better to
make the glib client in "out", and make IM module for different GTK
version in "gtk2" "gtk3" "gtk4" output. Thoughts?
M Feb. 7, 2022, 8:42 a.m. UTC | #6
Zhu Zihao schreef op ma 07-02-2022 om 12:25 [+0800]:
> It matters, because fcitx5-gtk is not a GTK *application*, it
> provides IM module for GTK applications. Guix users may have both
> GTK3 & GTK4 application in same environment. If we drop gtk3 (or even
> gtk2), their input method will be broken.

Ok, that's a good reason, but it would deserve a comment in the package
definition to explain matters to future readers.

> I just check the comment left by iyzsong, and I think it's better to
> make the glib client in "out", and make IM module for different GTK
> version in "gtk2" "gtk3" "gtk4" output. Thoughts?

It would be useful to explain in the description that the output
that needs to be installed, depends on what other software in in the
profile.  E.g.:

"Fcitx5-gtk provides a Glib-based D-bus client and IM module for
GTK+2/GTK+3/GTK4 applications.  The output that needs to be installed,
depends on which variant of GTK that applications use.  When in doubt,
it is sufficient to simply install all outputs."

Greetings,
Maxime.
diff mbox series

Patch

From 0c23e8cbbfe8f0548b29176831a4358d41820159 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Mon, 31 Jan 2022 14:51:30 +0800
Subject: [PATCH] gnu: fcitx5-gtk: Add GTK 4 support.

* gnu/packages/fcitx5.scm (fcitx5-gtk)[arguments]:
<configure-flags>: Enable GTK 4 IM module.
<phases>: In 'patch-install-prefix', patch the install prefix of GTK 4 IM
module.
[inputs]: Add GTK 4.
[outputs]: Add 'gtk4'.
---
 gnu/packages/fcitx5.scm | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/fcitx5.scm b/gnu/packages/fcitx5.scm
index 92fc0ea171..123418cd4f 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
-- 
2.34.0