From 41ec0573b81733e15b70312d81cf7fdf77dd63fe Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Fri, 17 Dec 2021 12:40:28 -0500
Subject: gnu: Remove meson-0.59 workarounds.

Mostly automated with the following command:

$ grep --include='*.scm' '#:meson ,meson-0.59' -rl \
    | xargs sed -z 's/#:meson[^\n]*\s*//' -i

* gnu/packages/freedesktop.scm (malcontent)
(accountsservice): Delete #:meson argument.
* gnu/packages/games.scm (gnome-2048): Likewise.
* gnu/packages/geo.scm (gnome-maps): Likewise.
* gnu/packages/gnome.scm (gnome-photos, gnome-music)
(gnome-initial-setup, gnome-user-share, gnome-characters)
(gnome-disk-utility, gnome-font-viewer, evince, glade3)
(gnome-mines, gnome-sudoku, gnome-settings-daemon, devhelp)
(totem, eog, gvfs, simple-scan, epiphany, gnome-session, gedit)
(network-manager-applet, gnome-control-center, gnome-shell, nautilus)
(gnome-default-applications, gnome-weather, gnome-tweaks, cheese, gthumb)
(gitg, polari, gnome-boxes, gtranslator): Likewise.
* gnu/packages/gtk.scm: (gtkmm-3): Likewise.
* gnu/packages/pdf.scm (zathura): Likewise.
* gnu/packages/photo.scm (entangle): Likewise.
* gnu/packages/video.scm (pitivi): Likewise.
* gnu/packages/virtualization.scm (libvirt-glib): Likewise.
---
 gnu/packages/gtk.scm | 6 ------
 1 file changed, 6 deletions(-)

(limited to 'gnu/packages/gtk.scm')

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index a5b804d848..781c66192c 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1809,12 +1809,6 @@ (define-public gtkmm-3
                        name "-" version ".tar.xz"))
        (sha256
         (base32 "1ri2msp3cmzi6r65ghwb8gfavfaxv0axpwi3q60nm7v8hvg36qw5"))))
