unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49934] [PATCH 1/3] gnu: Add libx86emu
@ 2021-08-07 21:58 phodina via Guix-patches via
  2021-08-07 22:03 ` [bug#49934] Subject: [PATCH 2/3] gnu: Add hwinfo phodina via Guix-patches via
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: phodina via Guix-patches via @ 2021-08-07 21:58 UTC (permalink / raw)
  To: 49934

* gnu/packages/hardware.scm: (libx86emu): New variable.

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 707a47fb4b..93be54cb18 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2021 Evgeny Pisemsky <evgeny@pisemsky.com>
 ;;; Copyright © 2021 Léo Le Bouter <lle-bout@zaclys.net>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@

 (define-module (gnu packages hardware)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
@@ -45,6 +47,7 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
@@ -256,6 +259,54 @@ specific SMBIOS tables.")
     (license
      (list license:osl2.1 license:gpl2+ license:bsd-3 license:boost1.0))))

+(define-public libx86emu
+(package
+  (name "libx86emu")
+  (version "3.1")
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+             (url "https://github.com/wfeldt/libx86emu")
+             (commit version)))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b"))))
+  (build-system gnu-build-system)
+  (arguments
+    `(#:make-flags (list
+                    (string-append "CC=" ,(cc-for-target))
+                    (string-append "DESTDIR=" %output)
+                    (string-append "LIBDIR=/lib"))
+      #:phases (modify-phases %standard-phases
+                (delete 'configure)
+                (add-after 'unpack 'fix-version-and-usr
+                 (lambda* (#:key inputs #:allow-other-keys)
+                  (delete-file "git2log")
+                  (let* ((file (open-file "VERSION" "a")))
+                   (display ,version file)
+                   (close-port file))
+                  (substitute* "Makefile"
+                           (("/usr") "/"))))
+                (replace 'check
+                 (lambda* _
+                  (invoke "make" "test"))))))
+  (native-inputs `(("git" ,git) ("perl" ,perl) ("nasm" ,nasm)))
+  (synopsis "Library for x86 emulation")
+  (description "Small library to emulate x86 instructions.  The focus here
+is not a complete emulation (go for qemu for this) but to cover enough for
+typical firmware blobs.
+@enumerate
+@item intercept any memory access or directly map real memory ranges
+@item intercept any i/o access, map real i/o ports, or block any real i/o
+@item intercept any interrupt
+@item provides hook to run after each instruction
+@item recognizes a special x86 instruction that can trigger logging
+@item has integrated logging
+@end enumerate")
+  (home-page "https://github.com/wfeldt/libx86emu")
+  (license license:bsd-1)))
+
 ;; Distinct from memtest86, which is obsolete.
 (define-public memtest86+
   (package
--
2.32.0




^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#49934] Subject: [PATCH 2/3] gnu: Add hwinfo.
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
@ 2021-08-07 22:03 ` phodina via Guix-patches via
  2021-08-07 22:05 ` [bug#49934] Subject: [PATCH 3/3] gnu: Add hw-probe phodina via Guix-patches via
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: phodina via Guix-patches via @ 2021-08-07 22:03 UTC (permalink / raw)
  To: 49934@debbugs.gnu.org

* gnu/packages/hardware.scm: (hwinfo): New variable.

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 93be54cb18..bcba8bd9e4 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -32,6 +32,7 @@
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages flex)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
@@ -172,6 +173,54 @@ through the Display Data Channel Command Interface (@dfn{DDC/CI}) protocol.")
 human-readable format and checks if it conforms to the standards.")
       (license license:expat))))

+(define-public hwinfo
+(package
+  (name "hwinfo")
+  (version "21.75")
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+             (url "https://github.com/openSUSE/hwinfo")
+             (commit version)))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "139bgzwi8iy1dz0g8mqpq9iig8klsmnb5c2sp0v7qgbgh7xxnqn3"))))
+  (build-system gnu-build-system)
+  (arguments
+    `(#:tests? #f ; no tests
+      ;; disable as there is a bug where the src/hd is not build as dependency
+      #:parallel-build? #f
+      #:make-flags (list
+                    (string-append "DESTDIR=" %output)
+                    (string-append "LDFLAGS=-Lsrc -Wl,-rpath=" %output "/lib")
+                    (string-append "CC=" ,(cc-for-target))
+                    (string-append "HWINFO_VERSION=" ,version))
+      #:phases (modify-phases %standard-phases
+                (delete 'configure)
+                (add-after 'unpack 'fix-sbin-and-flex
+                 (lambda* (#:key inputs #:allow-other-keys)
+                  (delete-file "git2log")
+                  (let* ((file (open-file "VERSION" "a")))
+                   (display ,version file)
+                   (close-port file))
+                  (substitute* "Makefile"
+                           (("/sbin") "/bin")
+                           (("/usr/lib.*") "/lib\n")
+                           (("^TARGETS.*") "TARGETS = hwinfo hwinfo.pc\n")
+                           (("/usr") "/"))
+                  (substitute* "src/isdn/cdb/Makefile"
+                           (("lex isdn_cdb.lex") "flex isdn_cdb.lex"))
+                  (substitute* "hwinfo.pc.in"
+                           (("prefix=/usr") (string-append "prefix=" %output))))))))
+  (native-inputs `(("flex" ,flex) ("perl" ,perl) ("pkg-config" ,pkg-config)))
+  (inputs `(("libx86emu" ,libx86emu) ("util-linux:lib" ,util-linux "lib")))
+  (synopsis "Hardware information tool")
+  (description "Probe for the hardware present in the system.  It can be used
+to generate a system overview log which can be later used for support.")
+  (home-page "https://github.com/openSUSE/hwinfo")
+  (license license:gpl2)))
+
 (define-public i7z
   (let ((revision "0")
         (commit "1a41ff13db747e962456ddbb5ccb2b7fc43ca0cb"))
--
2.32.0




^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#49934] Subject: [PATCH 3/3] gnu: Add hw-probe.
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
  2021-08-07 22:03 ` [bug#49934] Subject: [PATCH 2/3] gnu: Add hwinfo phodina via Guix-patches via
@ 2021-08-07 22:05 ` phodina via Guix-patches via
  2021-08-08 10:10 ` [bug#49934] [PATCH 1/3] gnu: Add libx86emu pelzflorian (Florian Pelz)
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: phodina via Guix-patches via @ 2021-08-07 22:05 UTC (permalink / raw)
  To: 49934@debbugs.gnu.org

* gnu/packages/hardware.scm: (hw-probe): New variable.

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index bcba8bd9e4..1891dc475b 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -173,6 +173,36 @@ through the Display Data Channel Command Interface (@dfn{DDC/CI}) protocol.")
 human-readable format and checks if it conforms to the standards.")
       (license license:expat))))

+(define-public hw-probe
+(package
+  (name "hw-probe")
+  (version "f450cad0cf686756c32689595e6d0092933e5959") ; no tags
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+             (url "https://github.com/linuxhw/hw-probe")
+             (commit version)))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "16qh5nzv42sg5r6bjg0a9vcmmva87vnw4d778b35zs5gm3gzw370"))))
+  (build-system gnu-build-system)
+  (arguments
+    '(#:tests? #f
+      #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")) "prefix=")
+      #:phases (modify-phases %standard-phases
+                (delete 'configure))))
+  (inputs `(("perl" ,perl)
+            ("hwinfo" ,hwinfo)))
+  (propagated-inputs `(("dmidecode" ,dmidecode)
+                       ("smartmontools" ,smartmontools)
+                       ("edid-decode" ,edid-decode)))
+  (synopsis "Probe for hardware, check operability and find drivers")
+  (description "Tool to probe for hardware, check operability and find drivers
+with the help of Linux hardware database: https://linux-hardware.org")
+  (home-page "https://github.com/linuxhw/hw-probe")
+  (license license:lgpl2.1)))
+
 (define-public hwinfo
 (package
   (name "hwinfo")
--
2.32.0




^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#49934] [PATCH 1/3] gnu: Add libx86emu
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
  2021-08-07 22:03 ` [bug#49934] Subject: [PATCH 2/3] gnu: Add hwinfo phodina via Guix-patches via
  2021-08-07 22:05 ` [bug#49934] Subject: [PATCH 3/3] gnu: Add hw-probe phodina via Guix-patches via
@ 2021-08-08 10:10 ` pelzflorian (Florian Pelz)
  2021-08-09 12:00   ` phodina via Guix-patches via
  2021-08-30 21:34 ` [bug#49934] Hw-Probe Raghav Gururajan via Guix-patches via
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: pelzflorian (Florian Pelz) @ 2021-08-08 10:10 UTC (permalink / raw)
  To: phodina; +Cc: 49934, Vincent Legoll

On Sat, Aug 07, 2021 at 09:58:55PM +0000, phodina via Guix-patches via wrote:
> +  (home-page "https://github.com/wfeldt/libx86emu")

FYI this is the same package as <http://issues.guix.gnu.org/45744>.

I don’t know what became of it.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] [PATCH 1/3] gnu: Add libx86emu
  2021-08-08 10:10 ` [bug#49934] [PATCH 1/3] gnu: Add libx86emu pelzflorian (Florian Pelz)
@ 2021-08-09 12:00   ` phodina via Guix-patches via
  2021-08-09 17:06     ` pelzflorian (Florian Pelz)
  0 siblings, 1 reply; 17+ messages in thread
From: phodina via Guix-patches via @ 2021-08-09 12:00 UTC (permalink / raw)
  To: pelzflorian (Florian Pelz); +Cc: 49934, Vincent Legoll

Hi

On Sunday, August 8th, 2021 at 12:10 PM, pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de> wrote:

> On Sat, Aug 07, 2021 at 09:58:55PM +0000, phodina via Guix-patches via wrote:
>
> > -   (home-page "https://github.com/wfeldt/libx86emu")
>
> FYI this is the same package as http://issues.guix.gnu.org/45744.
>
> I don’t know what became of it.

Thanks. I didn't know there's a patch already. The aim of this one is to get the hwinfo and hw-prober to get the hardware details.

I've not encountered this situation. So what do you think is the best approach?

Use the patch from Vincent Legoll and refactor the other two?

So that both issues are closed?

Kind regards
Petr




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] [PATCH 1/3] gnu: Add libx86emu
  2021-08-09 12:00   ` phodina via Guix-patches via
@ 2021-08-09 17:06     ` pelzflorian (Florian Pelz)
  0 siblings, 0 replies; 17+ messages in thread
From: pelzflorian (Florian Pelz) @ 2021-08-09 17:06 UTC (permalink / raw)
  To: phodina; +Cc: 49934, Vincent Legoll

On Mon, Aug 09, 2021 at 12:00:00PM +0000, phodina wrote:
> Thanks. I didn't know there's a patch already. The aim of this one is to get the hwinfo and hw-prober to get the hardware details.

I think it is good to get your patch into shape and merged.  While I
haven’t been involved in package review (shame on me), I’ll give it a
try.

You should, after applying each of your patches, cd to the guix repo
and run `./etc/indent-code.el gnu/packages/hardware.scm` as described
in `info '(guix)Formatting Code'`.

`./pre-inst-env guix lint libx86emu` warns that your custom check
phase does not consider #:tests?  (i.e. it does not work with the
--without-tests transform option).

As for the package libx86emu proper:

> (define-public libx86emu
>   (package
>     (name "libx86emu")
>     (version "3.1")
>     (source (origin
>               (method git-fetch)
>               (uri (git-reference
>                     (url "https://github.com/wfeldt/libx86emu")
>                     (commit version)))
>               (file-name (git-file-name name version))
>               (sha256
>                (base32
>                 "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b"))))
>     (build-system gnu-build-system)
>     (arguments
>      `(#:make-flags (list
>                      (string-append "CC=" ,(cc-for-target))
>                      (string-append "DESTDIR=" %output)
>                      (string-append "LIBDIR=/lib"))
>        #:phases (modify-phases %standard-phases
>                   (delete 'configure)
>                   (add-after 'unpack 'fix-version-and-usr
>                     (lambda* (#:key inputs #:allow-other-keys)
>                       (delete-file "git2log")

I am not sure, would it be better to delete this git2log in an origin
snippet?  I have not checked.



>                       (let* ((file (open-file "VERSION" "a")))
>                         (display ,version file)
>                         (close-port file))
>                       (substitute* "Makefile"
>                         (("/usr") "/"))))
>                   (replace 'check
>                     (lambda* _
>                       (invoke "make" "test"))))))
>     (native-inputs `(("git" ,git) ("perl" ,perl) ("nasm" ,nasm)))
>     (synopsis "Library for x86 emulation")
>     (description "Small library to emulate x86 instructions.  The focus here
> is not a complete emulation (go for qemu for this) but to cover enough for
> typical firmware blobs.

The start of the sentence is missing before @enumerate.  “You can”?

> @enumerate
> @item intercept any memory access or directly map real memory ranges
> @item intercept any i/o access, map real i/o ports, or block any real i/o
> @item intercept any interrupt
> @item provides hook to run after each instruction

Either “provides a hook” or “provides hooks”.


> @item recognizes a special x86 instruction that can trigger logging

s/recognizes/recognize/


> @item has integrated logging

Maybe s/has/use/


> @end enumerate")
>     (home-page "https://github.com/wfeldt/libx86emu")
>     (license license:bsd-1)))

The license is not bsd-1 but x11-style, I think.

Regards,
Florian




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] Hw-Probe
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
                   ` (2 preceding siblings ...)
  2021-08-08 10:10 ` [bug#49934] [PATCH 1/3] gnu: Add libx86emu pelzflorian (Florian Pelz)
@ 2021-08-30 21:34 ` Raghav Gururajan via Guix-patches via
  2021-10-01 23:19 ` [bug#49934] [PATCH] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-08-30 21:34 UTC (permalink / raw)
  To: phodina; +Cc: 49934


[-- Attachment #1.1.1: Type: text/plain, Size: 114 bytes --]

Hi Petr!

I have merged #49934 and #50283.

I'll combine our patches and send a new one. :)

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] [PATCH] gnu: Add hw-probe.
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
                   ` (3 preceding siblings ...)
  2021-08-30 21:34 ` [bug#49934] Hw-Probe Raghav Gururajan via Guix-patches via
@ 2021-10-01 23:19 ` Raghav Gururajan via Guix-patches via
  2021-10-02  9:58   ` Maxime Devos
  2021-10-01 23:26 ` [bug#49934] HwInfo Raghav Gururajan via Guix-patches via
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-10-01 23:19 UTC (permalink / raw)
  To: 49934; +Cc: Raghav Gururajan, pelzflorian, Petr Hodina

* gnu/packages/hardware.scm (hw-probe): New variable.

Co-authored-by: Petr Hodina <phodina@protonmail.com>
---
 gnu/packages/hardware.scm | 491 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 491 insertions(+)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index d000ab8ce6..9a3fa86edc 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -26,20 +26,29 @@
 (define-module (gnu packages hardware)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages avahi)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
+  #:use-module (gnu packages cups)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages debian)
+  #:use-module (gnu packages disk)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages package-management)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages pciutils)
@@ -51,14 +60,19 @@
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages scanner)
+  #:use-module (gnu packages security-token)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages virtualization)
+  #:use-module (gnu packages vulkan)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -70,6 +84,483 @@
 ;; This is a module for packages related to physical hardware that don't (yet)
 ;; have a more specific home like gps.scm, security-token.scm, &c.
 
+(define-public hw-probe
+  (package
+    (name "hw-probe")
+    (version "1.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/linuxhw/hw-probe")
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1zyaardfw6r9nwxbkbb68hyl8719xn8sxpbgm7czkvsbjrim11n8"))))
+    (build-system perl-build-system)
+    (arguments
+     `(#:tests? #f                      ;no test target
+       #:imported-modules
+       (,@%perl-build-system-modules)
+       #:modules
+       ((guix build perl-build-system)
+        (guix build utils)
+        (srfi srfi-26))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               ;; Correct install prefix.
+               (substitute* "Makefile"
+                 (("/usr") out)))
+             ;; Use absolute paths to referenced programs.
+             (substitute* "hw-probe.pl"
+               (("Cmd\\(\"acpi")
+                (format #f "Cmd(\"~a/bin/acpi"
+                        (assoc-ref inputs "acpi")))
+               (("Cmd\\(\"acpidump")
+                (format #f "Cmd(\"~a/bin/acpidump"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"acpixtract")
+                (format #f "Cmd(\"~a/bin/acpixtract"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"alsactl")
+                (format #f "Cmd(\"~a/bin/alsactl"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"amdconfig")
+               (format #f "Cmd(\"~a/bin/amdconfig"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"amixer")
+                (format #f "Cmd(\"~a/bin/amixer"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"apk")
+               (format #f "Cmd(\"~a/bin/apk"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"aplay")
+                (format #f "Cmd(\"~a/bin/aplay"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"arcconf")
+               (format #f "Cmd(\"~a/bin/arcconf"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"arecord")
+                (format #f "Cmd(\"~a/bin/arecord"
+                        (assoc-ref inputs "alsa-utils")))
+               (("Cmd\\(\"avahi-browse")
+                (format #f "Cmd(\"~a/bin/avahi-browse"
+                        (assoc-ref inputs "avahi")))
+               (("Cmd\\(\"biosdecode")
+                (format #f "Cmd(\"~a/sbin/biosdecode"
+                        (assoc-ref inputs "dmidecode")))
+               (("=cat")
+                (format #f "=~a/bin/cat"
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"chmod")
+                (format #f "Cmd(\"~a/bin/chmod"
+                        (assoc-ref inputs "coreutils")))
+               (("\"chmod\"")
+                (format #f "\"~a/bin/chmod\""
+                        (assoc-ref inputs "coreutils")))
+               (("\"chown\"")
+                (format #f "\"~a/bin/chown\""
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"cpuid")
+                (format #f "Cmd(\"~a/bin/cpuid"
+                        (assoc-ref inputs "cpuid")))
+               (("Cmd\\(\"cpupower")
+                (format #f "Cmd(\"~a/bin/cpupower"
+                        (assoc-ref inputs "cpupower")))
+               (("Cmd\\(\"curl")
+                (format #f "Cmd(\"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("Cmd = \"curl")
+                (format #f "Cmd = \"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("Cmd = \\(\"curl")
+                (format #f "Cmd = (\"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("\"date\"")
+                (format #f "\"~a/bin/date\""
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"dd")
+                (format #f "Cmd(\"~a/bin/dd"
+                        (assoc-ref inputs "coreutils")))
+               (("\"dd ")
+                (format #f "\"~a/bin/dd "
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"df")
+                (format #f "Cmd(\"~a/bin/df"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"dkms")
+               (format #f "Cmd(\"~a/bin/dkms"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"dmesg")
+                (format #f "Cmd(\"~a/bin/dmesg"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"dmidecode")
+                (format #f "Cmd(\"~a/sbin/dmidecode"
+                        (assoc-ref inputs "dmidecode")))
+               (("Cmd\\(\"dpkg")
+                (format #f "Cmd(\"~a/bin/dpkg"
+                        (assoc-ref inputs "dpkg")))
+               #;(("echo")
+               (format #f "~a/bin/echo"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"edid-decode")
+                (format #f "Cmd(\"~a/bin/edid-decode"
+                        (assoc-ref inputs "edid-decode")))
+               (("Cmd\\(\"efibootmgr")
+                (format #f "Cmd(\"~a/sbin/efibootmgr"
+                        (assoc-ref inputs "efibootmgr")))
+               (("Cmd\\(\"efivar")
+                (format #f "Cmd(\"~a/bin/efivar"
+                        (assoc-ref inputs "efivar")))
+               #;(("Cmd\\(\"eopkg")
+               (format #f "Cmd(\"~a/bin/eopkg"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"ethtool")
+                (format #f "Cmd(\"~a/sbin/ethtool"
+                        (assoc-ref inputs "ethtool")))
+               (("Cmd\\(\".*ethtool")
+                (format #f "Cmd(\"~a/sbin/ethtool"
+                        (assoc-ref inputs "ethtool")))
+               (("Cmd\\(\"fdisk")
+                (format #f "Cmd(\"~a/sbin/fdisk"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"fglrxinfo")
+               (format #f "Cmd(\"~a/bin/fglrxinfo"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"find")
+                (format #f "Cmd(\"~a/bin/find"
+                        (assoc-ref inputs "findutils")))
+               (("Cmd\\(\"findmnt")
+                (format #f "Cmd(\"~a/bin/findmnt"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd = \"findmnt")
+                (format #f "Cmd = \"~a/bin/findmnt"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"glxgears")
+                (format #f "Cmd(\"~a/bin/glxgears"
+                        (assoc-ref inputs "mesa-utils")))
+               (("Cmd\\(\"glxinfo")
+                (format #f "Cmd(\"~a/bin/glxinfo"
+                        (assoc-ref inputs "mesa-utils")))
+               #;(("grep")
+               (format #f "~a/bin/grep"
+               (assoc-ref inputs "grep")))
+               (("`head")
+                (format #f "`~a/bin/head"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"hciconfig")
+               (format #f "Cmd(\"~a/bin/hciconfig"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"hcitool")
+               (format #f "Cmd(\"~a/bin/hcitool"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"hddtemp")
+                (format #f "Cmd(\"~a/sbin/hddtemp"
+                        (assoc-ref inputs "hddtemp")))
+               (("Cmd\\(\"hdparm")
+                (format #f "Cmd(\"~a/sbin/hdparm"
+                        (assoc-ref inputs "hdparm")))
+               (("Cmd = \"hdparm")
+                (format #f "Cmd = \"~a/bin/hdparm"
+                        (assoc-ref inputs "hdparm")))
+               #;(("Cmd\\(\"hp-probe")
+               (format #f "Cmd(\"~a/bin/hp-probe"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"hwinfo")
+               (format #f "Cmd(\"~a/bin/hwinfo"
+               (assoc-ref inputs "hwinfo")))
+               #;(("Cmd = \"hwinfo")
+               (format #f "Cmd = \"~a/bin/hwinfo"
+               (assoc-ref inputs "hwinfo")))
+               (("Cmd\\(\"i2cdetect")
+                (format #f "Cmd(\"~a/sbin/i2cdetect"
+                        (assoc-ref inputs "i2c-tools")))
+               (("Cmd\\(\"iasl")
+                (format #f "Cmd(\"~a/bin/iasl"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"ifconfig")
+                (format #f "Cmd(\"~a/bin/ifconfig"
+                        (assoc-ref inputs "net-tools")))
+               (("Cmd\\(\"inxi")
+                (format #f "Cmd(\"~a/bin/inxi"
+                        (assoc-ref inputs "inxi")))
+               (("Cmd\\(\"iostat")
+                (format #f "Cmd(\"~a/bin/iostat"
+                        (assoc-ref inputs "sysstat")))
+               (("Cmd\\(\"ip")
+                (format #f "Cmd(\"~a/sbin/ip"
+                        (assoc-ref inputs "iproute2")))
+               (("Cmd\\(\".*ip")
+                (format #f "Cmd(\"~a/sbin/ip"
+                        (assoc-ref inputs "iproute2")))
+               (("Cmd\\(\"iw")
+                (format #f "Cmd(\"~a/sbin/iw"
+                        (assoc-ref inputs "iw")))
+               (("Cmd\\(\".*iw")
+                (format #f "Cmd(\"~a/sbin/iw"
+                        (assoc-ref inputs "iw")))
+               #;(("Cmd\\(\"iwconfig")
+               (format #f "Cmd(\"~a/bin/iwconfig"
+               (assoc-ref inputs "foobar")))
+               #;(("join")
+               (format #f "~a/bin/join"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"journalctl")
+               (format #f "Cmd(\"~a/bin/journalctl"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"ls")
+                (format #f "Cmd(\"~a/bin/ls"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"lsb_release")
+               (format #f "Cmd(\"~a/bin/lsb_release"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsblk")
+                (format #f "Cmd(\"~a/bin/lsblk"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd = \"lsblk")
+                (format #f "Cmd = \"~a/bin/lsblk"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"lscpu")
+                (format #f "Cmd(\"~a/bin/lscpu"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"lsinitrd")
+               (format #f "Cmd(\"~a/bin/lsinitrd"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsmod")
+                (format #f "Cmd(\"~a/bin/lsmod"
+                        (assoc-ref inputs "module-init-tools")))
+               (("Cmd\\(\"lspci")
+                (format #f "Cmd(\"~a/sbin/lspci"
+                        (assoc-ref inputs "pciutils")))
+               #;(("Cmd\\(\"lspnp")
+               (format #f "Cmd(\"~a/bin/lspnp"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsusb")
+                (format #f "Cmd(\"~a/bin/lsusb"
+                        (assoc-ref inputs "usbutils")))
+               (("Cmd\\(\"mcelog")
+                (format #f "Cmd(\"~a/sbin/mcelog"
+                        (assoc-ref inputs "mcelog")))
+               (("Cmd\\(\"md5sum")
+                (format #f "Cmd(\"~a/bin/md5sum"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"megactl")
+               (format #f "Cmd(\"~a/bin/megactl"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"memtester")
+                (format #f "Cmd(\"~a/bin/memtester"
+                        (assoc-ref inputs "memtester")))
+               (("Cmd\\(\"mmcli")
+                (format #f "Cmd(\"~a/bin/mmcli"
+                        (assoc-ref inputs "modem-manager")))
+               (("Cmd\\(\"modinfo")
+                (format #f "Cmd(\"~a/sbin/modinfo"
+                        (assoc-ref inputs "module-init-tools")))
+               #;(("Cmd\\(\"monitor-get-edid")
+               (format #f "Cmd(\"~a/bin/monitor-get-edid"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"mount")
+                (format #f "Cmd(\"~a/bin/mount"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"nm-tool")
+               (format #f "Cmd(\"~a/bin/nm-tool"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"nmcli")
+                (format #f "Cmd(\"~a/bin/nmcli"
+                        (assoc-ref inputs "network-manager")))
+               (("Cmd\\(\"numactl")
+                (format #f "Cmd(\"~a/bin/numactl"
+                        (assoc-ref inputs "numactl")))
+               (("Cmd\\(\"nvme")
+                (format #f "Cmd(\"~a/sbin/nvme"
+                        (assoc-ref inputs "nvme-cli")))
+               (("Cmd\\(\"opensc-tool")
+                (format #f "Cmd(\"~a/bin/opensc-tool"
+                        (assoc-ref inputs "opensc")))
+               #;(("Cmd\\(\"optirun")
+               (format #f "Cmd(\"~a/bin/optirun"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"pacman")
+               (format #f "Cmd(\"~a/bin/pacman"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"pstree")
+               (format #f "Cmd(\"~a/bin/pstree"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"rfkill")
+                (format #f "Cmd(\"~a/sbin/rfkill"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"route")
+                (format #f "Cmd(\"~a/bin/route"
+                        (assoc-ref inputs "net-tools")))
+               (("Cmd\\(\"rpm")
+                (format #f "Cmd(\"~a/bin/rpm"
+                        (assoc-ref inputs "rpm")))
+               (("Cmd\\(\"sane-find-scanner")
+                (format #f "Cmd(\"~a/bin/sane-find-scanner"
+                        (assoc-ref inputs "sane-backends")))
+               (("Cmd\\(\"scanimage")
+                (format #f "Cmd(\"~a/bin/scanimage"
+                        (assoc-ref inputs "sane-backends")))
+               (("Cmd\\(\"sensors")
+                (format #f "Cmd(\"~a/bin/sensors"
+                        (assoc-ref inputs "lm-sensors")))
+               #;(("sha512sum")
+               (format #f "~a/bin/sha512sum"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"slabtop")
+                (format #f "Cmd(\"~a/bin/slabtop"
+                        (assoc-ref inputs "procps")))
+               #;(("sleep")
+               (format #f "~a/bin/sleep"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"smartctl")
+                (format #f "Cmd(\"~a/sbin/smartctl"
+                        (assoc-ref inputs "smartmontools")))
+               (("Cmd = \"smartctl")
+                (format #f "Cmd = \"~a/bin/smartctl"
+                        (assoc-ref inputs "smartmontools")))
+               #;(("sort")
+               (format #f "~a/bin/sort"
+               (assoc-ref inputs "coreutils")))
+               #;(("split")
+               (format #f "~a/bin/split"
+               (assoc-ref inputs "coreutils")))
+               #;(("= stat")
+               (format #f "= ~a/bin/stat"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"superiotool")
+               (format #f "Cmd(\"~a/bin/superiotool"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"swupd")
+               (format #f "Cmd(\"~a/bin/swupd"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"systemctl")
+               (format #f "Cmd(\"~a/bin/systemctl"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"systemd-analyze")
+               (format #f "Cmd(\"~a/bin/systemd-analyze"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"top")
+                (format #f "Cmd(\"~a/bin/top"
+                        (assoc-ref inputs "procps")))
+               (("Cmd\\(\"udevadm")
+                (format #f "Cmd(\"~a/bin/udevadm"
+                        (assoc-ref inputs "eudev")))
+               (("Cmd\\(\"uname")
+                (format #f "Cmd(\"~a/bin/uname"
+                        (assoc-ref inputs "coreutils")))
+               #;(("unlink")
+               (format #f "~a/bin/unlink"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"update-alternatives")
+               (format #f "Cmd(\"~a/bin/update-alternatives"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"upower")
+                (format #f "Cmd(\"~a/bin/upower"
+                        (assoc-ref inputs "upower")))
+               (("Cmd\\(\"uptime")
+                (format #f "Cmd(\"~a/bin/uptime"
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"usb-devices")
+                (format #f "Cmd(\"~a/bin/usb-devices"
+                        (assoc-ref inputs "usbutils")))
+               (("Cmd\\(\"vainfo")
+                (format #f "Cmd(\"~a/bin/vainfo"
+                        (assoc-ref inputs "libva-utils")))
+               (("Cmd\\(\"vdpauinfo")
+                (format #f "Cmd(\"~a/bin/vdpauinfo"
+                        (assoc-ref inputs "vdpauinfo")))
+               (("Cmd\\(\"vulkaninfo")
+                (format #f "Cmd(\"~a/bin/vulkaninfo"
+                        (assoc-ref inputs "vulkan-tools")))
+               (("Cmd\\(\"xdpyinfo")
+                (format #f "Cmd(\"~a/bin/xdpyinfo"
+                        (assoc-ref inputs "xdpyinfo")))
+               (("Cmd\\(\"xinput")
+                (format #f "Cmd(\"~a/bin/xinput"
+                        (assoc-ref inputs "xinput")))
+               (("Cmd\\(\"xrandr")
+                (format #f "Cmd(\"~a/bin/xrandr"
+                        (assoc-ref inputs "xrandr")))
+               (("Cmd\\(\"xvinfo")
+                (format #f "Cmd(\"~a/bin/xvinfo"
+                        (assoc-ref inputs "xvinfo"))))))
+         (delete 'configure)
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-dir (string-append out "/bin/"))
+                    (perl-lib (getenv "PERL5LIB")))
+               (for-each
+                (cut wrap-program <>
+                     `("PERL5LIB" ":" prefix (,perl-lib)))
+                (find-files bin-dir))))))))
+    (inputs
+     `(("acpi" ,acpi)
+       ("acpica" ,acpica)
+       ("alsa-utils" ,alsa-utils)
+       ("avahi" ,avahi)
+       ("coreutils" ,coreutils)
+       ("cpuid" ,cpuid)
+       ("cpupower" ,cpupower)
+       ("curl" ,curl)
+       ("dmidecode" ,dmidecode)
+       ("dpkg" ,dpkg)
+       ("edid-decode" ,edid-decode)
+       ("efibootmgr" ,efibootmgr)
+       ("efivar" ,efivar)
+       ("eudev" ,eudev)
+       ("findutils" ,findutils)
+       ("grep" ,grep)
+       ("hddtemp" ,hddtemp)
+       ("hdparm" ,hdparm)
+       ("hplip" ,hplip-minimal)
+       ("i2c-tools" ,i2c-tools)
+       ("inxi" ,inxi)
+       ("iproute" ,iproute)
+       ("libva-utils" ,libva-utils)
+       ("lm-sensors" ,lm-sensors)
+       ("mcelog" ,mcelog)
+       ("memtester" ,memtester)
+       ("mesa-utils" ,mesa-utils)
+       ("modem-manager" ,modem-manager)
+       ("module-init-tools" ,module-init-tools)
+       ("net-tools" ,net-tools)
+       ("network-manager" ,network-manager)
+       ("numactl" ,numactl)
+       ("nvme-cli" ,nvme-cli)
+       ("opensc" ,opensc)
+       ("pciutils" ,pciutils)
+       ("perl-data-dumper" ,perl-data-dumper)
+       ("perl-digest-sha" ,perl-digest-sha)
+       ("perl-libwww" ,perl-libwww)
+       ;; ("pnputils" ,pnputils)
+       ("procps" ,procps)
+       ("rpm" ,rpm)
+       ("sane-backends" ,sane-backends)
+       ("smartmontools" ,smartmontools)
+       ("sysstat" ,sysstat)
+       ("upower" ,upower)
+       ("usbutils" ,usbutils)
+       ("util-linux" ,util-linux)
+       ("vdpauinfo" ,vdpauinfo)
+       ("vulkan-tools" ,vulkan-tools)
+       ("xdpyinfo" ,xdpyinfo)
+       ("xinput" ,xinput)
+       ("xrandr" ,xrandr)
+       ("xvinfo" ,xvinfo)))
+    (propagated-inputs
+     `(("hwinfo" ,hwinfo)))
+    (home-page "https://linux-hardware.org")
+    (synopsis "Hardware Probe")
+    (description "Hardware Probe is a tool to probe for hardware, check its
+operability and find drivers.")
+    (license license:lgpl2.1+)))
+
 (define-public hwinfo
   (package
     (name "hwinfo")
-- 
2.33.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#49934] HwInfo
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
                   ` (4 preceding siblings ...)
  2021-10-01 23:19 ` [bug#49934] [PATCH] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
@ 2021-10-01 23:26 ` Raghav Gururajan via Guix-patches via
  2021-12-09 11:51 ` [bug#49934] [PATCH v2] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-10-01 23:26 UTC (permalink / raw)
  To: 49934; +Cc: phodina, pelzflorian (Florian Pelz)


[-- Attachment #1.1.1: Type: text/plain, Size: 380 bytes --]

Hi,

I have sent a patch for hw-probe (https://issues.guix.gnu.org/49934#9), 
which requires some refinements.

[1] Some programs in the script are not patched, hence doesn't work in 
pure environment.
[2] Synopsis and description has to be revised.
[3] Finding a way to avoid propagation of hw-info.

@phodina, Would you be able to hack on the above.

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] [PATCH] gnu: Add hw-probe.
  2021-10-01 23:19 ` [bug#49934] [PATCH] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
@ 2021-10-02  9:58   ` Maxime Devos
  0 siblings, 0 replies; 17+ messages in thread
From: Maxime Devos @ 2021-10-02  9:58 UTC (permalink / raw)
  To: Raghav Gururajan, 49934; +Cc: pelzflorian, Petr Hodina

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]

Raghav Gururajan via Guix-patches via schreef op vr 01-10-2021 om 19:19 [-0400]:
> [...]
> +               (for-each
> +                (cut wrap-program <>
> +                     `("PERL5LIB" ":" prefix (,perl-lib)))
> +                (find-files bin-dir))))))))
> +    (inputs
> +     `(("acpi" ,acpi)
> +       ("acpica" ,acpica)
> +       ("alsa-utils" ,alsa-utils)
> +       ("avahi" ,avahi)

'wrap-program' is used, but 'bash-minimal' is not in 'inputs'.
"./pre-inst-env guix lint" should warn about this.

Greetings,
Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] [PATCH v2] gnu: Add hw-probe.
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
                   ` (5 preceding siblings ...)
  2021-10-01 23:26 ` [bug#49934] HwInfo Raghav Gururajan via Guix-patches via
@ 2021-12-09 11:51 ` Raghav Gururajan via Guix-patches via
  2021-12-09 12:18 ` [bug#49934] [PATCH v3] " Raghav Gururajan via Guix-patches via
  2021-12-16  5:53 ` [bug#49934] Hw-Probe Ricardo Wurmus
  8 siblings, 0 replies; 17+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-12-09 11:51 UTC (permalink / raw)
  To: 49934; +Cc: Raghav Gururajan, maximedevos, Petr Hodina

* gnu/packages/hardware.scm (hw-probe): New variable.

Co-authored-by: Petr Hodina <phodina@protonmail.com>
---
 gnu/packages/hardware.scm | 494 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 494 insertions(+)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 46ac96d679..90c23af90b 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -27,20 +27,29 @@
 (define-module (gnu packages hardware)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages avahi)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
+  #:use-module (gnu packages cups)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages debian)
+  #:use-module (gnu packages disk)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages package-management)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages pciutils)
@@ -52,8 +61,12 @@ (define-module (gnu packages hardware)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages scanner)
+  #:use-module (gnu packages security-token)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages virtualization)
+  #:use-module (gnu packages vulkan)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
@@ -61,6 +74,7 @@ (define-module (gnu packages hardware)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -72,6 +86,486 @@ (define-module (gnu packages hardware)
 ;; This is a module for packages related to physical hardware that don't (yet)
 ;; have a more specific home like gps.scm, security-token.scm, &c.
 
+;; NOTE: The program will lack some functionalities,
+;; until all reffered programs in 'hw-probe.pl' are packaged and patched.
+(define-public hw-probe
+  (package
+    (name "hw-probe")
+    (version "1.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/linuxhw/hw-probe")
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1zyaardfw6r9nwxbkbb68hyl8719xn8sxpbgm7czkvsbjrim11n8"))))
+    (build-system perl-build-system)
+    (arguments
+     `(#:tests? #f                      ;no test target
+       #:imported-modules
+       (,@%perl-build-system-modules)
+       #:modules
+       ((guix build perl-build-system)
+        (guix build utils)
+        (srfi srfi-26))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               ;; Correct install prefix.
+               (substitute* "Makefile"
+                 (("/usr") out)))
+             ;; Use absolute paths to referenced programs.
+             (substitute* "hw-probe.pl"
+               (("Cmd\\(\"acpi")
+                (format #f "Cmd(\"~a/bin/acpi"
+                        (assoc-ref inputs "acpi")))
+               (("Cmd\\(\"acpidump")
+                (format #f "Cmd(\"~a/bin/acpidump"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"acpixtract")
+                (format #f "Cmd(\"~a/bin/acpixtract"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"alsactl")
+                (format #f "Cmd(\"~a/bin/alsactl"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"amdconfig")
+               (format #f "Cmd(\"~a/bin/amdconfig"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"amixer")
+                (format #f "Cmd(\"~a/bin/amixer"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"apk")
+               (format #f "Cmd(\"~a/bin/apk"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"aplay")
+                (format #f "Cmd(\"~a/bin/aplay"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"arcconf")
+               (format #f "Cmd(\"~a/bin/arcconf"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"arecord")
+                (format #f "Cmd(\"~a/bin/arecord"
+                        (assoc-ref inputs "alsa-utils")))
+               (("Cmd\\(\"avahi-browse")
+                (format #f "Cmd(\"~a/bin/avahi-browse"
+                        (assoc-ref inputs "avahi")))
+               (("Cmd\\(\"biosdecode")
+                (format #f "Cmd(\"~a/sbin/biosdecode"
+                        (assoc-ref inputs "dmidecode")))
+               (("=cat")
+                (format #f "=~a/bin/cat"
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"chmod")
+                (format #f "Cmd(\"~a/bin/chmod"
+                        (assoc-ref inputs "coreutils")))
+               (("\"chmod\"")
+                (format #f "\"~a/bin/chmod\""
+                        (assoc-ref inputs "coreutils")))
+               (("\"chown\"")
+                (format #f "\"~a/bin/chown\""
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"cpuid")
+                (format #f "Cmd(\"~a/bin/cpuid"
+                        (assoc-ref inputs "cpuid")))
+               (("Cmd\\(\"cpupower")
+                (format #f "Cmd(\"~a/bin/cpupower"
+                        (assoc-ref inputs "cpupower")))
+               (("Cmd\\(\"curl")
+                (format #f "Cmd(\"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("Cmd = \"curl")
+                (format #f "Cmd = \"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("Cmd = \\(\"curl")
+                (format #f "Cmd = (\"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("\"date\"")
+                (format #f "\"~a/bin/date\""
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"dd")
+                (format #f "Cmd(\"~a/bin/dd"
+                        (assoc-ref inputs "coreutils")))
+               (("\"dd ")
+                (format #f "\"~a/bin/dd "
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"df")
+                (format #f "Cmd(\"~a/bin/df"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"dkms")
+               (format #f "Cmd(\"~a/bin/dkms"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"dmesg")
+                (format #f "Cmd(\"~a/bin/dmesg"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"dmidecode")
+                (format #f "Cmd(\"~a/sbin/dmidecode"
+                        (assoc-ref inputs "dmidecode")))
+               (("Cmd\\(\"dpkg")
+                (format #f "Cmd(\"~a/bin/dpkg"
+                        (assoc-ref inputs "dpkg")))
+               #;(("echo")
+               (format #f "~a/bin/echo"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"edid-decode")
+                (format #f "Cmd(\"~a/bin/edid-decode"
+                        (assoc-ref inputs "edid-decode")))
+               (("Cmd\\(\"efibootmgr")
+                (format #f "Cmd(\"~a/sbin/efibootmgr"
+                        (assoc-ref inputs "efibootmgr")))
+               (("Cmd\\(\"efivar")
+                (format #f "Cmd(\"~a/bin/efivar"
+                        (assoc-ref inputs "efivar")))
+               #;(("Cmd\\(\"eopkg")
+               (format #f "Cmd(\"~a/bin/eopkg"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"ethtool")
+                (format #f "Cmd(\"~a/sbin/ethtool"
+                        (assoc-ref inputs "ethtool")))
+               (("Cmd\\(\".*ethtool")
+                (format #f "Cmd(\"~a/sbin/ethtool"
+                        (assoc-ref inputs "ethtool")))
+               (("Cmd\\(\"fdisk")
+                (format #f "Cmd(\"~a/sbin/fdisk"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"fglrxinfo")
+               (format #f "Cmd(\"~a/bin/fglrxinfo"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"find")
+                (format #f "Cmd(\"~a/bin/find"
+                        (assoc-ref inputs "findutils")))
+               (("Cmd\\(\"findmnt")
+                (format #f "Cmd(\"~a/bin/findmnt"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd = \"findmnt")
+                (format #f "Cmd = \"~a/bin/findmnt"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"glxgears")
+                (format #f "Cmd(\"~a/bin/glxgears"
+                        (assoc-ref inputs "mesa-utils")))
+               (("Cmd\\(\"glxinfo")
+                (format #f "Cmd(\"~a/bin/glxinfo"
+                        (assoc-ref inputs "mesa-utils")))
+               #;(("grep")
+               (format #f "~a/bin/grep"
+               (assoc-ref inputs "grep")))
+               (("`head")
+                (format #f "`~a/bin/head"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"hciconfig")
+               (format #f "Cmd(\"~a/bin/hciconfig"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"hcitool")
+               (format #f "Cmd(\"~a/bin/hcitool"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"hddtemp")
+                (format #f "Cmd(\"~a/sbin/hddtemp"
+                        (assoc-ref inputs "hddtemp")))
+               (("Cmd\\(\"hdparm")
+                (format #f "Cmd(\"~a/sbin/hdparm"
+                        (assoc-ref inputs "hdparm")))
+               (("Cmd = \"hdparm")
+                (format #f "Cmd = \"~a/bin/hdparm"
+                        (assoc-ref inputs "hdparm")))
+               #;(("Cmd\\(\"hp-probe")
+               (format #f "Cmd(\"~a/bin/hp-probe"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"hwinfo")
+               (format #f "Cmd(\"~a/bin/hwinfo"
+               (assoc-ref inputs "hwinfo")))
+               #;(("Cmd = \"hwinfo")
+               (format #f "Cmd = \"~a/bin/hwinfo"
+               (assoc-ref inputs "hwinfo")))
+               (("Cmd\\(\"i2cdetect")
+                (format #f "Cmd(\"~a/sbin/i2cdetect"
+                        (assoc-ref inputs "i2c-tools")))
+               (("Cmd\\(\"iasl")
+                (format #f "Cmd(\"~a/bin/iasl"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"ifconfig")
+                (format #f "Cmd(\"~a/bin/ifconfig"
+                        (assoc-ref inputs "net-tools")))
+               (("Cmd\\(\"inxi")
+                (format #f "Cmd(\"~a/bin/inxi"
+                        (assoc-ref inputs "inxi")))
+               (("Cmd\\(\"iostat")
+                (format #f "Cmd(\"~a/bin/iostat"
+                        (assoc-ref inputs "sysstat")))
+               (("Cmd\\(\"ip")
+                (format #f "Cmd(\"~a/sbin/ip"
+                        (assoc-ref inputs "iproute2")))
+               (("Cmd\\(\".*ip")
+                (format #f "Cmd(\"~a/sbin/ip"
+                        (assoc-ref inputs "iproute2")))
+               (("Cmd\\(\"iw")
+                (format #f "Cmd(\"~a/sbin/iw"
+                        (assoc-ref inputs "iw")))
+               (("Cmd\\(\".*iw")
+                (format #f "Cmd(\"~a/sbin/iw"
+                        (assoc-ref inputs "iw")))
+               #;(("Cmd\\(\"iwconfig")
+               (format #f "Cmd(\"~a/bin/iwconfig"
+               (assoc-ref inputs "foobar")))
+               #;(("join")
+               (format #f "~a/bin/join"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"journalctl")
+               (format #f "Cmd(\"~a/bin/journalctl"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"ls")
+                (format #f "Cmd(\"~a/bin/ls"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"lsb_release")
+               (format #f "Cmd(\"~a/bin/lsb_release"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsblk")
+                (format #f "Cmd(\"~a/bin/lsblk"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd = \"lsblk")
+                (format #f "Cmd = \"~a/bin/lsblk"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"lscpu")
+                (format #f "Cmd(\"~a/bin/lscpu"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"lsinitrd")
+               (format #f "Cmd(\"~a/bin/lsinitrd"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsmod")
+                (format #f "Cmd(\"~a/bin/lsmod"
+                        (assoc-ref inputs "module-init-tools")))
+               (("Cmd\\(\"lspci")
+                (format #f "Cmd(\"~a/sbin/lspci"
+                        (assoc-ref inputs "pciutils")))
+               #;(("Cmd\\(\"lspnp")
+               (format #f "Cmd(\"~a/bin/lspnp"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsusb")
+                (format #f "Cmd(\"~a/bin/lsusb"
+                        (assoc-ref inputs "usbutils")))
+               (("Cmd\\(\"mcelog")
+                (format #f "Cmd(\"~a/sbin/mcelog"
+                        (assoc-ref inputs "mcelog")))
+               (("Cmd\\(\"md5sum")
+                (format #f "Cmd(\"~a/bin/md5sum"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"megactl")
+               (format #f "Cmd(\"~a/bin/megactl"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"memtester")
+                (format #f "Cmd(\"~a/bin/memtester"
+                        (assoc-ref inputs "memtester")))
+               (("Cmd\\(\"mmcli")
+                (format #f "Cmd(\"~a/bin/mmcli"
+                        (assoc-ref inputs "modem-manager")))
+               (("Cmd\\(\"modinfo")
+                (format #f "Cmd(\"~a/sbin/modinfo"
+                        (assoc-ref inputs "module-init-tools")))
+               #;(("Cmd\\(\"monitor-get-edid")
+               (format #f "Cmd(\"~a/bin/monitor-get-edid"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"mount")
+                (format #f "Cmd(\"~a/bin/mount"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"nm-tool")
+               (format #f "Cmd(\"~a/bin/nm-tool"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"nmcli")
+                (format #f "Cmd(\"~a/bin/nmcli"
+                        (assoc-ref inputs "network-manager")))
+               (("Cmd\\(\"numactl")
+                (format #f "Cmd(\"~a/bin/numactl"
+                        (assoc-ref inputs "numactl")))
+               (("Cmd\\(\"nvme")
+                (format #f "Cmd(\"~a/sbin/nvme"
+                        (assoc-ref inputs "nvme-cli")))
+               (("Cmd\\(\"opensc-tool")
+                (format #f "Cmd(\"~a/bin/opensc-tool"
+                        (assoc-ref inputs "opensc")))
+               #;(("Cmd\\(\"optirun")
+               (format #f "Cmd(\"~a/bin/optirun"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"pacman")
+               (format #f "Cmd(\"~a/bin/pacman"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"pstree")
+               (format #f "Cmd(\"~a/bin/pstree"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"rfkill")
+                (format #f "Cmd(\"~a/sbin/rfkill"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"route")
+                (format #f "Cmd(\"~a/bin/route"
+                        (assoc-ref inputs "net-tools")))
+               (("Cmd\\(\"rpm")
+                (format #f "Cmd(\"~a/bin/rpm"
+                        (assoc-ref inputs "rpm")))
+               (("Cmd\\(\"sane-find-scanner")
+                (format #f "Cmd(\"~a/bin/sane-find-scanner"
+                        (assoc-ref inputs "sane-backends")))
+               (("Cmd\\(\"scanimage")
+                (format #f "Cmd(\"~a/bin/scanimage"
+                        (assoc-ref inputs "sane-backends")))
+               (("Cmd\\(\"sensors")
+                (format #f "Cmd(\"~a/bin/sensors"
+                        (assoc-ref inputs "lm-sensors")))
+               #;(("sha512sum")
+               (format #f "~a/bin/sha512sum"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"slabtop")
+                (format #f "Cmd(\"~a/bin/slabtop"
+                        (assoc-ref inputs "procps")))
+               #;(("sleep")
+               (format #f "~a/bin/sleep"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"smartctl")
+                (format #f "Cmd(\"~a/sbin/smartctl"
+                        (assoc-ref inputs "smartmontools")))
+               (("Cmd = \"smartctl")
+                (format #f "Cmd = \"~a/bin/smartctl"
+                        (assoc-ref inputs "smartmontools")))
+               #;(("sort")
+               (format #f "~a/bin/sort"
+               (assoc-ref inputs "coreutils")))
+               #;(("split")
+               (format #f "~a/bin/split"
+               (assoc-ref inputs "coreutils")))
+               #;(("= stat")
+               (format #f "= ~a/bin/stat"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"superiotool")
+               (format #f "Cmd(\"~a/bin/superiotool"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"swupd")
+               (format #f "Cmd(\"~a/bin/swupd"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"systemctl")
+               (format #f "Cmd(\"~a/bin/systemctl"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"systemd-analyze")
+               (format #f "Cmd(\"~a/bin/systemd-analyze"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"top")
+                (format #f "Cmd(\"~a/bin/top"
+                        (assoc-ref inputs "procps")))
+               (("Cmd\\(\"udevadm")
+                (format #f "Cmd(\"~a/bin/udevadm"
+                        (assoc-ref inputs "eudev")))
+               (("Cmd\\(\"uname")
+                (format #f "Cmd(\"~a/bin/uname"
+                        (assoc-ref inputs "coreutils")))
+               #;(("unlink")
+               (format #f "~a/bin/unlink"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"update-alternatives")
+               (format #f "Cmd(\"~a/bin/update-alternatives"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"upower")
+                (format #f "Cmd(\"~a/bin/upower"
+                        (assoc-ref inputs "upower")))
+               (("Cmd\\(\"uptime")
+                (format #f "Cmd(\"~a/bin/uptime"
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"usb-devices")
+                (format #f "Cmd(\"~a/bin/usb-devices"
+                        (assoc-ref inputs "usbutils")))
+               (("Cmd\\(\"vainfo")
+                (format #f "Cmd(\"~a/bin/vainfo"
+                        (assoc-ref inputs "libva-utils")))
+               (("Cmd\\(\"vdpauinfo")
+                (format #f "Cmd(\"~a/bin/vdpauinfo"
+                        (assoc-ref inputs "vdpauinfo")))
+               (("Cmd\\(\"vulkaninfo")
+                (format #f "Cmd(\"~a/bin/vulkaninfo"
+                        (assoc-ref inputs "vulkan-tools")))
+               (("Cmd\\(\"xdpyinfo")
+                (format #f "Cmd(\"~a/bin/xdpyinfo"
+                        (assoc-ref inputs "xdpyinfo")))
+               (("Cmd\\(\"xinput")
+                (format #f "Cmd(\"~a/bin/xinput"
+                        (assoc-ref inputs "xinput")))
+               (("Cmd\\(\"xrandr")
+                (format #f "Cmd(\"~a/bin/xrandr"
+                        (assoc-ref inputs "xrandr")))
+               (("Cmd\\(\"xvinfo")
+                (format #f "Cmd(\"~a/bin/xvinfo"
+                        (assoc-ref inputs "xvinfo"))))))
+         (delete 'configure)
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-dir (string-append out "/bin/"))
+                    (perl-lib (getenv "PERL5LIB")))
+               (for-each
+                (cut wrap-program <>
+                     `("PERL5LIB" ":" prefix (,perl-lib)))
+                (find-files bin-dir))))))))
+    (inputs
+     `(("acpi" ,acpi)
+       ("acpica" ,acpica)
+       ("alsa-utils" ,alsa-utils)
+       ("avahi" ,avahi)
+       ("bash-minimal" ,bash-minimal)
+       ("coreutils" ,coreutils)
+       ("cpuid" ,cpuid)
+       ("cpupower" ,cpupower)
+       ("curl" ,curl)
+       ("dmidecode" ,dmidecode)
+       ("dpkg" ,dpkg)
+       ("edid-decode" ,edid-decode)
+       ("efibootmgr" ,efibootmgr)
+       ("efivar" ,efivar)
+       ("eudev" ,eudev)
+       ("findutils" ,findutils)
+       ("grep" ,grep)
+       ("hddtemp" ,hddtemp)
+       ("hdparm" ,hdparm)
+       ("hplip" ,hplip-minimal)
+       ("i2c-tools" ,i2c-tools)
+       ("inxi" ,inxi)
+       ("iproute" ,iproute)
+       ("libva-utils" ,libva-utils)
+       ("lm-sensors" ,lm-sensors)
+       ("mcelog" ,mcelog)
+       ("memtester" ,memtester)
+       ("mesa-utils" ,mesa-utils)
+       ("modem-manager" ,modem-manager)
+       ("module-init-tools" ,module-init-tools)
+       ("net-tools" ,net-tools)
+       ("network-manager" ,network-manager)
+       ("numactl" ,numactl)
+       ("nvme-cli" ,nvme-cli)
+       ("opensc" ,opensc)
+       ("pciutils" ,pciutils)
+       ("perl-data-dumper" ,perl-data-dumper)
+       ("perl-digest-sha" ,perl-digest-sha)
+       ("perl-libwww" ,perl-libwww)
+       ;; ("pnputils" ,pnputils)
+       ("procps" ,procps)
+       ("rpm" ,rpm)
+       ("sane-backends" ,sane-backends)
+       ("smartmontools" ,smartmontools)
+       ("sysstat" ,sysstat)
+       ("upower" ,upower)
+       ("usbutils" ,usbutils)
+       ("util-linux" ,util-linux)
+       ("vdpauinfo" ,vdpauinfo)
+       ("vulkan-tools" ,vulkan-tools)
+       ("xdpyinfo" ,xdpyinfo)
+       ("xinput" ,xinput)
+       ("xrandr" ,xrandr)
+       ("xvinfo" ,xvinfo)))
+    (propagated-inputs
+     `(("hwinfo" ,hwinfo)))
+    (home-page "https://linux-hardware.org")
+    (synopsis "Hardware Probe")
+    (description "Hardware Probe is a tool to probe for hardware, check its
+operability and find drivers.")
+    (license license:lgpl2.1+)))
+
 (define-public hwinfo
   (package
     (name "hwinfo")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#49934] [PATCH v3] gnu: Add hw-probe.
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
                   ` (6 preceding siblings ...)
  2021-12-09 11:51 ` [bug#49934] [PATCH v2] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
@ 2021-12-09 12:18 ` Raghav Gururajan via Guix-patches via
  2021-12-16  5:53 ` [bug#49934] Hw-Probe Ricardo Wurmus
  8 siblings, 0 replies; 17+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-12-09 12:18 UTC (permalink / raw)
  To: 49934; +Cc: Raghav Gururajan, maximedevos, Petr Hodina

* gnu/packages/hardware.scm (hw-probe): New variable.

Co-authored-by: Petr Hodina <phodina@protonmail.com>
---
 gnu/packages/hardware.scm | 495 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 495 insertions(+)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 46ac96d679..a56405c319 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -27,20 +27,29 @@
 (define-module (gnu packages hardware)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages avahi)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages crypto)
+  #:use-module (gnu packages cups)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages debian)
+  #:use-module (gnu packages disk)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages package-management)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages pciutils)
@@ -52,8 +61,12 @@ (define-module (gnu packages hardware)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages scanner)
+  #:use-module (gnu packages security-token)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages virtualization)
+  #:use-module (gnu packages vulkan)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
@@ -61,6 +74,7 @@ (define-module (gnu packages hardware)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -72,6 +86,487 @@ (define-module (gnu packages hardware)
 ;; This is a module for packages related to physical hardware that don't (yet)
 ;; have a more specific home like gps.scm, security-token.scm, &c.
 
+(define-public hw-probe
+  (package
+    (name "hw-probe")
+    (version "1.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/linuxhw/hw-probe")
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1zyaardfw6r9nwxbkbb68hyl8719xn8sxpbgm7czkvsbjrim11n8"))))
+    (build-system perl-build-system)
+    (arguments
+     `(#:tests? #f                      ;no test target
+       #:imported-modules
+       (,@%perl-build-system-modules)
+       #:modules
+       ((guix build perl-build-system)
+        (guix build utils)
+        (srfi srfi-26))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               ;; Correct install prefix.
+               (substitute* "Makefile"
+                 (("/usr") out)))
+             ;; Use absolute paths to referenced programs.
+             ;; FIXME: Some programs are to be patched successfully,
+             ;; and some other programs are to be packaged in Guix.
+             (substitute* "hw-probe.pl"
+               (("Cmd\\(\"acpi")
+                (format #f "Cmd(\"~a/bin/acpi"
+                        (assoc-ref inputs "acpi")))
+               (("Cmd\\(\"acpidump")
+                (format #f "Cmd(\"~a/bin/acpidump"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"acpixtract")
+                (format #f "Cmd(\"~a/bin/acpixtract"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"alsactl")
+                (format #f "Cmd(\"~a/bin/alsactl"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"amdconfig")
+               (format #f "Cmd(\"~a/bin/amdconfig"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"amixer")
+                (format #f "Cmd(\"~a/bin/amixer"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"apk")
+               (format #f "Cmd(\"~a/bin/apk"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"aplay")
+                (format #f "Cmd(\"~a/bin/aplay"
+                        (assoc-ref inputs "alsa-utils")))
+               #;(("Cmd\\(\"arcconf")
+               (format #f "Cmd(\"~a/bin/arcconf"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"arecord")
+                (format #f "Cmd(\"~a/bin/arecord"
+                        (assoc-ref inputs "alsa-utils")))
+               (("Cmd\\(\"avahi-browse")
+                (format #f "Cmd(\"~a/bin/avahi-browse"
+                        (assoc-ref inputs "avahi")))
+               (("Cmd\\(\"biosdecode")
+                (format #f "Cmd(\"~a/sbin/biosdecode"
+                        (assoc-ref inputs "dmidecode")))
+               (("=cat")
+                (format #f "=~a/bin/cat"
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"chmod")
+                (format #f "Cmd(\"~a/bin/chmod"
+                        (assoc-ref inputs "coreutils")))
+               (("\"chmod\"")
+                (format #f "\"~a/bin/chmod\""
+                        (assoc-ref inputs "coreutils")))
+               (("\"chown\"")
+                (format #f "\"~a/bin/chown\""
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"cpuid")
+                (format #f "Cmd(\"~a/bin/cpuid"
+                        (assoc-ref inputs "cpuid")))
+               (("Cmd\\(\"cpupower")
+                (format #f "Cmd(\"~a/bin/cpupower"
+                        (assoc-ref inputs "cpupower")))
+               (("Cmd\\(\"curl")
+                (format #f "Cmd(\"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("Cmd = \"curl")
+                (format #f "Cmd = \"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("Cmd = \\(\"curl")
+                (format #f "Cmd = (\"~a/bin/curl"
+                        (assoc-ref inputs "curl")))
+               (("\"date\"")
+                (format #f "\"~a/bin/date\""
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"dd")
+                (format #f "Cmd(\"~a/bin/dd"
+                        (assoc-ref inputs "coreutils")))
+               (("\"dd ")
+                (format #f "\"~a/bin/dd "
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"df")
+                (format #f "Cmd(\"~a/bin/df"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"dkms")
+               (format #f "Cmd(\"~a/bin/dkms"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"dmesg")
+                (format #f "Cmd(\"~a/bin/dmesg"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"dmidecode")
+                (format #f "Cmd(\"~a/sbin/dmidecode"
+                        (assoc-ref inputs "dmidecode")))
+               (("Cmd\\(\"dpkg")
+                (format #f "Cmd(\"~a/bin/dpkg"
+                        (assoc-ref inputs "dpkg")))
+               #;(("echo")
+               (format #f "~a/bin/echo"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"edid-decode")
+                (format #f "Cmd(\"~a/bin/edid-decode"
+                        (assoc-ref inputs "edid-decode")))
+               (("Cmd\\(\"efibootmgr")
+                (format #f "Cmd(\"~a/sbin/efibootmgr"
+                        (assoc-ref inputs "efibootmgr")))
+               (("Cmd\\(\"efivar")
+                (format #f "Cmd(\"~a/bin/efivar"
+                        (assoc-ref inputs "efivar")))
+               #;(("Cmd\\(\"eopkg")
+               (format #f "Cmd(\"~a/bin/eopkg"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"ethtool")
+                (format #f "Cmd(\"~a/sbin/ethtool"
+                        (assoc-ref inputs "ethtool")))
+               (("Cmd\\(\".*ethtool")
+                (format #f "Cmd(\"~a/sbin/ethtool"
+                        (assoc-ref inputs "ethtool")))
+               (("Cmd\\(\"fdisk")
+                (format #f "Cmd(\"~a/sbin/fdisk"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"fglrxinfo")
+               (format #f "Cmd(\"~a/bin/fglrxinfo"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"find")
+                (format #f "Cmd(\"~a/bin/find"
+                        (assoc-ref inputs "findutils")))
+               (("Cmd\\(\"findmnt")
+                (format #f "Cmd(\"~a/bin/findmnt"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd = \"findmnt")
+                (format #f "Cmd = \"~a/bin/findmnt"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"glxgears")
+                (format #f "Cmd(\"~a/bin/glxgears"
+                        (assoc-ref inputs "mesa-utils")))
+               (("Cmd\\(\"glxinfo")
+                (format #f "Cmd(\"~a/bin/glxinfo"
+                        (assoc-ref inputs "mesa-utils")))
+               #;(("grep")
+               (format #f "~a/bin/grep"
+               (assoc-ref inputs "grep")))
+               (("`head")
+                (format #f "`~a/bin/head"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"hciconfig")
+               (format #f "Cmd(\"~a/bin/hciconfig"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"hcitool")
+               (format #f "Cmd(\"~a/bin/hcitool"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"hddtemp")
+                (format #f "Cmd(\"~a/sbin/hddtemp"
+                        (assoc-ref inputs "hddtemp")))
+               (("Cmd\\(\"hdparm")
+                (format #f "Cmd(\"~a/sbin/hdparm"
+                        (assoc-ref inputs "hdparm")))
+               (("Cmd = \"hdparm")
+                (format #f "Cmd = \"~a/bin/hdparm"
+                        (assoc-ref inputs "hdparm")))
+               #;(("Cmd\\(\"hp-probe")
+               (format #f "Cmd(\"~a/bin/hp-probe"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"hwinfo")
+               (format #f "Cmd(\"~a/bin/hwinfo"
+               (assoc-ref inputs "hwinfo")))
+               #;(("Cmd = \"hwinfo")
+               (format #f "Cmd = \"~a/bin/hwinfo"
+               (assoc-ref inputs "hwinfo")))
+               (("Cmd\\(\"i2cdetect")
+                (format #f "Cmd(\"~a/sbin/i2cdetect"
+                        (assoc-ref inputs "i2c-tools")))
+               (("Cmd\\(\"iasl")
+                (format #f "Cmd(\"~a/bin/iasl"
+                        (assoc-ref inputs "acpica")))
+               (("Cmd\\(\"ifconfig")
+                (format #f "Cmd(\"~a/bin/ifconfig"
+                        (assoc-ref inputs "net-tools")))
+               (("Cmd\\(\"inxi")
+                (format #f "Cmd(\"~a/bin/inxi"
+                        (assoc-ref inputs "inxi")))
+               (("Cmd\\(\"iostat")
+                (format #f "Cmd(\"~a/bin/iostat"
+                        (assoc-ref inputs "sysstat")))
+               (("Cmd\\(\"ip")
+                (format #f "Cmd(\"~a/sbin/ip"
+                        (assoc-ref inputs "iproute2")))
+               (("Cmd\\(\".*ip")
+                (format #f "Cmd(\"~a/sbin/ip"
+                        (assoc-ref inputs "iproute2")))
+               (("Cmd\\(\"iw")
+                (format #f "Cmd(\"~a/sbin/iw"
+                        (assoc-ref inputs "iw")))
+               (("Cmd\\(\".*iw")
+                (format #f "Cmd(\"~a/sbin/iw"
+                        (assoc-ref inputs "iw")))
+               #;(("Cmd\\(\"iwconfig")
+               (format #f "Cmd(\"~a/bin/iwconfig"
+               (assoc-ref inputs "foobar")))
+               #;(("join")
+               (format #f "~a/bin/join"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"journalctl")
+               (format #f "Cmd(\"~a/bin/journalctl"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"ls")
+                (format #f "Cmd(\"~a/bin/ls"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"lsb_release")
+               (format #f "Cmd(\"~a/bin/lsb_release"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsblk")
+                (format #f "Cmd(\"~a/bin/lsblk"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd = \"lsblk")
+                (format #f "Cmd = \"~a/bin/lsblk"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"lscpu")
+                (format #f "Cmd(\"~a/bin/lscpu"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"lsinitrd")
+               (format #f "Cmd(\"~a/bin/lsinitrd"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsmod")
+                (format #f "Cmd(\"~a/bin/lsmod"
+                        (assoc-ref inputs "module-init-tools")))
+               (("Cmd\\(\"lspci")
+                (format #f "Cmd(\"~a/sbin/lspci"
+                        (assoc-ref inputs "pciutils")))
+               #;(("Cmd\\(\"lspnp")
+               (format #f "Cmd(\"~a/bin/lspnp"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"lsusb")
+                (format #f "Cmd(\"~a/bin/lsusb"
+                        (assoc-ref inputs "usbutils")))
+               (("Cmd\\(\"mcelog")
+                (format #f "Cmd(\"~a/sbin/mcelog"
+                        (assoc-ref inputs "mcelog")))
+               (("Cmd\\(\"md5sum")
+                (format #f "Cmd(\"~a/bin/md5sum"
+                        (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"megactl")
+               (format #f "Cmd(\"~a/bin/megactl"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"memtester")
+                (format #f "Cmd(\"~a/bin/memtester"
+                        (assoc-ref inputs "memtester")))
+               (("Cmd\\(\"mmcli")
+                (format #f "Cmd(\"~a/bin/mmcli"
+                        (assoc-ref inputs "modem-manager")))
+               (("Cmd\\(\"modinfo")
+                (format #f "Cmd(\"~a/sbin/modinfo"
+                        (assoc-ref inputs "module-init-tools")))
+               #;(("Cmd\\(\"monitor-get-edid")
+               (format #f "Cmd(\"~a/bin/monitor-get-edid"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"mount")
+                (format #f "Cmd(\"~a/bin/mount"
+                        (assoc-ref inputs "util-linux")))
+               #;(("Cmd\\(\"nm-tool")
+               (format #f "Cmd(\"~a/bin/nm-tool"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"nmcli")
+                (format #f "Cmd(\"~a/bin/nmcli"
+                        (assoc-ref inputs "network-manager")))
+               (("Cmd\\(\"numactl")
+                (format #f "Cmd(\"~a/bin/numactl"
+                        (assoc-ref inputs "numactl")))
+               (("Cmd\\(\"nvme")
+                (format #f "Cmd(\"~a/sbin/nvme"
+                        (assoc-ref inputs "nvme-cli")))
+               (("Cmd\\(\"opensc-tool")
+                (format #f "Cmd(\"~a/bin/opensc-tool"
+                        (assoc-ref inputs "opensc")))
+               #;(("Cmd\\(\"optirun")
+               (format #f "Cmd(\"~a/bin/optirun"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"pacman")
+               (format #f "Cmd(\"~a/bin/pacman"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"pstree")
+               (format #f "Cmd(\"~a/bin/pstree"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"rfkill")
+                (format #f "Cmd(\"~a/sbin/rfkill"
+                        (assoc-ref inputs "util-linux")))
+               (("Cmd\\(\"route")
+                (format #f "Cmd(\"~a/bin/route"
+                        (assoc-ref inputs "net-tools")))
+               (("Cmd\\(\"rpm")
+                (format #f "Cmd(\"~a/bin/rpm"
+                        (assoc-ref inputs "rpm")))
+               (("Cmd\\(\"sane-find-scanner")
+                (format #f "Cmd(\"~a/bin/sane-find-scanner"
+                        (assoc-ref inputs "sane-backends")))
+               (("Cmd\\(\"scanimage")
+                (format #f "Cmd(\"~a/bin/scanimage"
+                        (assoc-ref inputs "sane-backends")))
+               (("Cmd\\(\"sensors")
+                (format #f "Cmd(\"~a/bin/sensors"
+                        (assoc-ref inputs "lm-sensors")))
+               #;(("sha512sum")
+               (format #f "~a/bin/sha512sum"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"slabtop")
+                (format #f "Cmd(\"~a/bin/slabtop"
+                        (assoc-ref inputs "procps")))
+               #;(("sleep")
+               (format #f "~a/bin/sleep"
+               (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"smartctl")
+                (format #f "Cmd(\"~a/sbin/smartctl"
+                        (assoc-ref inputs "smartmontools")))
+               (("Cmd = \"smartctl")
+                (format #f "Cmd = \"~a/bin/smartctl"
+                        (assoc-ref inputs "smartmontools")))
+               #;(("sort")
+               (format #f "~a/bin/sort"
+               (assoc-ref inputs "coreutils")))
+               #;(("split")
+               (format #f "~a/bin/split"
+               (assoc-ref inputs "coreutils")))
+               #;(("= stat")
+               (format #f "= ~a/bin/stat"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"superiotool")
+               (format #f "Cmd(\"~a/bin/superiotool"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"swupd")
+               (format #f "Cmd(\"~a/bin/swupd"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"systemctl")
+               (format #f "Cmd(\"~a/bin/systemctl"
+               (assoc-ref inputs "foobar")))
+               #;(("Cmd\\(\"systemd-analyze")
+               (format #f "Cmd(\"~a/bin/systemd-analyze"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"top")
+                (format #f "Cmd(\"~a/bin/top"
+                        (assoc-ref inputs "procps")))
+               (("Cmd\\(\"udevadm")
+                (format #f "Cmd(\"~a/bin/udevadm"
+                        (assoc-ref inputs "eudev")))
+               (("Cmd\\(\"uname")
+                (format #f "Cmd(\"~a/bin/uname"
+                        (assoc-ref inputs "coreutils")))
+               #;(("unlink")
+               (format #f "~a/bin/unlink"
+               (assoc-ref inputs "coreutils")))
+               #;(("Cmd\\(\"update-alternatives")
+               (format #f "Cmd(\"~a/bin/update-alternatives"
+               (assoc-ref inputs "foobar")))
+               (("Cmd\\(\"upower")
+                (format #f "Cmd(\"~a/bin/upower"
+                        (assoc-ref inputs "upower")))
+               (("Cmd\\(\"uptime")
+                (format #f "Cmd(\"~a/bin/uptime"
+                        (assoc-ref inputs "coreutils")))
+               (("Cmd\\(\"usb-devices")
+                (format #f "Cmd(\"~a/bin/usb-devices"
+                        (assoc-ref inputs "usbutils")))
+               (("Cmd\\(\"vainfo")
+                (format #f "Cmd(\"~a/bin/vainfo"
+                        (assoc-ref inputs "libva-utils")))
+               (("Cmd\\(\"vdpauinfo")
+                (format #f "Cmd(\"~a/bin/vdpauinfo"
+                        (assoc-ref inputs "vdpauinfo")))
+               (("Cmd\\(\"vulkaninfo")
+                (format #f "Cmd(\"~a/bin/vulkaninfo"
+                        (assoc-ref inputs "vulkan-tools")))
+               (("Cmd\\(\"xdpyinfo")
+                (format #f "Cmd(\"~a/bin/xdpyinfo"
+                        (assoc-ref inputs "xdpyinfo")))
+               (("Cmd\\(\"xinput")
+                (format #f "Cmd(\"~a/bin/xinput"
+                        (assoc-ref inputs "xinput")))
+               (("Cmd\\(\"xrandr")
+                (format #f "Cmd(\"~a/bin/xrandr"
+                        (assoc-ref inputs "xrandr")))
+               (("Cmd\\(\"xvinfo")
+                (format #f "Cmd(\"~a/bin/xvinfo"
+                        (assoc-ref inputs "xvinfo"))))))
+         (delete 'configure)
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-dir (string-append out "/bin/"))
+                    (perl-lib (getenv "PERL5LIB")))
+               (for-each
+                (cut wrap-program <>
+                     `("PERL5LIB" ":" prefix (,perl-lib)))
+                (find-files bin-dir))))))))
+    (inputs
+     `(("acpi" ,acpi)
+       ("acpica" ,acpica)
+       ("alsa-utils" ,alsa-utils)
+       ("avahi" ,avahi)
+       ("bash-minimal" ,bash-minimal)
+       ("coreutils" ,coreutils)
+       ("cpuid" ,cpuid)
+       ("cpupower" ,cpupower)
+       ("curl" ,curl)
+       ("dmidecode" ,dmidecode)
+       ("dpkg" ,dpkg)
+       ("edid-decode" ,edid-decode)
+       ("efibootmgr" ,efibootmgr)
+       ("efivar" ,efivar)
+       ("eudev" ,eudev)
+       ("findutils" ,findutils)
+       ("grep" ,grep)
+       ("hddtemp" ,hddtemp)
+       ("hdparm" ,hdparm)
+       ("hplip" ,hplip-minimal)
+       ("i2c-tools" ,i2c-tools)
+       ("inxi" ,inxi)
+       ("iproute" ,iproute)
+       ("libva-utils" ,libva-utils)
+       ("lm-sensors" ,lm-sensors)
+       ("mcelog" ,mcelog)
+       ("memtester" ,memtester)
+       ("mesa-utils" ,mesa-utils)
+       ("modem-manager" ,modem-manager)
+       ("module-init-tools" ,module-init-tools)
+       ("net-tools" ,net-tools)
+       ("network-manager" ,network-manager)
+       ("numactl" ,numactl)
+       ("nvme-cli" ,nvme-cli)
+       ("opensc" ,opensc)
+       ("pciutils" ,pciutils)
+       ("perl-data-dumper" ,perl-data-dumper)
+       ("perl-digest-sha" ,perl-digest-sha)
+       ("perl-libwww" ,perl-libwww)
+       ;; ("pnputils" ,pnputils)
+       ("procps" ,procps)
+       ("rpm" ,rpm)
+       ("sane-backends" ,sane-backends)
+       ("smartmontools" ,smartmontools)
+       ("sysstat" ,sysstat)
+       ("upower" ,upower)
+       ("usbutils" ,usbutils)
+       ("util-linux" ,util-linux)
+       ("vdpauinfo" ,vdpauinfo)
+       ("vulkan-tools" ,vulkan-tools)
+       ("xdpyinfo" ,xdpyinfo)
+       ("xinput" ,xinput)
+       ("xrandr" ,xrandr)
+       ("xvinfo" ,xvinfo)))
+    (propagated-inputs
+     ;; FIXME: HwInfo needs to be patched in 'hw-probe.el'.
+     `(("hwinfo" ,hwinfo)))
+    (home-page "https://linux-hardware.org")
+    (synopsis "Hardware Probe")
+    (description "Hardware Probe is a tool to probe for hardware, check its
+operability and find drivers.")
+    (license license:lgpl2.1+)))
+
 (define-public hwinfo
   (package
     (name "hwinfo")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [bug#49934] Hw-Probe
  2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
                   ` (7 preceding siblings ...)
  2021-12-09 12:18 ` [bug#49934] [PATCH v3] " Raghav Gururajan via Guix-patches via
@ 2021-12-16  5:53 ` Ricardo Wurmus
  2021-12-25 21:17   ` Raghav Gururajan via Guix-patches via
  8 siblings, 1 reply; 17+ messages in thread
From: Ricardo Wurmus @ 2021-12-16  5:53 UTC (permalink / raw)
  To: 49934; +Cc: Raghav Gururajan

Thanks for the patch!

I’m afraid the 'patch build phase is much too repetitive.  You can
greatly simplify it by doing a substitution like this:

--8<---------------cut here---------------start------------->8---
(substitute* "hw-probe.pl"
  (("Cmd\\(\"([^\"]+)" _ command)
   (string-append "Cmd(\"" (which command))))
--8<---------------cut here---------------end--------------->8---

The regular expression has a sub-group that matches everything after the
opening double quote until it hits another double quote.  That group is
captured as “command”.  We then look up that string in the build
environment with “which” (not the executable of the same name), which
returns the absolute file name corresponding to the command.

-- 
Ricardo




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] Hw-Probe
  2021-12-16  5:53 ` [bug#49934] Hw-Probe Ricardo Wurmus
@ 2021-12-25 21:17   ` Raghav Gururajan via Guix-patches via
  2021-12-27  9:59     ` Efraim Flashner
  2022-06-23 15:35     ` [bug#50283] HwInfo Maxim Cournoyer
  0 siblings, 2 replies; 17+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2021-12-25 21:17 UTC (permalink / raw)
  To: Ricardo Wurmus, 49934


[-- Attachment #1.1: Type: text/plain, Size: 466 bytes --]

Hi Ricardo!

> --8<---------------cut here---------------start------------->8---
> (substitute* "hw-probe.pl"
>    (("Cmd\\(\"([^\"]+)" _ command)
>     (string-append "Cmd(\"" (which command))))
> --8<---------------cut here---------------end--------------->8---

Thanks for the snippet and explanation.

I am wondering these,
[1] Does require import of specific modules?
[2] If `(which command)`'s output is empty, will it return #f?

Regards,
RG.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#49934] Hw-Probe
  2021-12-25 21:17   ` Raghav Gururajan via Guix-patches via
@ 2021-12-27  9:59     ` Efraim Flashner
  2022-06-23 15:35     ` [bug#50283] HwInfo Maxim Cournoyer
  1 sibling, 0 replies; 17+ messages in thread
From: Efraim Flashner @ 2021-12-27  9:59 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: Ricardo Wurmus, 49934

[-- Attachment #1: Type: text/plain, Size: 1612 bytes --]

On Sat, Dec 25, 2021 at 04:17:32PM -0500, Raghav Gururajan via Guix-patches via wrote:
> Hi Ricardo!
> 
> > --8<---------------cut here---------------start------------->8---
> > (substitute* "hw-probe.pl"
> >    (("Cmd\\(\"([^\"]+)" _ command)
> >     (string-append "Cmd(\"" (which command))))
> > --8<---------------cut here---------------end--------------->8---
> 
> Thanks for the snippet and explanation.
> 
> I am wondering these,
> [1] Does require import of specific modules?
> [2] If `(which command)`'s output is empty, will it return #f?

For 2, looks like yes

(ins)efraim@3900XT ~$ which -a svn
which: no svn in (/home/efraim/Applications/.bin:/gnu/store/4iyar3w7k30b5j13v9cf5gmiz5livkyj-enlightenment-0.24.2/bin:/run/setuid-programs:/home/efraim/.config/guix/current/bin:/home/efraim/.guix-profile/bin:/home/efraim/.guix-profile/sbin:/run/current-system/profile/bin:/run/current-system/profile/sbin)
(ins)efraim@3900XT ~$ guile
GNU Guile 3.0.7
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
(ins)scheme@(guile-user)> (use-modules (guix build utils))
(ins)scheme@(guile-user)> (which "svn")
$1 = #f
(ins)scheme@(guile-user)>


-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#50283] HwInfo
  2021-12-25 21:17   ` Raghav Gururajan via Guix-patches via
  2021-12-27  9:59     ` Efraim Flashner
@ 2022-06-23 15:35     ` Maxim Cournoyer
  2022-06-24  8:31       ` Raghav Gururajan via Guix-patches via
  1 sibling, 1 reply; 17+ messages in thread
From: Maxim Cournoyer @ 2022-06-23 15:35 UTC (permalink / raw)
  To: Raghav Gururajan; +Cc: Ricardo Wurmus, 49934-done, 50283-done

Hi,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> Hi Ricardo!
>
>> --8<---------------cut here---------------start------------->8---
>> (substitute* "hw-probe.pl"
>>    (("Cmd\\(\"([^\"]+)" _ command)
>>     (string-append "Cmd(\"" (which command))))
>> --8<---------------cut here---------------end--------------->8---
>
> Thanks for the snippet and explanation.
>
> I am wondering these,
> [1] Does require import of specific modules?

No.  `which', the Scheme procedure, is part of (guix build utils).

> [2] If `(which command)`'s output is empty, will it return #f?

Yes, and I agree that's a problem.

Fortunately, the recently added search-input-file more usefully raises
an error when the file it is looking for doesn't exist, so I used that.

It was a bit painful to hunt all the commands but in the end it works
beautifully!  I pushed the result as
3611f99affc4d2edcf4141e3022dd0d2a0b04068.

Closing, thanks!

Maxim




^ permalink raw reply	[flat|nested] 17+ messages in thread

* [bug#50283] HwInfo
  2022-06-23 15:35     ` [bug#50283] HwInfo Maxim Cournoyer
@ 2022-06-24  8:31       ` Raghav Gururajan via Guix-patches via
  0 siblings, 0 replies; 17+ messages in thread
From: Raghav Gururajan via Guix-patches via @ 2022-06-24  8:31 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Ricardo Wurmus, 49934-done, 50283-done


[-- Attachment #1.1: Type: text/plain, Size: 420 bytes --]

Maxim,

> Yes, and I agree that's a problem.
> 
> Fortunately, the recently added search-input-file more usefully raises
> an error when the file it is looking for doesn't exist, so I used that.
> 
> It was a bit painful to hunt all the commands but in the end it works
> beautifully!  I pushed the result as
> 3611f99affc4d2edcf4141e3022dd0d2a0b04068.
> 
> Closing, thanks!

Thank a lot.

Regards,
RG.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-06-24  8:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
2021-08-07 22:03 ` [bug#49934] Subject: [PATCH 2/3] gnu: Add hwinfo phodina via Guix-patches via
2021-08-07 22:05 ` [bug#49934] Subject: [PATCH 3/3] gnu: Add hw-probe phodina via Guix-patches via
2021-08-08 10:10 ` [bug#49934] [PATCH 1/3] gnu: Add libx86emu pelzflorian (Florian Pelz)
2021-08-09 12:00   ` phodina via Guix-patches via
2021-08-09 17:06     ` pelzflorian (Florian Pelz)
2021-08-30 21:34 ` [bug#49934] Hw-Probe Raghav Gururajan via Guix-patches via
2021-10-01 23:19 ` [bug#49934] [PATCH] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
2021-10-02  9:58   ` Maxime Devos
2021-10-01 23:26 ` [bug#49934] HwInfo Raghav Gururajan via Guix-patches via
2021-12-09 11:51 ` [bug#49934] [PATCH v2] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
2021-12-09 12:18 ` [bug#49934] [PATCH v3] " Raghav Gururajan via Guix-patches via
2021-12-16  5:53 ` [bug#49934] Hw-Probe Ricardo Wurmus
2021-12-25 21:17   ` Raghav Gururajan via Guix-patches via
2021-12-27  9:59     ` Efraim Flashner
2022-06-23 15:35     ` [bug#50283] HwInfo Maxim Cournoyer
2022-06-24  8:31       ` Raghav Gururajan via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).