diff mbox series

[bug#54069,v2,1/4] gnu: Add hwdata.

Message ID 20220226043238.2657-1-mail@brendan.scot
State Accepted
Headers show
Series [bug#54069,v2,1/4] gnu: Add hwdata. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Brendan Tildesley Feb. 26, 2022, 4:32 a.m. UTC
* gnu/packages/pciutils.scm (hwdata): New variable.
---
 gnu/packages/pciutils.scm | 41 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

Comments

Maxim Cournoyer Feb. 26, 2022, 11:14 p.m. UTC | #1
Hello Brendan,

Brendan Tildesley <mail@brendan.scot> writes:

> * gnu/packages/pciutils.scm (hwdata): New variable.
> ---
>  gnu/packages/pciutils.scm | 41 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
>
> diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
> index b6b1e3ad85..f16f420ec2 100644
> --- a/gnu/packages/pciutils.scm
> +++ b/gnu/packages/pciutils.scm
> @@ -4,6 +4,7 @@
>  ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
>  ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
> +;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -21,11 +22,14 @@
>  ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
>  
>  (define-module (gnu packages pciutils)
> +  #:use-module (guix gexp)
>    #:use-module (guix packages)
>    #:use-module (guix download)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix utils)
> +  #:use-module (guix git-download)
>    #:use-module (guix build-system gnu)
> +  #:use-module (guix build-system trivial)

I've removed the above extraneous import,

>    #:use-module (gnu packages)
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages pkg-config)
> @@ -33,6 +37,43 @@ (define-module (gnu packages pciutils)
>    #:use-module (gnu packages linux)
>    #:use-module (gnu packages base))
>  
> +(define-public hwdata
> +  (package
> +    (name "hwdata")
> +    (version "0.356")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/vcrhonek/hwdata")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "0m04d93dwiplwp9v74nhnc0hyi2n007mylkg8f0frb46z5qjrpl3"))))
> +    (build-system gnu-build-system)
> +    (outputs '("out" "iab" "oui" "pci" "pnp" "usb"))
> +    (native-inputs (list gzip))
> +    (arguments
> +     ;; Tests require pciutils, python, podman. Disable to avoid recursive dep.
> +     (list
> +      #:tests? #f
> +      #:configure-flags #~(list (string-append "--datadir=" #$output "/share"))
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (replace 'install
> +            (lambda _
> +              (install-file "iab.txt" (string-append #$output:iab "/share/hwdata"))
> +              (install-file "oui.txt" (string-append #$output:oui "/share/hwdata"))
> +              (install-file "pci.ids" (string-append #$output:pci "/share/hwdata"))
> +              (install-file "pnp.ids" (string-append #$output:pnp "/share/hwdata"))
> +              (install-file "usb.ids" (string-append #$output:usb "/share/hwdata")))))))
> +    (home-page "https://github.com/vcrhonek/hwdata")
> +    (synopsis "Hardware identification and configuration data")
> +    (description "@code{hwdata} contains various hardware identification and
> + configuration data, such as the @file{pci.ids} and @file{usb.ids}
> databases.")

expound the description a bit to provide guidance about output
usage, e.g.:

--8<---------------cut here---------------start------------->8---
@@ -69,7 +69,10 @@ (define-public hwdata
     (home-page "https://github.com/vcrhonek/hwdata")
     (synopsis "Hardware identification and configuration data")
     (description "@code{hwdata} contains various hardware identification and
- configuration data, such as the @file{pci.ids} and @file{usb.ids} databases.")
+configuration data, such as the @file{pci.ids} and @file{usb.ids} databases.
+Each database is contained in a specific package output, such as the
+@code{pci} output for @file{pci.ids}, the @code{usb} output for
+@file{usb.ids}, etc.")
     (license (list license:gpl2+
                    license:expat)))) ;XFree86 1.0
--8<---------------cut here---------------end--------------->8---

and pushed this first commit as 7f8bc02fd8.

Thanks!

Maxim
M Feb. 27, 2022, 12:08 p.m. UTC | #2
Maxim Cournoyer schreef op za 26-02-2022 om 18:14 [-0500]:
> > +(define-public hwdata
> > +  (package
> > +    (name "hwdata")
> > +    (version "0.356")

Given that this is pure data, WDYT of adding #:target #false to
'arguments', such that ‘cross-compiling’ hwdata is free, by
making the derivation for cross-compiling hwdata the same
as the derivation for compiling hwdata natively?

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index b6b1e3ad85..f16f420ec2 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -4,6 +4,7 @@ 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,11 +22,14 @@ 
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages pciutils)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix utils)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages pkg-config)
@@ -33,6 +37,43 @@  (define-module (gnu packages pciutils)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages base))
 
+(define-public hwdata
+  (package
+    (name "hwdata")
+    (version "0.356")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/vcrhonek/hwdata")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0m04d93dwiplwp9v74nhnc0hyi2n007mylkg8f0frb46z5qjrpl3"))))
+    (build-system gnu-build-system)
+    (outputs '("out" "iab" "oui" "pci" "pnp" "usb"))
+    (native-inputs (list gzip))
+    (arguments
+     ;; Tests require pciutils, python, podman. Disable to avoid recursive dep.
+     (list
+      #:tests? #f
+      #:configure-flags #~(list (string-append "--datadir=" #$output "/share"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'install
+            (lambda _
+              (install-file "iab.txt" (string-append #$output:iab "/share/hwdata"))
+              (install-file "oui.txt" (string-append #$output:oui "/share/hwdata"))
+              (install-file "pci.ids" (string-append #$output:pci "/share/hwdata"))
+              (install-file "pnp.ids" (string-append #$output:pnp "/share/hwdata"))
+              (install-file "usb.ids" (string-append #$output:usb "/share/hwdata")))))))
+    (home-page "https://github.com/vcrhonek/hwdata")
+    (synopsis "Hardware identification and configuration data")
+    (description "@code{hwdata} contains various hardware identification and
+ configuration data, such as the @file{pci.ids} and @file{usb.ids} databases.")
+    (license (list license:gpl2+
+                   license:expat)))) ;XFree86 1.0
+
 (define-public pciutils
   (package
     (name "pciutils")