-    (arguments
-     (substitute-keyword-arguments (package-arguments gtkmm)
-       ;; Use meson 0.59 to workaround a new issue with meson 0.60 (see:
-       ;; https://github.com/mesonbuild/meson/issues/9350#issuecomment-953799600).
-       ((#:meson _ #f)
-        meson-0.59)))
     (propagated-inputs
      `(("atkmm-2.28" ,atkmm-2.28)
        ("cairomm-1.14" ,cairomm-1.14)
-- 
cgit v1.2.3


From 771550b28042a93ea2a87f2c2c42d72e577170e9 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Fri, 17 Dec 2021 16:14:28 -0500
Subject: gnu: cairo: Use bash-minimal unconditionally.

* gnu/packages/gtk.scm (cairo)[inputs]: Use bash-minimal unconditionally.
---
 gnu/packages/gtk.scm | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

(limited to 'gnu/packages/gtk.scm')

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 781c66192c..dff09bf674 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -188,10 +188,7 @@ (define-public cairo
        ("pkg-config" ,pkg-config)
        ("python" ,python-wrapper)))
     (inputs
-     ;; TODO(core-updates): make this unconditional
-     `(,@(if (%current-target-system)
-             `(("bash-minimal" ,bash-minimal)) ; for glib-or-gtk-wrap
-             '())
+     `(("bash-minimal" ,bash-minimal)
        ("drm" ,libdrm)
        ("ghostscript" ,ghostscript)
        ("libspectre" ,libspectre)
-- 
cgit v1.2.3


From 9e0dfe61e96556d9824e1583d17b13f1eda8300d Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sat, 18 Dec 2021 23:12:17 -0500
Subject: gnu: atkmm: Add python to native inputs.

Since commit 5d20d7e1369fc7d93de19c0bd219937d697ceae6, meson no longer
propagates Python.

* gnu/packages/gtk.scm (atkmm)[native-inputs]: Add python.
---
 gnu/packages/gtk.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'gnu/packages/gtk.scm')

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index dff09bf674..358b9c5d52 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1685,8 +1685,7 @@ (define-public atkmm
                (mkdir-p (string-append doc "/share"))
                (rename-file
                 (string-append out "/share/doc")
-                (string-append doc "/share/doc"))
-               #t))))))
+                (string-append doc "/share/doc"))))))))
     (native-inputs
      `(("dot" ,graphviz)
        ("doxygen" ,doxygen)
@@ -1694,6 +1693,7 @@ (define-public atkmm
        ("mm-common" ,mm-common)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
+       ("python" ,python)
        ("xsltproc" ,libxslt)))
     (propagated-inputs
      (list glibmm atk))
-- 
cgit v1.2.3


From e25772628d76771a920a44aec6220509724418dc Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sat, 18 Dec 2021 23:12:54 -0500
Subject: gnu: atkmm-2.28: Do not propagate two variants of glibmm.

* gnu/packages/gtk.scm (atkmm-2.28)[propagated-inputs]: Replace rather than
append glibmm-2.64.
---
 gnu/packages/gtk.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'gnu/packages/gtk.scm')

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 358b9c5d52..d1d5b56c91 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1723,7 +1723,7 @@ (define-public atkmm-2.28
         (base32 "1b8vycqzr3lfvk2l73f4kk74hj48081zbh9r1r2ilr3h8xh7cs0i"))))
     (propagated-inputs
      (modify-inputs (package-propagated-inputs atkmm)
-       (prepend glibmm-2.64)))))
+       (replace "glibmm" glibmm-2.64)))))
 
 (define-public gtkmm
   (package
-- 
cgit v1.2.3


From 5c3d2db4fdb498b67858d96ab215d39a07289074 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sat, 18 Dec 2021 23:19:47 -0500
Subject: gnu: pangomm: Add python to native inputs.

Since commit 5d20d7e1369fc7d93de19c0bd219937d697ceae6, meson no longer
propagates Python.

* gnu/packages/gtk.scm (pangomm)[native-inputs]: Add python.
---
 gnu/packages/gtk.scm | 1 +
 1 file changed, 1 insertion(+)

(limited to 'gnu/packages/gtk.scm')

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index d1d5b56c91..77b348d18d 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1630,6 +1630,7 @@ (define-public pangomm
        ("mm-common" ,mm-common)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
+       ("python" ,python)
        ("xsltproc" ,libxslt)))
     (propagated-inputs
      (list cairo cairomm glibmm pango))
-- 
cgit v1.2.3


From b78f0cbff4a5243d7bf2d6fc62c810d8f85b82a4 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sun, 19 Dec 2021 23:37:26 -0500
Subject: gnu: gtk: Update to 4.4.1.

* gnu/packages/patches/gtk-introspection-test.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/gtk.scm (gtk): Update to 4.4.1.
[origin]: Apply new patch.
[phases]{pre-check}: Set TZDIR.
[native-inputs]: Add graphene, python-pygobject and tzdata.
---
 gnu/local.mk                                      |  5 +++--
 gnu/packages/gtk.scm                              | 17 ++++++++++++-----
 gnu/packages/patches/gtk-introspection-test.patch | 22 ++++++++++++++++++++++
 3 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 gnu/packages/patches/gtk-introspection-test.patch

(limited to 'gnu/packages/gtk.scm')

diff --git a/gnu/local.mk b/gnu/local.mk
index aa679ee6c7..86c1e57aa4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1232,8 +1232,9 @@ dist_patch_DATA =						\
   %D%/packages/patches/gtk2-theme-paths.patch			\
   %D%/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch	\
   %D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \
-  %D%/packages/patches/gtk-doc-respect-xml-catalog.patch	 \
-  %D%/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch    \
+  %D%/packages/patches/gtk-doc-respect-xml-catalog.patch	\
+  %D%/packages/patches/gtk-introspection-test.patch		\
+  %D%/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch    	\
   %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \
   %D%/packages/patches/gtksourceview-2-add-default-directory.patch \
   %D%/packages/patches/gzdoom-search-in-installed-share.patch	\
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 77b348d18d..58e428c921 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1059,7 +1059,7 @@ (define-public gtk+
 (define-public gtk
   (package
     (name "gtk")
-    (version "4.2.1")
+    (version "4.4.1")
     (source
      (origin
        (method url-fetch)
@@ -1067,9 +1067,10 @@ (define-public gtk
                            (version-major+minor version)  "/"
                            name "-" version ".tar.xz"))
        (sha256
-        (base32 "1rh9fd5axf79pmd93hb2fmmflic5swcvqvq6vqghlgz4bmvnjc82"))
+        (base32 "1x6xlc063nqp7cg6py4kq1kpw9pkq49ifk5kki0brc667ncdmahg"))
        (patches
-        (search-patches "gtk4-respect-GUIX_GTK4_PATH.patch"))))
+        (search-patches "gtk4-respect-GUIX_GTK4_PATH.patch"
+                        "gtk-introspection-test.patch"))))
     (build-system meson-build-system)
     (outputs '("out" "bin" "doc"))
     (arguments
@@ -1122,7 +1123,7 @@ (define-public gtk
            (lambda _
              (setenv "XDG_CACHE_HOME" (getcwd))))
          (add-before 'check 'pre-check
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
              ;; Tests require a running X server.
              (system "Xvfb :1 +extension GLX &")
              (setenv "DISPLAY" ":1")
@@ -1131,7 +1132,10 @@ (define-public gtk
              ;; Tests look for those variables.
              (setenv "XDG_RUNTIME_DIR" (getcwd))
              ;; For missing '/etc/machine-id'.
-             (setenv "DBUS_FATAL_WARNINGS" "0")))
+             (setenv "DBUS_FATAL_WARNINGS" "0")
+             ;; Required for the calendar test.
+             (setenv "TZDIR" (search-input-directory inputs
+                                                     "share/zoneinfo"))))
          (add-after 'install 'move-files
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -1166,10 +1170,12 @@ (define-public gtk
        ("gettext-minimal" ,gettext-minimal)
        ("glib:bin" ,glib "bin")
        ("gobject-introspection" ,gobject-introspection) ;for building introspection data
+       ("graphene" ,graphene)
        ("gtk-doc" ,gtk-doc)             ;for building documentation
        ("intltool" ,intltool)
        ("libxslt" ,libxslt)             ;for building man-pages
        ("pkg-config" ,pkg-config)
+       ("python-pygobject" ,python-pygobject)
        ;; These python modules are required for building documentation.
        ("python-jinja2" ,python-jinja2)
        ("python-markdown" ,python-markdown)
@@ -1178,6 +1184,7 @@ (define-public gtk
        ("python-toml" ,python-toml)
        ("python-typogrify" ,python-typogrify)
        ("sassc" ,sassc)                 ;for building themes
+       ("tzdata" ,tzdata-for-tests)
        ("vala" ,vala)
        ("xorg-server-for-tests" ,xorg-server-for-tests)))
     (inputs
diff --git a/gnu/packages/patches/gtk-introspection-test.patch b/gnu/packages/patches/gtk-introspection-test.patch
new file mode 100644
index 0000000000..570ea806a9
--- /dev/null
+++ b/gnu/packages/patches/gtk-introspection-test.patch
@@ -0,0 +1,22 @@
+# Extend rather than stomp environment variables.
+# Upstream status: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4268
+diff --git a/testsuite/introspection/meson.build b/testsuite/introspection/meson.build
+index 6202fb7446..b59191eb0f 100644
+--- a/testsuite/introspection/meson.build
++++ b/testsuite/introspection/meson.build
+@@ -1,9 +1,10 @@
++env = environment()
++env.prepend('GI_TYPELIB_PATH',
++    join_paths(project_build_root, 'gtk'),
++    gi_dep.get_pkgconfig_variable('typelibdir'))
++env.prepend('LD_PRELOAD', join_paths(project_build_root, 'gtk', 'libgtk-4.so'))
+ 
+ test('api',
+      find_program('api.py', dirs: meson.current_source_dir()),
+      suite: ['introspection'],
+-     env: [
+-       'GI_TYPELIB_PATH=@0@/gtk:@1@'.format(project_build_root,
+-          gi_dep.get_pkgconfig_variable('typelibdir')),
+-       'LD_PRELOAD=@0@/gtk/libgtk-4.so'.format(project_build_root),
+-     ])
++     env: env)
-- 
cgit v1.2.3


From 5d231df3cc7bf73b5be0c414611b28f25cd4841e Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sun, 19 Dec 2021 00:44:02 -0500
Subject: gnu: gtkmm: Add python to native inputs.

Since commit 5d20d7e1369fc7d93de19c0bd219937d697ceae6, meson no longer
propagates Python.

* gnu/packages/gtk.scm (gtkmm)[native-inputs]: Add python.
---
 gnu/packages/gtk.scm | 1 +
 1 file changed, 1 insertion(+)

(limited to 'gnu/packages/gtk.scm')

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 58e428c921..ced9d621aa 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1781,6 +1781,7 @@ (define-public gtkmm
        ("mm-common" ,mm-common)
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
+       ("python" ,python)
        ("xsltproc" ,libxslt)
        ("xorg-server" ,xorg-server-for-tests)))
     (propagated-inputs
-- 
cgit v1.2.3