aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-06-28 00:41:42 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-06-28 00:48:19 -0400
commit8d810c209f18ffb635a1db2488a939543c6f060f (patch)
treef7fe5d583b5e2b23574c3e8f7d944335cb708c8b
parentb5e85191f96691b00f3612965e6edc09003c61a7 (diff)
downloadguix-8d810c209f18ffb635a1db2488a939543c6f060f.tar.gz
guix-8d810c209f18ffb635a1db2488a939543c6f060f.zip
h-client: Do not fail in pure environments.
Fixes <https://issues.guix.gnu.org/56223>. * gnu/packages/hardware.scm (h-client)[imported-modules]: New argument. [modules]: Likewise. [phases]{generate-gdk-pixbuf-loaders-cache-file} {glib-or-gtk-compile-schemas, glib-or-gtk-wrap}: Add glib-or-gtk phases. {wrap-more}: Wrap GI_TYPELIB_PATH and PATH. [inputs]: Add gobject-introspection and guile-3.0. Reported-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--gnu/packages/hardware.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index acc3fb3059..ecff498156 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -84,6 +84,7 @@
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system gnu)
#:use-module (guix build-system meson)
#:use-module (guix build-system perl)
@@ -598,8 +599,36 @@ human-readable format and checks if it conforms to the standards.")
(sha256
(base32 "0hm86d51kj5r3yxq4c23aa57cs8igz3wrkbjn20z4frx75rpf46m"))))
(build-system python-build-system)
+ (arguments
+ (list
+ #:imported-modules `(,@%python-build-system-modules
+ ,@%glib-or-gtk-build-system-modules)
+ #:modules '(((guix build glib-or-gtk-build-system) #:prefix glib:)
+ (guix build python-build-system)
+ (guix build utils))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
+ (assoc-ref glib:%standard-phases
+ 'generate-gdk-pixbuf-loaders-cache-file))
+ (add-after 'install 'glib-or-gtk-compile-schemas
+ (assoc-ref glib:%standard-phases 'glib-or-gtk-compile-schemas))
+ (add-after 'install 'glib-or-gtk-wrap
+ (assoc-ref glib:%standard-phases 'glib-or-gtk-wrap))
+ (add-after 'glib-or-gtk-wrap 'wrap-more
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (wrap-script (search-input-file outputs "bin/h-client")
+ ;; Wrap GI_TYPELIB_PATH to avoid the error "ValueError:
+ ;; Namespace GdkPixbuf not available".
+ `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))
+ `("PATH" = (,(dirname (search-input-file
+ inputs "sbin/lspci"))
+ ,(dirname (search-input-file
+ inputs "bin/lsusb"))))))))))
(inputs
(list gdk-pixbuf
+ gobject-introspection ;for GI_TYPELIB_PATH
+ guile-3.0
gtk+
pciutils
python-pycurl