gnu: perl-gtk2: Fix tests.

This fixes <https://issues.guix.gnu.org/75471>.

* gnu/packages/gtk.scm (perl-gtk2)[inputs]: Add gdk-pixbuf.
[arguments]: Set GDK_PIXBUF_MODULE_FILE in 'fix-tests phase.

Change-Id: Ic5013d66d5b5eefa59e156f0d48dfc113237de14
This commit is contained in:
宋文武 2025-01-10 11:36:51 +08:00
parent 4c8ea86e8c
commit 3104c70fae
No known key found for this signature in database
GPG key ID: D415BF253B515976

View file

@ -2125,19 +2125,24 @@ (define-public perl-gtk2
(native-inputs (native-inputs
(list perl-extutils-depends perl-extutils-pkgconfig pkg-config)) (list perl-extutils-depends perl-extutils-pkgconfig pkg-config))
(inputs (inputs
(list gtk+-2)) (list gtk+-2 gdk-pixbuf))
(propagated-inputs (propagated-inputs
(list perl-pango)) (list perl-pango))
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases
(add-before 'build 'remove-broken-test #~(modify-phases %standard-phases
;; See https://gitlab.gnome.org/GNOME/perl-gtk2/issues/3. (add-before 'build 'fix-tests
(lambda _ (lambda _
(substitute* "t/GdkPixbuf.t" ;; XXX: by default it uses 'loaders.cache' from librsvg, which supports SVG only.
(("tests => 112") "tests => 111") (setenv "GDK_PIXBUF_MODULE_FILE"
(("ok \\(defined \\$pixbuf, \"Don't crash on partial pixmap data\"\\);") (string-append #$(this-package-input "gdk-pixbuf")
"# ok (defined $pixbuf, \"Don't crash on partial pixmap data\");"))))))) "/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"))
;; See https://gitlab.gnome.org/GNOME/perl-gtk2/issues/3.
(substitute* "t/GdkPixbuf.t"
(("tests => 112") "tests => 111")
(("ok \\(defined \\$pixbuf, \"Don't crash on partial pixmap data\"\\);")
"# ok (defined $pixbuf, \"Don't crash on partial pixmap data\");")))))))
(home-page "https://metacpan.org/release/Gtk2") (home-page "https://metacpan.org/release/Gtk2")
(synopsis "Perl interface to the 2.x series of the Gimp Toolkit library") (synopsis "Perl interface to the 2.x series of the Gimp Toolkit library")
(description "Perl bindings to the 2.x series of the Gtk+ widget set. (description "Perl bindings to the 2.x series of the Gtk+ widget set.