diff mbox series

[bug#66099,WIP,gnome-team,v2,3/3] gnu: upower: Update to 1.90.2.

Message ID 4b7bd62cdef6986e0d659816ada6cb0bf3d60cdc.1696070591.git.vivien@planete-kraus.eu
State New
Headers show
Series Nicer eudev, upower still fails | expand

Commit Message

Vivien Kraus Sept. 19, 2023, 11:32 a.m. UTC
The new eudev now can install hwdb files. Upower has some, but they should get
installed in upower’s output, not eudev’s.

The phases needed a rework. Now the 32-bit-specific test fix is always there,
except it may be empty.

Upower tests now requires that upower-provided hwdb files be installed. So I
call udevadm hwdb --update first.

* gnu/packages/gnome.scm (upower): Update to 1.90.2.
[#:configure-flags]: Set udevhwdbdir.
[#:phases] <adjust-test-for-excess-precision>: Add this phase
unconditionnally
<check>: Move it after 'install, and call set up hwdb first.
---
 gnu/packages/gnome.scm | 52 ++++++++++++++++++++++++++++++------------
 1 file changed, 37 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 4ea3dc455a..0c240dbb9a 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5727,7 +5727,7 @@  (define-public geocode-glib-with-libsoup2
 (define-public upower
   (package
     (name "upower")
-    (version "1.90.0")
+    (version "1.90.2")
     (source
      (origin
        (method git-fetch)
@@ -5736,7 +5736,7 @@  (define-public upower
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1g17rm91p8vfpjyb0k2shylrs55nccn3fa890vlk4n9s71sghbzq"))
+        (base32 "13xp423ycv8imf2cmgf6lii9f01p7x2v19cny7acrmczkc0cqv7d"))
        (modules '((guix build utils)))
        (snippet
         ;; Upstream commit <https://cgit.freedesktop.org/upower/commit/
@@ -5759,19 +5759,41 @@  (define-public upower
               ;; If not specified, udev will try putting history information
               ;; in /gnu/store.
               "-Dhistorydir=/var/lib/upower"
-              (string-append "-Dudevrulesdir=" #$output "/bin/udev/rules.d"))
-      #:phases (if (target-x86-32?)
-                   #~(modify-phases %standard-phases
-                       (add-after 'unpack 'adjust-test-for-excess-precision
-                         (lambda _
-                           ;; Address test failure caused by excess precision
-                           ;; on i686:
-                           ;; <https://gitlab.freedesktop.org/upower/upower/-/issues/214>.
-                           (substitute* "src/linux/integration-test.py"
-                             (("assertEqual(.*)40\\.0" _ middle)
-                              (string-append
-                               "assertAlmostEqual" middle "40.0"))))))
-                   #~%standard-phases)))
+              (string-append "-Dudevrulesdir=" #$output "/bin/udev/rules.d")
+              (string-append "-Dudevhwdbdir=" #$output "/lib/udev/hwdb.d"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'adjust-test-for-excess-precision
+            (lambda _
+              #$@(if (target-x86-32?)
+                     ;; Address test failure caused by excess precision
+                     ;; on i686:
+                     ;; <https://gitlab.freedesktop.org/upower/upower/-/issues/214>.
+                     '((substitute* "src/linux/integration-test.py"
+                         (("assertEqual(.*)40\\.0" _ middle)
+                          (string-append
+                           "assertAlmostEqual" middle "40.0"))))
+                     '(*unspecified*))))
+          (delete 'check) ;; move after the install phase
+          (add-after 'install 'check
+            (lambda* (#:key parallel-tests? tests? #:allow-other-keys)
+              (when tests?
+                (setenv "UDEV_HWDB_PATH"
+                        (apply string-append #$output "/lib/udev/hwdb.d"
+                               (let ((p (getenv "HWDB_BIN_PATH")))
+                                 (if p
+                                     (list ":" p)
+                                     '()))))
+                (let ((hwdb.bin (string-append (getcwd) "/test-hwdb.bin")))
+                  (invoke "udevadm" "hwdb" "--update"
+                          "-o" hwdb.bin)
+                  (setenv "UDEV_HWDB_BIN" hwdb.bin))
+                (setenv "MESON_TESTTHREADS"
+                        (if parallel-tests?
+                            (number->string (parallel-job-count))
+                            "1"))
+                (invoke "dbus-run-session" "--"
+                        "meson" "test" "-t" "0")))))))
     (native-inputs
      (list `(,glib "bin")               ; for gdbus-codegen
            gobject-introspection