Subject: [PATCH 2/7] gnu: zathura: Update to 0.5.11.

From: Andrew Wong <[email-masked]>
Date: Fri, 21 Mar 2025 17:11:54 -0400

* gnu/packages/pdf.scm (zathura): Update to 0.5.11.
[arguments] <#:phases>: Refactor.

Change-Id: I343c46cb3787f19b5c6dfa531ced01d86b957883
---
 gnu/packages/pdf.scm | 69 ++++++++++++++++----------------------------
 1 file changed, 25 insertions(+), 44 deletions(-)

diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 23348e49d5..ce23c8bf7a 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -693,56 +693,37 @@ (define-public zathura-pdf-poppler
 (define-public zathura
   (package
     (name "zathura")
-    (version "0.5.6")
-    (source (origin
-              (method url-fetch)
-              (uri
-               (string-append "https://pwmt.org/projects/zathura/download/zathura-"
-                              version ".tar.xz"))
-              (sha256
-               (base32
-                "1nhhdww8z6i2cmj7n6qjgyh49dy4jf0xq4j13djpvrfchxgf6y5l"))))
+    (version "0.5.11")
+    (source
+     (origin (method url-fetch)
+             (uri (string-append "https://pwmt.org/projects/zathura"
+                                 "/download/zathura-" version ".tar.xz"))
+             (sha256
+              (base32 "0g5ms7rna8zkp34d5p461iwlpgkv2a0lm4rfxzxbh3xgk2cqlial"))))
     (build-system meson-build-system)
     (arguments
-     (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-before 'check 'start-xserver
-            ;; Tests require a running X server.
-            (lambda* (#:key inputs #:allow-other-keys)
-              (let ((display ":1"))
-                (setenv "DISPLAY" display)
-
-                ;; On busy machines, tests may take longer than
-                ;; the default of four seconds.
-                (setenv "CK_DEFAULT_TIMEOUT" "20")
-
-                ;; Don't fail due to missing '/etc/machine-id'.
-                (setenv "DBUS_FATAL_WARNINGS" "0")
-                (zero? (system (string-append
-                                (search-input-file inputs "/bin/Xvfb")
-                                " " display " &")))))))))
-    (native-inputs
-     (list pkg-config
-           gettext-minimal
-           (list glib "bin")
-
-           ;; For building documentation.
-           python-sphinx
-
-           ;; For building icons.
-           (librsvg-for-system)
-
-           ;; For tests.
-           check
-           xorg-server-for-tests))
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-before 'check 'start-xserver-for-tests
+                          (lambda* (#:key inputs #:allow-other-keys)
+                            (setenv "DISPLAY" ":1")
+                            ;; On busy machines, tests may take longer than
+                            ;; the default of four seconds.
+                            (setenv "CK_DEFAULT_TIMEOUT" "20")
+                            ;; Don't fail due to missing '/etc/machine-id'.
+                            (setenv "DBUS_FATAL_WARNINGS" "0")
+                            ((compose zero? system)
+                             (string-append (assoc-ref inputs "xorg-server")
+                                            "/bin/Xvfb :1 &")))))))
+    (native-inputs (list pkg-config gettext-minimal (list glib "bin")
+                         python-sphinx   ; For building documentation.
+                         (librsvg-for-system) ; For building icons.
+                         check xorg-server-for-tests)) ; For tests.
     (inputs (list sqlite))
     ;; Listed in 'Requires.private' of 'zathura.pc'.
     (propagated-inputs (list cairo girara))
     (native-search-paths
-     (list (search-path-specification
-            (variable "ZATHURA_PLUGINS_PATH")
-            (files '("lib/zathura")))))
+     (list (search-path-specification (variable "ZATHURA_PLUGINS_PATH")
+                                      (files '("lib/zathura")))))
     (home-page "https://pwmt.org/projects/zathura/")
     (synopsis "Lightweight keyboard-driven PDF viewer")
     (description "Zathura is a customizable document viewer.  It provides a
-- 
2.48.1