gnu: gtk: Update to 4.8.0 and use gexps.

* gnu/packages/gtk.scm (gtk): Update to 4.8.0.
[arguments]: Use gexps.
[parallel-tests?]: Remove argument.
[phases]{patch}: Use this-package-native-input.  Disable the
inscription-markup.ui test.
{move-files}: Adjust for gexps.
This commit is contained in:
Maxim Cournoyer 2022-08-26 15:29:36 -04:00
parent a0a0c282f0
commit abfa74c68b
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -1142,7 +1142,7 @@ application suites.")
(define-public gtk (define-public gtk
(package (package
(name "gtk") (name "gtk")
(version "4.6.6") (version "4.8.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
@ -1150,110 +1150,111 @@ application suites.")
(version-major+minor version) "/" (version-major+minor version) "/"
name "-" version ".tar.xz")) name "-" version ".tar.xz"))
(sha256 (sha256
(base32 "0w5fb4grgmb6nhf2glq2y5xqnc9y4v3lm0s9xnbw5xv96p8y9gvv")) (base32 "0zxxvjnbmaahvm9lwm007dzgc0yl8qamkp1467c5kqyi6ws21mn8"))
(patches (patches
(search-patches "gtk4-respect-GUIX_GTK4_PATH.patch")))) (search-patches "gtk4-respect-GUIX_GTK4_PATH.patch"))))
(build-system meson-build-system) (build-system meson-build-system)
(outputs '("out" "bin" "doc")) (outputs '("out" "bin" "doc"))
(arguments (arguments
`(#:modules ((guix build utils) (list
#:modules '((guix build utils)
(guix build meson-build-system) (guix build meson-build-system)
((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)) ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:))
#:configure-flags #:configure-flags
(list #~(list
"-Dbroadway-backend=true" ;for broadway display-backend "-Dbroadway-backend=true" ;for broadway display-backend
"-Dcloudproviders=enabled" ;for cloud-providers support "-Dcloudproviders=enabled" ;for cloud-providers support
"-Dtracker=enabled" ;for filechooser search support "-Dtracker=enabled" ;for filechooser search support
"-Dcolord=enabled" ;for color printing support "-Dcolord=enabled" ;for color printing support
,@(if (%current-target-system) #$@(if (%current-target-system)
;; If true, gtkdoc-scangobj will try to execute a ;; If true, gtkdoc-scangobj will try to execute a
;; cross-compiled binary. ;; cross-compiled binary.
'("-Dgtk_doc=false") '("-Dgtk_doc=false")
'("-Dgtk_doc=true")) '("-Dgtk_doc=true"))
"-Dman-pages=true") "-Dman-pages=true")
#:parallel-tests? #f ;parallel tests are not supported #:test-options '(list "--setup=x11" ;defaults to wayland
#:test-options '("--setup=x11" ;defaults to wayland ;; Use the same test options as upstream uses for
;; Use the same test options as upstream uses for ;; their CI.
;; their CI. "--suite=gtk"
"--suite=gtk" "--no-suite=gsk-compare-broadway")
"--no-suite=gsk-compare-broadway") #:phases
#:phases #~(modify-phases %standard-phases
(modify-phases %standard-phases (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
(add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file (assoc-ref glib-or-gtk:%standard-phases
(assoc-ref glib-or-gtk:%standard-phases 'generate-gdk-pixbuf-loaders-cache-file))
'generate-gdk-pixbuf-loaders-cache-file)) (add-after 'unpack 'patch-rst2man
(add-after 'unpack 'patch-rst2man (lambda _
(lambda _ (substitute* "docs/reference/gtk/meson.build"
(substitute* "docs/reference/gtk/meson.build" (("find_program\\('rst2man'")
(("find_program\\('rst2man'") "find_program('rst2man.py'")))) "find_program('rst2man.py'"))))
(add-after 'unpack 'patch (add-after 'unpack 'patch
(lambda* (#:key inputs native-inputs outputs #:allow-other-keys) (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
;; Correct DTD resources of docbook. ;; Correct DTD resources of docbook.
(substitute* (find-files "docs" "\\.xml$") (substitute* (find-files "docs" "\\.xml$")
(("http://www.oasis-open.org/docbook/xml/4.3/") (("http://www.oasis-open.org/docbook/xml/4.3/")
(string-append (string-append #$(this-package-native-input "docbook-xml")
(assoc-ref (or native-inputs inputs) "docbook-xml-4.3") "/xml/dtd/docbook/")))
"/xml/dtd/docbook/"))) ;; Disable building of icon cache.
;; Disable building of icon cache. (substitute* "meson.build"
(substitute* "meson.build" (("gtk_update_icon_cache: true")
(("gtk_update_icon_cache: true") "gtk_update_icon_cache: false"))
"gtk_update_icon_cache: false")) ;; Disable failing tests.
;; Disable failing tests. (substitute* (find-files "testsuite" "meson.build")
(substitute* (find-files "testsuite" "meson.build") (("[ \t]*'empty-text.node',") "")
(("[ \t]*'empty-text.node',") "") (("[ \t]*'testswitch.node',") "")
(("[ \t]*'testswitch.node',") "") (("[ \t]*'widgetfactory.node',") "")
(("[ \t]*'widgetfactory.node',") "") ;; The unaligned-offscreen test fails for unknown reasons, also
;; The unaligned-offscreen test fails for unknown reasons, also ;; on different distributions (see:
;; on different distributions (see: ;; https://gitlab.gnome.org/GNOME/gtk/-/issues/4889).
;; https://gitlab.gnome.org/GNOME/gtk/-/issues/4889). ((" 'unaligned-offscreen',") ""))
((" 'unaligned-offscreen',") "")) (substitute* "testsuite/reftests/meson.build"
(substitute* "testsuite/reftests/meson.build" (("[ \t]*'label-wrap-justify.ui',") "")
(("[ \t]*'label-wrap-justify.ui',") "")))) ;; The inscription-markup.ui fails due to /etc/machine-id
(add-before 'build 'set-cache ;; related warnings (see:
(lambda _ ;; https://gitlab.gnome.org/GNOME/gtk/-/issues/5169).
(setenv "XDG_CACHE_HOME" (getcwd)))) (("[ \t]*'inscription-markup.ui',") ""))))
(add-before 'check 'pre-check (add-before 'build 'set-cache
(lambda* (#:key inputs #:allow-other-keys) (lambda _
;; Tests require a running X server. (setenv "XDG_CACHE_HOME" (getcwd))))
(system "Xvfb :1 +extension GLX &") (add-before 'check 'pre-check
(setenv "DISPLAY" ":1") (lambda* (#:key inputs #:allow-other-keys)
;; Tests write to $HOME. ;; Tests require a running X server.
(setenv "HOME" (getcwd)) (system "Xvfb :1 +extension GLX &")
;; Tests look for those variables. (setenv "DISPLAY" ":1")
(setenv "XDG_RUNTIME_DIR" (getcwd)) ;; Tests write to $HOME.
;; For missing '/etc/machine-id'. (setenv "HOME" (getcwd))
(setenv "DBUS_FATAL_WARNINGS" "0") ;; Tests look for those variables.
;; Required for the calendar test. (setenv "XDG_RUNTIME_DIR" (getcwd))
(setenv "TZDIR" (search-input-directory inputs ;; For missing '/etc/machine-id'.
"share/zoneinfo")))) (setenv "DBUS_FATAL_WARNINGS" "0")
(add-after 'install 'move-files ;; Required for the calendar test.
(lambda* (#:key outputs #:allow-other-keys) (setenv "TZDIR" (search-input-directory inputs
(let* ((out (assoc-ref outputs "out")) "share/zoneinfo"))))
(bin (assoc-ref outputs "bin")) (add-after 'install 'move-files
(doc (assoc-ref outputs "doc"))) (lambda _
(for-each mkdir-p (for-each mkdir-p
(list (list
(string-append bin "/bin") (string-append #$output:bin "/bin")
(string-append bin "/share/applications") (string-append #$output:bin "/share/applications")
(string-append bin "/share/icons") (string-append #$output:bin "/share/icons")
(string-append bin "/share/man") (string-append #$output:bin "/share/man")
(string-append bin "/share/metainfo") (string-append #$output:bin "/share/metainfo")
(string-append doc "/share/doc"))) (string-append #$output:doc "/share/doc")))
;; Move programs and related files to output 'bin'. ;; Move programs and related files to output 'bin'.
(for-each (lambda (dir) (for-each (lambda (dir)
(rename-file (rename-file
(string-append out dir) (string-append #$output dir)
(string-append bin dir))) (string-append #$output:bin dir)))
(list (list
"/bin" "/bin"
"/share/applications" "/share/applications"
"/share/icons" "/share/icons"
"/share/man" "/share/man"
"/share/metainfo")) "/share/metainfo"))
;; Move HTML documentation to output 'doc'. ;; Move HTML documentation to output 'doc'.
(rename-file (rename-file
(string-append out "/share/doc") (string-append #$output "/share/doc")
(string-append doc "/share/doc")))))))) (string-append #$output:doc "/share/doc")))))))
(native-inputs (native-inputs
(list docbook-xml-4.3 (list docbook-xml-4.3
docbook-xsl docbook-xsl