gnu: gtk+: Enable tests.

* gnu/packages/gtk.scm (gtk+) [arguments]<#:phases>['pre-configure]: Remove phase.
['disable-failing-tests]: New phase.
['pre-check]: New phase.

Signed-off-by: Léo Le Bouter <lle-bout@zaclys.net>
This commit is contained in:
Raghav Gururajan 2021-03-26 10:53:09 -04:00
parent 10b31b5eac
commit 5721c0f03d
No known key found for this signature in database
GPG key ID: 45A8B1E86BCD10A6

View file

@ -923,97 +923,117 @@ (define-public gtk+-2
(home-page "https://www.gtk.org/"))) (home-page "https://www.gtk.org/")))
(define-public gtk+ (define-public gtk+
(package (inherit gtk+-2) (package
(name "gtk+") (inherit gtk+-2)
(version "3.24.24") (name "gtk+")
(source (origin (version "3.24.24")
(method url-fetch) (source
(uri (string-append "mirror://gnome/sources/" name "/" (origin
(version-major+minor version) "/" (method url-fetch)
name "-" version ".tar.xz")) (uri (string-append "mirror://gnome/sources/" name "/"
(sha256 (version-major+minor version) "/"
(base32 name "-" version ".tar.xz"))
"12ipk1d376bai9v820qzhxba93kkh5abi6mhyqr4hwjvqmkl77fc")) (sha256
(patches (search-patches "gtk3-respect-GUIX_GTK3_PATH.patch" (base32
"gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch")))) "12ipk1d376bai9v820qzhxba93kkh5abi6mhyqr4hwjvqmkl77fc"))
(propagated-inputs (patches (search-patches "gtk3-respect-GUIX_GTK3_PATH.patch"
`(("at-spi2-atk" ,at-spi2-atk) "gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch"))))
("atk" ,atk) (propagated-inputs
;; SVG support is optional and requires librsvg, which pulls in rust. `(("at-spi2-atk" ,at-spi2-atk)
;; Rust is not supported well on every architecture yet. ("atk" ,atk)
("gdk-pixbuf" ,(if (string-prefix? "x86_64" (or (%current-target-system) ;; SVG support is optional and requires librsvg, which pulls in rust.
(%current-system))) ;; Rust is not supported well on every architecture yet.
gdk-pixbuf+svg ("gdk-pixbuf" ,(if (string-prefix? "x86_64" (or (%current-target-system)
gdk-pixbuf)) (%current-system)))
("libepoxy" ,libepoxy) gdk-pixbuf+svg
("libxcursor" ,libxcursor) gdk-pixbuf))
("libxi" ,libxi) ("libepoxy" ,libepoxy)
("libxinerama" ,libxinerama) ("libxcursor" ,libxcursor)
("libxkbcommon" ,libxkbcommon) ("libxi" ,libxi)
("libxdamage" ,libxdamage) ("libxinerama" ,libxinerama)
("libxrandr" ,libxrandr) ("libxkbcommon" ,libxkbcommon)
("mesa" ,mesa) ("libxdamage" ,libxdamage)
("pango" ,pango) ("libxrandr" ,libxrandr)
("wayland" ,wayland) ("mesa" ,mesa)
("wayland-protocols" ,wayland-protocols))) ("pango" ,pango)
(inputs ("wayland" ,wayland)
`(("libxml2" ,libxml2) ("wayland-protocols" ,wayland-protocols)))
;; XXX: colord depends on mozjs (through polkit), which fails on (inputs
;; on non-intel systems now. `(("libxml2" ,libxml2)
;;("colord" ,colord) ;; XXX: colord depends on mozjs (through polkit), which fails on
("cups" ,cups) ;for printing support ;; on non-intel systems now.
;; XXX: rest depends on p11-kit, which fails on mips64el now. ;;("colord" ,colord)
;;("rest" ,rest) ("cups" ,cups) ;for printing support
("json-glib" ,json-glib))) ;; XXX: rest depends on p11-kit, which fails on mips64el now.
(native-inputs ;;("rest" ,rest)
`(("perl" ,perl) ("json-glib" ,json-glib)))
("glib" ,glib "bin") (native-inputs
("gettext" ,gettext-minimal) `(("perl" ,perl)
("pkg-config" ,pkg-config) ("glib" ,glib "bin")
("gobject-introspection" ,gobject-introspection) ("gettext" ,gettext-minimal)
("python-wrapper" ,python-wrapper) ("pkg-config" ,pkg-config)
;; By using a special xorg-server for GTK+'s tests, we reduce the impact ("gobject-introspection" ,gobject-introspection)
;; of updating xorg-server directly on the master branch. ("python-wrapper" ,python-wrapper)
("xorg-server" ,xorg-server-for-tests))) ;; By using a special xorg-server for GTK+'s tests, we reduce the impact
(arguments ;; of updating xorg-server directly on the master branch.
`(#:disallowed-references (,xorg-server-for-tests) ("xorg-server" ,xorg-server-for-tests)))
;; 47 MiB goes to "out" (24 of which is locale data!), and 26 MiB goes (arguments
;; to "doc". `(#:disallowed-references (,xorg-server-for-tests)
#:configure-flags (list (string-append "--with-html-dir=" ;; 47 MiB goes to "out" (24 of which is locale data!), and 26 MiB goes
(assoc-ref %outputs "doc") ;; to "doc".
"/share/gtk-doc/html") #:configure-flags (list (string-append "--with-html-dir="
;; The header file <gdk/gdkwayland.h> is required (assoc-ref %outputs "doc")
;; by gnome-control-center "/share/gtk-doc/html")
"--enable-wayland-backend" ;; The header file <gdk/gdkwayland.h> is required
;; This is necessary to build both backends. ;; by gnome-control-center
"--enable-x11-backend" "--enable-wayland-backend"
;; This enables the HTML5 websocket backend. ;; This is necessary to build both backends.
"--enable-broadway-backend") "--enable-x11-backend"
#:phases (modify-phases %standard-phases ;; This enables the HTML5 websocket backend.
(add-before 'configure 'pre-configure "--enable-broadway-backend")
(lambda _ #:phases
;; Disable most tests, failing in the chroot with the message: (modify-phases %standard-phases
;; D-Bus library appears to be incorrectly set up; failed to read (add-after 'unpack 'disable-failing-tests
;; machine uuid: Failed to open "/etc/machine-id": No such file or (lambda _
;; directory. (substitute* "testsuite/gtk/Makefile.in"
;; See the manual page for dbus-uuidgen to correct this issue. (("builderparser cellarea check-icon-names check-cursor-names")
(substitute* "testsuite/Makefile.in" "builderparser cellarea check-cursor-names")
(("SUBDIRS = gdk gtk a11y css reftests") (("notify no-gtk-init object objects-finalize papersize rbtree")
"SUBDIRS = gdk")) "no-gtk-init papersize rbtree")
#t)) (("stylecontext templates textbuffer textiter treemodel treepath")
(add-after 'install 'move-desktop-files "stylecontext textbuffer textiter treemodel treepath"))
;; Move desktop files into 'bin' to avoid cycle references. (substitute* "testsuite/a11y/Makefile.in"
(lambda* (#:key outputs #:allow-other-keys) (("accessibility-dump tree-performance text children derive")
(let ((out (assoc-ref outputs "out")) "tree-performance text children derive"))
(bin (assoc-ref outputs "bin"))) (substitute* "testsuite/reftests/Makefile.in"
(mkdir-p (string-append bin "/share")) (("TEST_PROGS = gtk-reftest")
(rename-file (string-append out "/share/applications") "TEST_PROGS = "))
(string-append bin "/share/applications")) #t))
#t)))))) (add-before 'check 'pre-check
(native-search-paths (lambda _
(list (search-path-specification ;; Tests require a running X server.
(variable "GUIX_GTK3_PATH") (system "Xvfb :1 +extension GLX &")
(files '("lib/gtk-3.0"))))))) (setenv "DISPLAY" ":1")
;; Tests write to $HOME.
(setenv "HOME" (getcwd))
;; Tests look for $XDG_RUNTIME_DIR.
(setenv "XDG_RUNTIME_DIR" (getcwd))
;; For missing '/etc/machine-id'.
(setenv "DBUS_FATAL_WARNINGS" "0")
#t))
(add-after 'install 'move-desktop-files
;; Move desktop files into 'bin' to avoid cycle references.
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(bin (assoc-ref outputs "bin")))
(mkdir-p (string-append bin "/share"))
(rename-file (string-append out "/share/applications")
(string-append bin "/share/applications"))
#t))))))
(native-search-paths
(list (search-path-specification
(variable "GUIX_GTK3_PATH")
(files '("lib/gtk-3.0")))))))
;;; ;;;
;;; Guile bindings. ;;; Guile bindings.