all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
@ 2022-02-20  9:53 Brendan Tildesley
  2022-02-20  9:55 ` [bug#54069] [PATCH 1/2] gnu: Add hwdata Brendan Tildesley
                   ` (3 more replies)
  0 siblings, 4 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-20  9:53 UTC (permalink / raw)
  To: 54069

Completely untested but I needed pci.ids for something and discovered pciutils bundles an old version so I made this patch as something of a suggestion. Looks like it would be a core-updates change.




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

* [bug#54069] [PATCH 1/2] gnu: Add hwdata.
  2022-02-20  9:53 [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
@ 2022-02-20  9:55 ` Brendan Tildesley
  2022-02-20  9:55   ` [bug#54069] [PATCH 2/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
  2022-02-24  3:32   ` Maxim Cournoyer
  2022-02-21 16:19 ` John Kehayias via Guix-patches via
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-20  9:55 UTC (permalink / raw)
  To: 54069

* gnu/packages/pciutils.scm (hwdata): New variable.
---
 gnu/packages/pciutils.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index b6b1e3ad85..416328bda2 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.
 ;;;
@@ -25,7 +26,9 @@ (define-module (gnu packages pciutils)
   #: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 copy)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages pkg-config)
@@ -33,6 +36,32 @@ (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 copy-build-system)
+    (arguments
+     `(#:install-plan '(("pci.ids" "share/hwdata/pci.ids")
+                        ("pnp.ids" "share/hwdata/pnp.ids")
+                        ("usb.ids" "share/hwdata/usb.ids"))))
+    (home-page "https://pci-ids.ucw.cz")
+    (synopsis "Hardware identification databases")
+    (description "Hardware databases pci.ids, pnp.ids, and usb.ids including
+all known ID's used in PCI devices: ID's of vendors, devices, subsystems and
+device classes.")
+    (license (list license:gpl2+
+                   license:expat)))) ;; XFree86 1.0
+;;
 (define-public pciutils
   (package
     (name "pciutils")
-- 
2.34.0





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

* [bug#54069] [PATCH 2/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-20  9:55 ` [bug#54069] [PATCH 1/2] gnu: Add hwdata Brendan Tildesley
@ 2022-02-20  9:55   ` Brendan Tildesley
  2022-02-21 19:40     ` [bug#54069] [PATCH 0/2] " Maxim Cournoyer
  2022-02-24  3:32   ` Maxim Cournoyer
  1 sibling, 1 reply; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-20  9:55 UTC (permalink / raw)
  To: 54069

* gnu/packages/pciutils.scm (pciutils):
[inputs]: Remove zlib. Add hwdata. pci.ids was never gzip'd anyway.
[arguments]: Don't install update-pciids script or it's man page. Don't
install bundled old pci.ids file. Copy pci.ids file from latest hwdata package.
---
 gnu/packages/pciutils.scm | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index 416328bda2..3975854f84 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -110,17 +110,28 @@ (define-public pciutils
                (("^SHARED=.*$")
                 ;; Build libpciutils.so.
                 "SHARED := yes\n")
-               (("^ZLIB=.*$")
-                ;; Ask for zlib support, for 'pci.ids.gz' decompression.
-                "ZLIB := yes\n")
 
                (("^IDSDIR=.*$")
                 ;; Installation directory of 'pci.ids.gz'.
-                "IDSDIR = $(SHAREDIR)/hwdata\n"))))
+                "IDSDIR = $(SHAREDIR)/hwdata\n")
+               ;; Don't install update script, its man page, and empty man8 dir.
+               (("update-pciids update-pciids.8 ")
+                "")
+               ((".*update-pciids( |.8).*")
+                "")
+               (("[^ ]*/man8 ")
+                "")
+               ;; Down't install bundled pci.ids file.
+               ((".*INSTALL.*PCI_IDS.*")
+                ""))))
          (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; Install the commands, library, and .pc files.
-             (invoke "make" "install" "install-lib")))
+             (invoke "make" "install" "install-lib")
+             ;; Install newer pci.ids file.
+             (copy-file
+              (string-append (assoc-ref inputs "hwdata") "/share/hwdata/pci.ids")
+              (string-append (assoc-ref outputs "out") "/share/hwdata/pci.ids"))))
 
          ,@(if (hurd-target?)
                '((add-after 'unpack 'apply-hurd-patch
@@ -145,7 +156,7 @@ (define-public pciutils
        ,@(if (hurd-target?)
              `(("hurd-patch" ,(search-patch "pciutils-hurd-fix.patch")))
              '())
-       ("zlib" ,zlib)))
+       ("hwdata" ,hwdata)))
     (home-page "https://mj.ucw.cz/sw/pciutils/")
     (synopsis "Programs for inspecting and manipulating PCI devices")
     (description
-- 
2.34.0





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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-20  9:53 [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
  2022-02-20  9:55 ` [bug#54069] [PATCH 1/2] gnu: Add hwdata Brendan Tildesley
@ 2022-02-21 16:19 ` John Kehayias via Guix-patches via
  2022-02-22 19:34   ` John Kehayias via Guix-patches via
  2022-02-26  4:32 ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Brendan Tildesley
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
  3 siblings, 1 reply; 41+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-02-21 16:19 UTC (permalink / raw)
  To: 54069@debbugs.gnu.org

Hi Brendan,

> Completely untested but I needed pci.ids for something and discovered pciutils bundles an old version so I made this patch as something of a suggestion. Looks like it would be a core-updates change.

Thanks for this possibility, I've actually had to address something similar in https://issues.guix.gnu.org/53015 where I made a pciutils variant for this purpose. The patch is unmerged currently though.

I think that would work short term for our packaging needs and, as you say, make this bigger change for core updates (or wherever it will best fit). I haven't reviewed this patch, but in this way I think any updates to hwdata will cause pciutils to rebuild, which has many dependents. I'm not sure what is best, maybe: have pciutils use a frozen version of the hwdata with the separate package being a standalone more up to date data?

By the way, I do see in pciutils that share/hwdata/pci.ids.gz though admittedly I never checked to see if that really is gziped. Packages that want a plain pci.ids did not like it though (maybe just from file name?).

Would be great to have others chime in on what the longer term fix would be, in the short term a pciutils variant and/or hwdata standalone package would be helpful.

John




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-20  9:55   ` [bug#54069] [PATCH 2/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
@ 2022-02-21 19:40     ` Maxim Cournoyer
  2022-02-22  8:40       ` Brendan Tildesley
  0 siblings, 1 reply; 41+ messages in thread
From: Maxim Cournoyer @ 2022-02-21 19:40 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 54069

Hi,

Brendan Tildesley <mail@brendan.scot> writes:

> * gnu/packages/pciutils.scm (pciutils):
> [inputs]: Remove zlib. Add hwdata. pci.ids was never gzip'd anyway.
> [arguments]: Don't install update-pciids script or it's man page. Don't
> install bundled old pci.ids file. Copy pci.ids file from latest hwdata package.
> ---
>  gnu/packages/pciutils.scm | 25 ++++++++++++++++++-------
>  1 file changed, 18 insertions(+), 7 deletions(-)
>
> diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
> index 416328bda2..3975854f84 100644
> --- a/gnu/packages/pciutils.scm
> +++ b/gnu/packages/pciutils.scm
> @@ -110,17 +110,28 @@ (define-public pciutils
>                 (("^SHARED=.*$")
>                  ;; Build libpciutils.so.
>                  "SHARED := yes\n")
> -               (("^ZLIB=.*$")
> -                ;; Ask for zlib support, for 'pci.ids.gz' decompression.
> -                "ZLIB := yes\n")

It seems to me perhaps a more proper fix would be to have hwdata used as
an input, replacing the bundled copy of the pci.ids file file, and then
letting pciutils proceed as usual?  Disabling compression makes the
database about 4.3 times larger (1.2 MiB instead of 0.273 MiB).

I feel like applications parsing pci.ids themselves should probably rely
on the pciutils library API instead (libpci.so) to retrieve or filter
PCI identifiers without being concerned with the actual format of the
database.

What do others think?

Maxim




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-21 19:40     ` [bug#54069] [PATCH 0/2] " Maxim Cournoyer
@ 2022-02-22  8:40       ` Brendan Tildesley
  0 siblings, 0 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-22  8:40 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 54069


> On 02/21/2022 8:40 PM Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> 
>  
> Hi,
> 
> Brendan Tildesley <mail@brendan.scot> writes:
...
> It seems to me perhaps a more proper fix would be to have hwdata used as
> an input, replacing the bundled copy of the pci.ids file file, and then
> letting pciutils proceed as usual?  Disabling compression makes the
> database about 4.3 times larger (1.2 MiB instead of 0.273 MiB).
> 

I mistakenly thought they were not gzip'd in the first place.
Should we have a separate output/package for each of the 3 files, and then 
embed their paths as needed?

> I feel like applications parsing pci.ids themselves should probably rely
> on the pciutils library API instead (libpci.so) to retrieve or filter
> PCI identifiers without being concerned with the actual format of the
> database.
> 

libosinfo also pulls in its own pci.ids. I searched nix and found there are
several more programs that refer to the files directly.

> What do others think?
> 
> Maxim




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-21 16:19 ` John Kehayias via Guix-patches via
@ 2022-02-22 19:34   ` John Kehayias via Guix-patches via
  2022-02-22 21:00     ` Maxim Cournoyer
  0 siblings, 1 reply; 41+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-02-22 19:34 UTC (permalink / raw)
  To: 54069@debbugs.gnu.org; +Cc: Maxim Cournoyer

Hi Brendan and Maxim,

I'm aware of a couple of programs that want to use the plain pci.ids. True, they could use pciutils for that, but pci.ids is very simple, just a list of hardware ids paired with manufacturer/device names. While we can see if upstream for these programs will move to using pciutils, I could see reasons for not wanting the dependency or wanting more current info (especially in Guix where we would only update pciutils on core-updates).

So I would find the separate hwdata package useful for a few packages I have, like mangohud (pending review) and corectrl (not submitted yet). I have to check, but they might only want pci.ids and not anything in pciutils anyway. Also, hwdata provides more data than just pci.ids, which we don't have packaged for Guix as far as I know.

As for pciutils itself, I don't have any strong feelings on its pci.ids. Unbundling the included (old) info and using a hwdata package as input makes sense to me and is more flexible. On core-updates we can make that change for pciutils, where at some point we'd want to freeze what hwdata version it uses. Meanwhile, hwdata can be updated regularly (looks like monthly releases) for up-to-date data.

I think this would keep pciutils small (zipped pci.ids), unbundled/more up to date, and give us the hwdata as a useful package to use.

WDYT?




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-22 19:34   ` John Kehayias via Guix-patches via
@ 2022-02-22 21:00     ` Maxim Cournoyer
  2022-02-22 21:22       ` John Kehayias via Guix-patches via
  0 siblings, 1 reply; 41+ messages in thread
From: Maxim Cournoyer @ 2022-02-22 21:00 UTC (permalink / raw)
  To: John Kehayias; +Cc: 54069@debbugs.gnu.org

Hi John,

John Kehayias <john.kehayias@protonmail.com> writes:

> Hi Brendan and Maxim,
>
> I'm aware of a couple of programs that want to use the plain
> pci.ids. True, they could use pciutils for that, but pci.ids is very
> simple, just a list of hardware ids paired with manufacturer/device
> names. While we can see if upstream for these programs will move to
> using pciutils, I could see reasons for not wanting the dependency or
> wanting more current info (especially in Guix where we would only
> update pciutils on core-updates).
>
> So I would find the separate hwdata package useful for a few packages
> I have, like mangohud (pending review) and corectrl (not submitted
> yet). I have to check, but they might only want pci.ids and not
> anything in pciutils anyway. Also, hwdata provides more data than just
> pci.ids, which we don't have packaged for Guix as far as I know.
>
> As for pciutils itself, I don't have any strong feelings on its
> pci.ids. Unbundling the included (old) info and using a hwdata package
> as input makes sense to me and is more flexible. On core-updates we
> can make that change for pciutils, where at some point we'd want to
> freeze what hwdata version it uses. Meanwhile, hwdata can be updated
> regularly (looks like monthly releases) for up-to-date data.
>
> I think this would keep pciutils small (zipped pci.ids),
> unbundled/more up to date, and give us the hwdata as a useful package
> to use.

I think your proposition makes a lot of sense; the handful of
applications wanting raw pci.ids can have it via hwdata, while our
pciutils package can take (a frozen/fixed variant of hwdata) as an input
to a get a newer yet compressed pci.ids.gz file.

Seems a win/win solution to me!

Thank you,

Maxim




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-22 21:00     ` Maxim Cournoyer
@ 2022-02-22 21:22       ` John Kehayias via Guix-patches via
  2022-02-23  1:08         ` Maxim Cournoyer
  0 siblings, 1 reply; 41+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-02-22 21:22 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 54069@debbugs.gnu.org

Hi Maxim,

------- Original Message -------

On Tuesday, February 22nd, 2022 at 4:00 PM, Maxim Cournoyer wrote:

> I think your proposition makes a lot of sense; the handful of
> applications wanting raw pci.ids can have it via hwdata, while our
> pciutils package can take (a frozen/fixed variant of hwdata) as an input
> to a get a newer yet compressed pci.ids.gz file.
>
> Seems a win/win solution to me!
>

Great! Brendan do you want to update your patches if you agree with this approach? I will test hwdata later for my mangohud patch, but since it is a simple copy install, I don't anticipate any problems.

Oh, and if I understand correctly, keeping pciutils with a pci.ids.gz would avoid a profile collision with hwdata's pci.ids (so you can have both pciutils and the extra data of hwdata), right? Which would also be good.

Thanks everyone,
John




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-22 21:22       ` John Kehayias via Guix-patches via
@ 2022-02-23  1:08         ` Maxim Cournoyer
  2022-02-23  6:16           ` John Kehayias via Guix-patches via
  0 siblings, 1 reply; 41+ messages in thread
From: Maxim Cournoyer @ 2022-02-23  1:08 UTC (permalink / raw)
  To: John Kehayias; +Cc: 54069@debbugs.gnu.org

Hi,

John Kehayias <john.kehayias@protonmail.com> writes:

> Hi Maxim,
>
> ------- Original Message -------
>
> On Tuesday, February 22nd, 2022 at 4:00 PM, Maxim Cournoyer wrote:
>
>> I think your proposition makes a lot of sense; the handful of
>> applications wanting raw pci.ids can have it via hwdata, while our
>> pciutils package can take (a frozen/fixed variant of hwdata) as an input
>> to a get a newer yet compressed pci.ids.gz file.
>>
>> Seems a win/win solution to me!
>>
>
> Great! Brendan do you want to update your patches if you agree with
> this approach? I will test hwdata later for my mangohud patch, but
> since it is a simple copy install, I don't anticipate any problems.
>
> Oh, and if I understand correctly, keeping pciutils with a pci.ids.gz
> would avoid a profile collision with hwdata's pci.ids (so you can have
> both pciutils and the extra data of hwdata), right? Which would also
> be good.

Indeed, I hadn't thought about this but it seems a nice property.

Maxim




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-23  1:08         ` Maxim Cournoyer
@ 2022-02-23  6:16           ` John Kehayias via Guix-patches via
  0 siblings, 0 replies; 41+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-02-23  6:16 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 54069@debbugs.gnu.org

I can report that the hwdata package installs for me, and a pending package (mangohud) that wanted the pci.ids file is happy with just hwdata; pciutils is no longer needed.

I did not do a review of the package definition other than this testing, but it worked and was useful for me.




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-20  9:55 ` [bug#54069] [PATCH 1/2] gnu: Add hwdata Brendan Tildesley
  2022-02-20  9:55   ` [bug#54069] [PATCH 2/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
@ 2022-02-24  3:32   ` Maxim Cournoyer
  2022-02-25  4:44     ` Brendan Tildesley
  1 sibling, 1 reply; 41+ messages in thread
From: Maxim Cournoyer @ 2022-02-24  3:32 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 54069

Hello,

Brendan Tildesley <mail@brendan.scot> writes:

> * gnu/packages/pciutils.scm (hwdata): New variable.
> ---
>  gnu/packages/pciutils.scm | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
> index b6b1e3ad85..416328bda2 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.
>  ;;;
> @@ -25,7 +26,9 @@ (define-module (gnu packages pciutils)
>    #: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 copy)
>    #:use-module (gnu packages)
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages pkg-config)
> @@ -33,6 +36,32 @@ (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 copy-build-system)
> +    (arguments
> +     `(#:install-plan '(("pci.ids" "share/hwdata/pci.ids")
> +                        ("pnp.ids" "share/hwdata/pnp.ids")
> +                        ("usb.ids" "share/hwdata/usb.ids"))))

A Makefile is provided and has an install target; we should use it.  It
installs the following files:

--8<---------------cut here---------------start------------->8---
IDFILES = pci.ids usb.ids oui.txt iab.txt pnp.ids
--8<---------------cut here---------------end--------------->8---


> +    (home-page "https://pci-ids.ucw.cz")

The home page should rather be "https://github.com/vcrhonek/hwdata";
this project aggregates various databases that are sourced not only from
the pciutils project (see:
https://github.com/vcrhonek/hwdata/blob/master/Makefile#L99).

> +    (synopsis "Hardware identification databases")
> +    (description "Hardware databases pci.ids, pnp.ids, and usb.ids including
> +all known ID's used in PCI devices: ID's of vendors, devices, subsystems and
> +device classes.")

I'd take the summary and description from Fedora, which reads better to
me [0]:

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."

[0]  https://src.fedoraproject.org/rpms/hwdata/blob/rawhide/f/hwdata.spec

> +    (license (list license:gpl2+
> +                   license:expat)))) ;; XFree86 1.0
> +;;

Nit-pick: inline comments should be ";some comment" (typically no
capitalization although XFree86 is OK and no space between the single
semicolon and first comment word).

Also some trailing ';;' was added by mistake.

Could you make the changes along those lines and resend a v2 for the
first patch?

Thanks,

Maxim




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-24  3:32   ` Maxim Cournoyer
@ 2022-02-25  4:44     ` Brendan Tildesley
  2022-02-26  5:00       ` Maxim Cournoyer
  0 siblings, 1 reply; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-25  4:44 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 54069


> On 02/24/2022 4:32 AM Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> ...
> 
> A Makefile is provided and has an install target; we should use it.  It
> installs the following files:
> 
> --8<---------------cut here---------------start------------->8---
> IDFILES = pci.ids usb.ids oui.txt iab.txt pnp.ids
> --8<---------------cut here---------------end--------------->8---
> 
Note that it doesn't gzip them, and oui.txt is 8.4MB. Dependencies only tend
to need one or two of these files, lke usb.ids or pci.ids. Also the hwdata project
only updates these every couple months. We could define a package for each individual
file, then if for some reason all are needed in a directory, a "hwdata" union package
 could be created.
Also, this hwdata project is not fully up to date either but have 1-2 month old versions.
It also installs dist-blacklist.conf. Do we need that?




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

* [bug#54069] [PATCH v2 1/4] gnu: Add hwdata.
  2022-02-20  9:53 [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
  2022-02-20  9:55 ` [bug#54069] [PATCH 1/2] gnu: Add hwdata Brendan Tildesley
  2022-02-21 16:19 ` John Kehayias via Guix-patches via
@ 2022-02-26  4:32 ` Brendan Tildesley
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
                     ` (3 more replies)
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
  3 siblings, 4 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-26  4:32 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Maxim Cournoyer

* 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)
   #: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")
-- 
2.34.0





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

* [bug#54069] [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-26  4:32 ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Brendan Tildesley
@ 2022-02-26  4:32   ` Brendan Tildesley
  2022-02-26 14:19     ` Maxim Cournoyer
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-26  4:32 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Maxim Cournoyer

* gnu/packages/pciutils.scm (pciutils):
[inputs]: Add hwdata:pci for latest pci.ids file. Remove zlib since the ids
files aren't gzipped.
[arguments]: Don't install update-pciids script or it's man page. Don't
install bundled old pci.ids file, use hwdata instead.
---
 gnu/packages/pciutils.scm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index f16f420ec2..f7969e0c4d 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -92,7 +92,7 @@ (define-public pciutils
      `(#:phases
        (modify-phases %standard-phases
          (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; There's no 'configure' script, just a raw makefile.
              (substitute* "Makefile"
                ,@(if (%current-target-system)
@@ -122,13 +122,16 @@ (define-public pciutils
                (("^SHARED=.*$")
                 ;; Build libpciutils.so.
                 "SHARED := yes\n")
-               (("^ZLIB=.*$")
-                ;; Ask for zlib support, for 'pci.ids.gz' decompression.
-                "ZLIB := yes\n")
 
                (("^IDSDIR=.*$")
                 ;; Installation directory of 'pci.ids.gz'.
-                "IDSDIR = $(SHAREDIR)/hwdata\n"))))
+                (string-append "IDSDIR = " (assoc-ref inputs "hwdata:pci") "share/hwdata\n"))
+               ;; Don't install update script, its man page, or old bundled pci.ids file.
+               ((".*INSTALL.*update-pciids .*") "")
+               (("update-pciids update-pciids.8 ") "")
+               (("(.*INSTALL.*)(update-pciids.8)(.*)" _ a _ b)
+                (string-append a b))
+               ((".*INSTALL.*PCI_IDS.*") ""))))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Install the commands, library, and .pc files.
@@ -157,7 +160,7 @@ (define-public pciutils
        ,@(if (hurd-target?)
              `(("hurd-patch" ,(search-patch "pciutils-hurd-fix.patch")))
              '())
-       ("zlib" ,zlib)))
+       ("hwdata:pci" ,hwdata "pci")))
     (home-page "https://mj.ucw.cz/sw/pciutils/")
     (synopsis "Programs for inspecting and manipulating PCI devices")
     (description
-- 
2.34.0





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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-26  4:32 ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Brendan Tildesley
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
@ 2022-02-26  4:32   ` Brendan Tildesley
  2022-02-26 11:21     ` Maxime Devos
  2022-02-27 12:12     ` Maxime Devos
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 4/4] gnu: libpciaccess: Use hwdata for pci.ids Brendan Tildesley
  2022-02-26 23:14   ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Maxim Cournoyer
  3 siblings, 2 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-26  4:32 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Maxim Cournoyer

* gnu/packages/virtualization.scm (libosinfo):
[arguments]: Use Gexp style. Use hwdata package for latest usb.ids and
pci.ids.
[inputs]: Add hwdata:pci, hwdata:usb. remove pci.ids, usb.ids origins.
Use new input style.
---
 gnu/packages/virtualization.scm | 64 ++++++++++++++-------------------
 1 file changed, 26 insertions(+), 38 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 506ebe4bc2..c890b43a3e 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
 ;;; Copyright © 2022 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,6 +99,7 @@ (define-module (gnu packages virtualization)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages package-management)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages polkit)
@@ -1027,46 +1029,32 @@ (define-public libosinfo
          "0nd360c9ampw8hb6xh5g45q858df2r4jj9q88bcl6gzgaj0l3wxl"))))
     (build-system meson-build-system)
     (arguments
-     `(#:configure-flags
-       (list (string-append "-Dwith-usb-ids-path="
-                            (assoc-ref %build-inputs "usb.ids"))
-             (string-append "-Dwith-pci-ids-path="
-                            (assoc-ref %build-inputs "pci.ids")))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-osinfo-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "osinfo/osinfo_loader.c"
-               (("path = DATA_DIR.*")
-                (string-append "path = \"" (assoc-ref inputs "osinfo-db")
-                               "/share/osinfo\";"))))))))
+     (list
+      #:configure-flags
+      #~(list
+         (string-append "-Dwith-usb-ids-path=" #$hwdata:usb "/share/hwdata/usb.ids")
+         (string-append "-Dwith-pci-ids-path=" #$hwdata:pci "/share/hwdata/pci.ids"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-osinfo-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "osinfo/osinfo_loader.c"
+                (("path = DATA_DIR.*")
+                 (string-append "path = \"" #$osinfo-db "/share/osinfo\";"))))))))
     (inputs
-     `(("libsoup" ,libsoup-minimal-2)
-       ("libxml2" ,libxml2)
-       ("libxslt" ,libxslt)
-       ("osinfo-db" ,osinfo-db)))
+     (list libsoup-minimal-2
+           libxml2
+           libxslt
+           osinfo-db))
     (native-inputs
-     `(("glib" ,glib "bin")  ; glib-mkenums, etc.
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk-doc" ,gtk-doc/stable)
-       ("vala" ,vala)
-       ("intltool" ,intltool)
-       ("pkg-config" ,pkg-config)
-       ("pci.ids"
-        ,(origin
-           (method url-fetch)
-           (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
-           (sha256
-            (base32
-             "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
-       ("usb.ids"
-        ,(origin
-           (method url-fetch)
-           (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
-           (file-name "usb.ids")
-           (sha256
-            (base32
-             "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
+     (list `(,glib "bin")  ; glib-mkenums, etc.
+           gobject-introspection
+           gtk-doc/stable
+           vala
+           intltool
+           pkg-config
+           `(,hwdata "pci")
+           `(,hwdata "usb")))
     (home-page "https://libosinfo.org/")
     (synopsis "Operating system information database")
     (description "libosinfo is a GObject based library API for managing
-- 
2.34.0





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

* [bug#54069] [PATCH v2 4/4] gnu: libpciaccess: Use hwdata for pci.ids.
  2022-02-26  4:32 ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Brendan Tildesley
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
@ 2022-02-26  4:32   ` Brendan Tildesley
  2022-02-26 23:14   ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Maxim Cournoyer
  3 siblings, 0 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-26  4:32 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Maxim Cournoyer

* gnu/packages/xorg.scm (libpciaccess):
[arguments]: Remove zlib support since pci.ids isn't gzipped. Use Gexp.
[inputs]: Add hwdata:pci, remove zlib, pciutils.
[native-inputs]: Remove pkg-config since zlib isn't used.
---
 gnu/packages/xorg.scm | 31 ++++++-------------------------
 1 file changed, 6 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 14e35d19ae..99ef114e9c 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 qblade <qblade@protonmail.com>
 ;;; Copyright © 2021 Lu Hui <luhux76@gmail.com>
+;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1150,36 +1151,16 @@ (define-public libpciaccess
         (method url-fetch)
         (uri (string-append
                "mirror://xorg/individual/lib/libpciaccess-"
-               version
-               ".tar.bz2"))
+               version ".tar.bz2"))
         (sha256
           (base32
             "12glp4w1kgvmqn89lk19cgr6jccd3awxra4dxisp7pagi06rsk11"))))
     (build-system gnu-build-system)
     (arguments
-     '(;; Make sure libpciaccess can read compressed 'pci.ids' files as
-       ;; provided by pciutils.
-       #:configure-flags
-       (list "--with-zlib"
-             (string-append "--with-pciids-path="
-                            (assoc-ref %build-inputs "pciutils")
-                            "/share/hwdata"))
-
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'add-L-zlib
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             ;; Provide '-LZLIB/lib' next to '-lz' in the .la file.
-             (let ((zlib (assoc-ref inputs "zlib"))
-                   (out  (assoc-ref outputs "out")))
-               (substitute* (string-append out "/lib/libpciaccess.la")
-                 (("-lz")
-                  (string-append "-L" zlib "/lib -lz")))
-               #t))))))
-    (inputs
-     (list zlib pciutils))                   ;for 'pci.ids.gz'
-    (native-inputs
-       (list pkg-config))
+     (list
+      #:configure-flags
+      #~(list (string-append "--with-pciids-path=" #$hwdata:pci "/share/hwdata"))))
+    (inputs (list `(,hwdata "pci")))
     (home-page "https://www.x.org/wiki/")
     (synopsis "Xorg PCI access library")
     (description "Xorg Generic PCI access library.")
-- 
2.34.0





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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-25  4:44     ` Brendan Tildesley
@ 2022-02-26  5:00       ` Maxim Cournoyer
  0 siblings, 0 replies; 41+ messages in thread
From: Maxim Cournoyer @ 2022-02-26  5:00 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 54069

Hi Brendan,

Brendan Tildesley <mail@brendan.scot> writes:

>> On 02/24/2022 4:32 AM Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>> ...
>> 
>> A Makefile is provided and has an install target; we should use it.  It
>> installs the following files:
>> 
>> --8<---------------cut here---------------start------------->8---
>> IDFILES = pci.ids usb.ids oui.txt iab.txt pnp.ids
>> --8<---------------cut here---------------end--------------->8---
>> 
> Note that it doesn't gzip them, and oui.txt is 8.4MB. Dependencies only tend
> to need one or two of these files, lke usb.ids or pci.ids. Also the hwdata project
> only updates these every couple months. We could define a package for each individual
> file, then if for some reason all are needed in a directory, a "hwdata" union package
>  could be created.

Unless there's a good reason to split the package (which could be
multiple outputs instead of multiple packages), I'd leave it the way
upstream intended it; and there's no better place for inspiration than
[0] for that, as the Fedora package maintainer happens to also be the
maintainer of hwdata :-).

[0]  https://src.fedoraproject.org/rpms/hwdata/blob/rawhide/f/hwdata.spec

*If* we want to have our pciutils package use the hwdata pci.ids, we can
avoid depending on the bigger 'hwdata' package by copying hwdata's
pci.ids over its own, and then build as usual.

Does that make sense?

Thank you for looking into it!

Maxim




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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
@ 2022-02-26 11:21     ` Maxime Devos
  2022-02-27  1:37       ` Brendan Tildesley
  2022-02-27 12:12     ` Maxime Devos
  1 sibling, 1 reply; 41+ messages in thread
From: Maxime Devos @ 2022-02-26 11:21 UTC (permalink / raw)
  To: Brendan Tildesley, 54069; +Cc: John Kehayias, Maxim Cournoyer

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

Brendan Tildesley schreef op za 26-02-2022 om 15:32 [+1100]:
> +         (string-append "-Dwith-usb-ids-path=" #$hwdata:usb "/share/hwdata/usb.ids")
> +         (string-append "-Dwith-pci-ids-path=" #$hwdata:pci "/share/hwdata/pci.ids"))

To allow for package transformations, I recommend using
this-package-input or the like instead of hardcoding a particular
package:

#~(list
    (string-append
      "-Dwith-usb-ids-path="
      #$(this-package-input "hwdata:usb") "/share/hwdata/usb.ids"))
    [...])

it might also be possible to use 'search-input-file' instead, avoiding
input labels (untested):

#~(let* ((inputs #$(input-tuples->gexp (package-inputs this-package)))
         (usb.ids (search-input-file inputs "/share/hwdata/usb.ids"))
         (pci.ids (search-input-file inputs "/share/hwdata/pci.ids")))
    (list (string-append "-Dwith-usb-ids-path=" usb.ids) [...]))

Greetings,
Maxime.
  

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

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

* [bug#54069] [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
@ 2022-02-26 14:19     ` Maxim Cournoyer
  0 siblings, 0 replies; 41+ messages in thread
From: Maxim Cournoyer @ 2022-02-26 14:19 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: John Kehayias, 54069

Hi Brendan,

Brendan Tildesley <mail@brendan.scot> writes:

> * gnu/packages/pciutils.scm (pciutils):
> [inputs]: Add hwdata:pci for latest pci.ids file. Remove zlib since the ids
> files aren't gzipped.
> [arguments]: Don't install update-pciids script or it's man page. Don't
> install bundled old pci.ids file, use hwdata instead.
> ---
>  gnu/packages/pciutils.scm | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
> index f16f420ec2..f7969e0c4d 100644
> --- a/gnu/packages/pciutils.scm
> +++ b/gnu/packages/pciutils.scm
> @@ -92,7 +92,7 @@ (define-public pciutils
>       `(#:phases
>         (modify-phases %standard-phases
>           (replace 'configure
> -           (lambda* (#:key outputs #:allow-other-keys)
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>               ;; There's no 'configure' script, just a raw makefile.
>               (substitute* "Makefile"
>                 ,@(if (%current-target-system)
> @@ -122,13 +122,16 @@ (define-public pciutils
>                 (("^SHARED=.*$")
>                  ;; Build libpciutils.so.
>                  "SHARED := yes\n")
> -               (("^ZLIB=.*$")
> -                ;; Ask for zlib support, for 'pci.ids.gz' decompression.
> -                "ZLIB := yes\n")
>  
>                 (("^IDSDIR=.*$")
>                  ;; Installation directory of 'pci.ids.gz'.
> -                "IDSDIR = $(SHAREDIR)/hwdata\n"))))
> +                (string-append "IDSDIR = " (assoc-ref inputs "hwdata:pci") "share/hwdata\n"))
> +               ;; Don't install update script, its man page, or old bundled pci.ids file.
> +               ((".*INSTALL.*update-pciids .*") "")
> +               (("update-pciids update-pciids.8 ") "")
> +               (("(.*INSTALL.*)(update-pciids.8)(.*)" _ a _ b)
> +                (string-append a b))
> +               ((".*INSTALL.*PCI_IDS.*") ""))))
>           (replace 'install
>             (lambda* (#:key outputs #:allow-other-keys)
>               ;; Install the commands, library, and .pc files.
> @@ -157,7 +160,7 @@ (define-public pciutils
>         ,@(if (hurd-target?)
>               `(("hurd-patch" ,(search-patch "pciutils-hurd-fix.patch")))
>               '())
> -       ("zlib" ,zlib)))
> +       ("hwdata:pci" ,hwdata "pci")))
>      (home-page "https://mj.ucw.cz/sw/pciutils/")
>      (synopsis "Programs for inspecting and manipulating PCI devices")
>      (description

Thank you for refreshing this series.  It's starting to look good!

For pciutils though, what I had in mind was more like this:

1. copy hwdata's pci.ids *over* pciutils one after unpack.  This means
hwdata can be a simple native-input and no run time reference gets
registered.

2. This would leave the rest of the build unaltered, so that our
pciutils package could still be smaller thanks to the gzip'd pci.ids.gz
(generated at build time from the version copied from hwdawa).

Does this makes sense?

Thanks again,

Maxim




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

* [bug#54069] [PATCH v2 1/4] gnu: Add hwdata.
  2022-02-26  4:32 ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Brendan Tildesley
                     ` (2 preceding siblings ...)
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 4/4] gnu: libpciaccess: Use hwdata for pci.ids Brendan Tildesley
@ 2022-02-26 23:14   ` Maxim Cournoyer
  2022-02-27 12:08     ` Maxime Devos
  3 siblings, 1 reply; 41+ messages in thread
From: Maxim Cournoyer @ 2022-02-26 23:14 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: John Kehayias, 54069

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




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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-26 11:21     ` Maxime Devos
@ 2022-02-27  1:37       ` Brendan Tildesley
  2022-02-27 10:46         ` Maxime Devos
  0 siblings, 1 reply; 41+ messages in thread
From: Brendan Tildesley @ 2022-02-27  1:37 UTC (permalink / raw)
  To: Maxime Devos, 54069; +Cc: John Kehayias, Maxim Cournoyer


> On 02/26/2022 12:21 PM Maxime Devos <maximedevos@telenet.be> wrote:
> 
>  
> Brendan Tildesley schreef op za 26-02-2022 om 15:32 [+1100]:
> > +         (string-append "-Dwith-usb-ids-path=" #$hwdata:usb "/share/hwdata/usb.ids")
> > +         (string-append "-Dwith-pci-ids-path=" #$hwdata:pci "/share/hwdata/pci.ids"))
> 
> To allow for package transformations, I recommend using
> this-package-input or the like instead of hardcoding a particular
> package:
> 
> #~(list
>     (string-append
>       "-Dwith-usb-ids-path="
>       #$(this-package-input "hwdata:usb") "/share/hwdata/usb.ids"))
>     [...])
> 
> it might also be possible to use 'search-input-file' instead, avoiding
> input labels (untested):
> 
> #~(let* ((inputs #$(input-tuples->gexp (package-inputs this-package)))
>          (usb.ids (search-input-file inputs "/share/hwdata/usb.ids"))
>          (pci.ids (search-input-file inputs "/share/hwdata/pci.ids")))
>     (list (string-append "-Dwith-usb-ids-path=" usb.ids) [...]))
> 
I got strange errors trying that and couldn't figure out how to make it work.
There are no examples of input-tuples->gexp being used in a package definition.

This works:
 #~(list
         (string-append "-Dwith-usb-ids-path="
                        (search-input-file %build-inputs "/share/hwdata/usb.ids"))
         (string-append "-Dwith-pci-ids-path="
                        (search-input-file %build-inputs "/share/hwdata/pci.ids")))

I thought %build-inputs was not a recommended thing to use though?
> Greetings,
> Maxime.




Backtrace:
In guix/store.scm:
   1385:9 19 (map/accumulate-builds #<store-connection 256.99 7f3a3…> …)
   1320:8 18 (call-with-build-handler #<procedure 7f3a22f4b360 at g…> …)
In guix/scripts/build.scm:
   582:16 17 (_ #<package libosinfo@1.9.0 /home/b/code/guix/gnu/pack…>)
   571:24 16 (_ #<package libosinfo@1.9.0 /home/b/code/guix/gnu/pac…> …)
In guix/packages.scm:
  1260:17 15 (supported-package? #<package libosinfo@1.9.0 /home/b/…> …)
In guix/memoization.scm:
    101:0 14 (_ #<hash-table 7f3a2538e7a0 0/31> #<package libosinfo…> …)
In guix/packages.scm:
  1238:37 13 (_)
  1498:16 12 (package->bag _ _ _ #:graft? _)
  1603:43 11 (thunk)
In ice-9/eval.scm:
   191:35 10 (_ #(#(#<directory (gnu packages virtualization) 7f…>) …))
   173:47  9 (_ #(#(#<directory (gnu packages virtualization) 7f…>) …))
   213:29  8 (_ #(#(#<directory (gnu packages virtualization) 7f…>) …))
    155:9  7 (_ #(#(#<directory (gnu packages virtualization) 7f…>) …))
   202:35  6 (_ #(#(#<directory (gnu packages virtualization) 7f…>) …))
In guix/gexp.scm:
   1886:4  5 (input-tuples->gexp (("glib" #<package glib@2.70…> …) …) …)
In srfi/srfi-1.scm:
   586:17  4 (map1 (("glib" #<package glib@2.70.2 gnu/packages…> …) …))
In guix/gexp.scm:
   1886:9  3 (_ _)
In ice-9/boot-9.scm:
  1685:16  2 (raise-exception _ #:continuable? _)
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `match-error' with args `("match" "no matching pattern" ("glib" #<package glib@2.70.2 gnu/packages/glib.scm:180 7f3a24fdbdc0> "bin"))'.




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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-27  1:37       ` Brendan Tildesley
@ 2022-02-27 10:46         ` Maxime Devos
  2022-02-27 10:56           ` Maxime Devos
  0 siblings, 1 reply; 41+ messages in thread
From: Maxime Devos @ 2022-02-27 10:46 UTC (permalink / raw)
  To: Brendan Tildesley, 54069; +Cc: John Kehayias, ludo, Maxim Cournoyer

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

Brendan Tildesley schreef op zo 27-02-2022 om 02:37 [+0100]:
> I got strange errors trying that and couldn't figure out how to make it work.
> There are no examples of input-tuples->gexp being used in a package definition.
> 
> This works:
>  #~(list
>          (string-append "-Dwith-usb-ids-path="
>                         (search-input-file %build-inputs "/share/hwdata/usb.ids"))
>          (string-append "-Dwith-pci-ids-path="
>                         (search-input-file %build-inputs "/share/hwdata/pci.ids")))
> 
> I thought %build-inputs was not a recommended thing to use though?

It is.  Anyway, I found a solution, see attachement.

Maybe the 'gexp-input-compiler' could be moved into (guix gexp)
and 'this-package-input-list'/'this-package-native-input-list' could
be moved into (guix packages) (+ documented in the manual)?

CC'ing ludo for the proposed new gexpology.

Greetings,
Maxime.

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

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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-27 10:46         ` Maxime Devos
@ 2022-02-27 10:56           ` Maxime Devos
  2022-02-27 21:23             ` Ludovic Courtès
  0 siblings, 1 reply; 41+ messages in thread
From: Maxime Devos @ 2022-02-27 10:56 UTC (permalink / raw)
  To: Brendan Tildesley, 54069; +Cc: John Kehayias, ludo, Maxim Cournoyer


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

Maxime Devos schreef op zo 27-02-2022 om 11:46 [+0100]:
> 
> It is.  Anyway, I found a solution, see attachement.

Oops forgot the attachement


> Maybe the 'gexp-input-compiler' could be moved into (guix gexp)
> and 'this-package-input-list'/'this-package-native-input-list' could
> be moved into (guix packages) (+ documented in the manual)?
> 
> CC'ing ludo for the proposed new gexpology.
> 
> Greetings,
> Maxime.


[-- Attachment #1.2: foo --]
[-- Type: text/plain, Size: 4533 bytes --]

(use-modules (guix packages) (gnu packages) (gnu packages gtk) (gnu packages glib) (guix gexp)
             (gnu packages gnome) (gnu packages xml) (gnu packages virtualization)
             (gnu packages pkg-config) (guix git-download) (guix build-system gnu)
             (guix build-system meson) (gnu packages compression) (ice-9 match)
             (guix monads) (guix store) (guix derivations)
             ((guix licenses) #:prefix license:))


(define <gexp-input> (@@ (guix gexp) <gexp-input>))
(define-gexp-compiler gexp-input-compiler <gexp-input>
  compiler => (lambda (input system target)
                (lower-object (gexp-input-thing input) system
                              #:target
                              (and (not (gexp-input-native? input)) target)))
  expander => (lambda (object lowered output)
                (derivation->output-path lowered (gexp-input-output object))))

 
(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* (package-input-list->build-input-list inputs native?)
  "Expand INPUTS, a list of input tuples, into a list of name/<gexp-input>
tulples."
  #~'#$(map (match-lambda
              ((name object output)
               #~(#$name . #$(gexp-input object output #:native? native?)))
              ((name object) #~(#$name . #$object)))
            inputs))

(define-syntax this-package-input-list
  (identifier-syntax
    (package-input-list->build-input-list
      (append (package-inputs this-package)
              (package-propagated-inputs this-package))
      #false)))

(define-syntax this-package-native-input-list
  (identifier-syntax
    (package-input-list->build-input-list
      (package-native-inputs this-package) #true)))

(define libosinfo-new
  (package
    (inherit (specification->package "libosinfo"))
    (arguments
      (list #:configure-flags
            #~(let* ((inputs #$this-package-native-input-list)
                     (usb.ids (search-input-file inputs "/share/hwdata/usb.ids"))
                     (pci.ids (search-input-file inputs "/share/hwdata/pci.ids")))
                (list (string-append "-Dwith-usb-ids-path=" usb.ids)
                      (string-append "-Dwith-pci-ids-path=" pci.ids)))
            #:phases
            #~(modify-phases %standard-phases
                (add-after 'unpack 'patch-osinfo-path
                  (lambda* (#:key inputs #:allow-other-keys)
                    (substitute* "osinfo/osinfo_loader.c"
                      (("path = DATA_DIR.*")
                       (string-append "path = \"" (search-input-directory inputs "/share/osinfo") "\";"))))))))
    (inputs
      (list libsoup-minimal-2 libxml2 libxslt osinfo-db))
    (native-inputs
      (list `(,glib "bin")
            gobject-introspection
            gtk-doc/stable
            vala
            intltool
            pkg-config
            `(,hwdata "pci")
            `(,hwdata "usb")))))
libosinfo-new

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

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

* [bug#54069] [PATCH v2 1/4] gnu: Add hwdata.
  2022-02-26 23:14   ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Maxim Cournoyer
@ 2022-02-27 12:08     ` Maxime Devos
  0 siblings, 0 replies; 41+ messages in thread
From: Maxime Devos @ 2022-02-27 12:08 UTC (permalink / raw)
  To: Maxim Cournoyer, Brendan Tildesley; +Cc: John Kehayias, 54069

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

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.

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

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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-26  4:32   ` [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
  2022-02-26 11:21     ` Maxime Devos
@ 2022-02-27 12:12     ` Maxime Devos
  1 sibling, 0 replies; 41+ messages in thread
From: Maxime Devos @ 2022-02-27 12:12 UTC (permalink / raw)
  To: Brendan Tildesley, 54069; +Cc: John Kehayias, Maxim Cournoyer

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

Brendan Tildesley schreef op za 26-02-2022 om 15:32 [+1100]:
> +           `(,hwdata "pci")
> +           `(,hwdata "usb")))

I would put these in 'inputs', since they are kept in the closure,
and I'd like to eventually automatically implicitely set #:allowed-
references to make sure only (non-native) inputs make their way into
the references, to catch some cross-compilation bugs early.

It doesn't truly matter here though, since hwdata is architecture-
independent.

Greetings,
Maxime.

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

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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-27 10:56           ` Maxime Devos
@ 2022-02-27 21:23             ` Ludovic Courtès
  2022-02-27 22:17               ` Maxime Devos
  2022-02-27 22:18               ` Maxime Devos
  0 siblings, 2 replies; 41+ messages in thread
From: Ludovic Courtès @ 2022-02-27 21:23 UTC (permalink / raw)
  To: Maxime Devos; +Cc: John Kehayias, 54069, Brendan Tildesley, Maxim Cournoyer

Hello!

Maxime Devos <maximedevos@telenet.be> skribis:

> (define libosinfo-new
>   (package
>     (inherit (specification->package "libosinfo"))
>     (arguments
>       (list #:configure-flags
>             #~(let* ((inputs #$this-package-native-input-list)
>                      (usb.ids (search-input-file inputs "/share/hwdata/usb.ids"))
>                      (pci.ids (search-input-file inputs "/share/hwdata/pci.ids")))
>                 (list (string-append "-Dwith-usb-ids-path=" usb.ids)
>                       (string-append "-Dwith-pci-ids-path=" pci.ids)))

I think this is equivalent to:

  #~(let* ((inputs #$(input-tuples->gexp (package-inputs this-package)))
           …)
      …)

Am I right?

However, that looks a bit far-fetched to me.

Can’t we instead do:

  #~(let* ((usb.ids (string-append #$hwdata:usb "/share/hwdata/usb.ids"))
           (pci.ids (string-append #$hwdata:pci "/share/hwdata/pci.ids")))
      …)

?

Ludo’.




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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-27 21:23             ` Ludovic Courtès
@ 2022-02-27 22:17               ` Maxime Devos
  2022-02-28 11:48                 ` Ludovic Courtès
  2022-02-27 22:18               ` Maxime Devos
  1 sibling, 1 reply; 41+ messages in thread
From: Maxime Devos @ 2022-02-27 22:17 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: John Kehayias, 54069, Brendan Tildesley, Maxim Cournoyer

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

Ludovic Courtès schreef op zo 27-02-2022 om 22:23 [+0100]:
> Can’t we instead do:
> 
>   #~(let* ((usb.ids (string-append #$hwdata:usb "/share/hwdata/usb.ids"))
>            (pci.ids (string-append #$hwdata:pci "/share/hwdata/pci.ids")))
>       …)
> 
> ?

We could, and that's what the original v2 patch did.
However, this prevents package transformations:

  (package
    (inherit libosinfo)
    (native-inputs
      ;; not sure about the syntax 
      (modify-inputs (package-inputs libosinfo)
        (replace "hwdata:usb"
          hwdata-with-some-new-fancy-hardware "usb"))))

Greetings,
Maxime.

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

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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-27 21:23             ` Ludovic Courtès
  2022-02-27 22:17               ` Maxime Devos
@ 2022-02-27 22:18               ` Maxime Devos
  1 sibling, 0 replies; 41+ messages in thread
From: Maxime Devos @ 2022-02-27 22:18 UTC (permalink / raw)
  To: Ludovic Courtès
  Cc: John Kehayias, 54069, Brendan Tildesley, Maxim Cournoyer

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

Ludovic Courtès schreef op zo 27-02-2022 om 22:23 [+0100]:
> I think this is equivalent to:
> 
>   #~(let* ((inputs #$(input-tuples->gexp (package-inputs this-package)))
>            …)
>       …)
> 
> Am I right?

That's what I suggested initially:

> > #~(let* ((inputs #$(input-tuples->gexp (package-inputs this-
> package)))
> >          (usb.ids (search-input-file inputs
> "/share/hwdata/usb.ids"))
> >          (pci.ids (search-input-file inputs
> "/share/hwdata/pci.ids")))
> >     (list (string-append "-Dwith-usb-ids-path=" usb.ids) [...]))
> > 
> 

However, that lead to errors -- strings like #<package foo [...]>
appeared in the builder.

Greetings,
Maxime.

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

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

* [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-02-27 22:17               ` Maxime Devos
@ 2022-02-28 11:48                 ` Ludovic Courtès
  0 siblings, 0 replies; 41+ messages in thread
From: Ludovic Courtès @ 2022-02-28 11:48 UTC (permalink / raw)
  To: Maxime Devos; +Cc: John Kehayias, 54069, Brendan Tildesley, Maxim Cournoyer

Hi!

Maxime Devos <maximedevos@telenet.be> skribis:

> Ludovic Courtès schreef op zo 27-02-2022 om 22:23 [+0100]:
>> Can’t we instead do:
>> 
>>   #~(let* ((usb.ids (string-append #$hwdata:usb "/share/hwdata/usb.ids"))
>>            (pci.ids (string-append #$hwdata:pci "/share/hwdata/pci.ids")))
>>       …)
>> 
>> ?
>
> We could, and that's what the original v2 patch did.
> However, this prevents package transformations:

Right, but maybe that’s good enough?…

Otherwise, we can do:

  #~(let* ((usb.ids (string-append
                     (ungexp (this-package-inputs "hwdata") "usb")
                     …)))
      …)


[...]

> Ludovic Courtès schreef op zo 27-02-2022 om 22:23 [+0100]:
>> I think this is equivalent to:
>> 
>>   #~(let* ((inputs #$(input-tuples->gexp (package-inputs this-package)))
>>            …)
>>       …)
>> 
>> Am I right?
>
> That's what I suggested initially:
>
>> > #~(let* ((inputs #$(input-tuples->gexp (package-inputs this-
>> package)))
>> >          (usb.ids (search-input-file inputs
>> "/share/hwdata/usb.ids"))
>> >          (pci.ids (search-input-file inputs
>> "/share/hwdata/pci.ids")))
>> >     (list (string-append "-Dwith-usb-ids-path=" usb.ids) [...]))
>> > 
>> 
>
> However, that lead to errors -- strings like #<package foo [...]>
> appeared in the builder.

Hmm weird.

Thanks,
Ludo’.




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

* [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata
  2022-02-20  9:53 [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
                   ` (2 preceding siblings ...)
  2022-02-26  4:32 ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Brendan Tildesley
@ 2022-03-10  9:31 ` Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 1/7] gnu: hwdata: Set #:target #f Brendan Tildesley
                     ` (6 more replies)
  3 siblings, 7 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

I have used the ungexp suggestion Ludo made. I don't have any stance
on the gexp-ology business, so I just did that.
Feel free to change it however one wishes.

the hwata updates can go to master, but the rest should be considered for
core-updates i think?

I have fixed up the pciutils definiton a bit, where I had previously
removed the installation of a man page by mistake.

Implemented the #:target #f suggestion in hwdata, and fixed a small
mistake.

I was away from the computer for a week so I hope I haven't forgotten
to consider all feedback.

Updated hwdata to 357.






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

* [bug#54069] [PATCH v3 1/7] gnu: hwdata: Set #:target #f.
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
@ 2022-03-10  9:31   ` Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 2/7] gnu: hwdata: Remove unused gzip native-input Brendan Tildesley
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

* gnu/packages/pciutils.scm (hwdata): Set #:target #f to make
cross-compiling free, as explained by Maxime in bug#54069.
---
 gnu/packages/pciutils.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index 34abfb3c2d..5c25e78ac9 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -56,6 +56,7 @@ (define-public hwdata
      ;; Tests require pciutils, python, podman. Disable to avoid recursive dep.
      (list
       #:tests? #f
+      #:target #f ; Make the derivation the same when cross-compiling, since it's just data.
       #:configure-flags #~(list (string-append "--datadir=" #$output "/share"))
       #:phases
       #~(modify-phases %standard-phases
-- 
2.34.0





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

* [bug#54069] [PATCH v3 2/7] gnu: hwdata: Remove unused gzip native-input.
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 1/7] gnu: hwdata: Set #:target #f Brendan Tildesley
@ 2022-03-10  9:31   ` Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 3/7] gnu: hwdata: Update to 0.357 Brendan Tildesley
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

* gnu/packages/pciutils.scm (hwdata): I accidently left this gzip input
here which is unused. Remove it.
---
 gnu/packages/pciutils.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index 5c25e78ac9..bad42e238d 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -51,7 +51,6 @@ (define-public hwdata
                 "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
-- 
2.34.0





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

* [bug#54069] [PATCH v3 3/7] gnu: hwdata: Update to 0.357.
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 1/7] gnu: hwdata: Set #:target #f Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 2/7] gnu: hwdata: Remove unused gzip native-input Brendan Tildesley
@ 2022-03-10  9:31   ` Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 4/7] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

* gnu/packages/pciutils.scm (hwdata): Update to 0.357.
---
 gnu/packages/pciutils.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index bad42e238d..41ba10f1e1 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -39,7 +39,7 @@ (define-module (gnu packages pciutils)
 (define-public hwdata
   (package
     (name "hwdata")
-    (version "0.356")
+    (version "0.357") ;hwdata is updated monthly
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -48,7 +48,7 @@ (define-public hwdata
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0m04d93dwiplwp9v74nhnc0hyi2n007mylkg8f0frb46z5qjrpl3"))))
+                "0kvxpdx14w2myqm3dikjvr2mr4j6767y4v5j8v7kffwvcv0ga9gv"))))
     (build-system gnu-build-system)
     (outputs '("out" "iab" "oui" "pci" "pnp" "usb"))
     (arguments
-- 
2.34.0





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

* [bug#54069] [PATCH v3 4/7] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
                     ` (2 preceding siblings ...)
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 3/7] gnu: hwdata: Update to 0.357 Brendan Tildesley
@ 2022-03-10  9:31   ` Brendan Tildesley
  2022-03-23  1:57     ` [bug#54069] [PATCH 0/2] " Maxim Cournoyer
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 5/7] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
                     ` (2 subsequent siblings)
  6 siblings, 1 reply; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

* gnu/packages/pciutils.scm (pciutils):
[inputs]: Add hwdata:pci for latest pci.ids file.
[arguments]: Don't install update-pciids script or it's man page. Don't
install bundled old pci.ids file, use hwdata instead. Copy the pci.ids
over so it can be gzipped.
---
 gnu/packages/pciutils.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index 41ba10f1e1..648d1385e4 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -93,8 +93,13 @@ (define-public pciutils
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'unbundle-pci.ids
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (copy-file (string-append (assoc-ref inputs "hwdata:pci")
+                                       "/share/hwdata/pci.ids")
+                        "pci.ids")))
          (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; There's no 'configure' script, just a raw makefile.
              (substitute* "Makefile"
                ,@(if (%current-target-system)
@@ -124,13 +129,19 @@ (define-public pciutils
                (("^SHARED=.*$")
                 ;; Build libpciutils.so.
                 "SHARED := yes\n")
+
                (("^ZLIB=.*$")
                 ;; Ask for zlib support, for 'pci.ids.gz' decompression.
                 "ZLIB := yes\n")
 
                (("^IDSDIR=.*$")
                 ;; Installation directory of 'pci.ids.gz'.
-                "IDSDIR = $(SHAREDIR)/hwdata\n"))))
+                "IDSDIR = $(SHAREDIR)/hwdata\n")
+               ;; Don't install update script or its man page,
+               ((".*INSTALL.*update-pciids .*") "")
+               (("update-pciids update-pciids.8 ") "")
+               (("(.*INSTALL.*)(update-pciids.8)(.*)" _ a _ b)
+                (string-append a b)))))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Install the commands, library, and .pc files.
@@ -159,7 +170,8 @@ (define-public pciutils
        ,@(if (hurd-target?)
              `(("hurd-patch" ,(search-patch "pciutils-hurd-fix.patch")))
              '())
-       ("zlib" ,zlib)))
+       ("zlib" ,zlib)
+       ("hwdata:pci" ,hwdata "pci")))
     (home-page "https://mj.ucw.cz/sw/pciutils/")
     (synopsis "Programs for inspecting and manipulating PCI devices")
     (description
-- 
2.34.0





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

* [bug#54069] [PATCH v3 5/7] gnu: libosinfo: Unbundle usb.ids, pci.ids.
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
                     ` (3 preceding siblings ...)
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 4/7] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
@ 2022-03-10  9:31   ` Brendan Tildesley
  2022-03-23  2:14     ` bug#54069: [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Maxim Cournoyer
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 6/7] gnu: libosinfo: Use this-package-input Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 7/7] gnu: libpciaccess: Use hwdata for pci.ids Brendan Tildesley
  6 siblings, 1 reply; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

* gnu/packages/virtualization.scm (libosinfo):
[arguments]: Use Gexp style. Use hwdata package for latest usb.ids and
pci.ids.
[inputs]: Add hwdata:pci, hwdata:usb. remove pci.ids, usb.ids origins.
Use new input style.
---
 gnu/packages/virtualization.scm | 68 +++++++++++++++------------------
 1 file changed, 30 insertions(+), 38 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 8098a0aec3..5756c49b07 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
 ;;; Copyright © 2022 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -98,6 +99,7 @@ (define-module (gnu packages virtualization)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages package-management)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages polkit)
@@ -1031,46 +1033,36 @@ (define-public libosinfo
          "0nd360c9ampw8hb6xh5g45q858df2r4jj9q88bcl6gzgaj0l3wxl"))))
     (build-system meson-build-system)
     (arguments
-     `(#:configure-flags
-       (list (string-append "-Dwith-usb-ids-path="
-                            (assoc-ref %build-inputs "usb.ids"))
-             (string-append "-Dwith-pci-ids-path="
-                            (assoc-ref %build-inputs "pci.ids")))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-osinfo-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "osinfo/osinfo_loader.c"
-               (("path = DATA_DIR.*")
-                (string-append "path = \"" (assoc-ref inputs "osinfo-db")
-                               "/share/osinfo\";"))))))))
+     (list
+      #:configure-flags
+      #~(list
+         (string-append "-Dwith-usb-ids-path="
+                        (ungexp (this-package-input "hwdata") "usb")
+                        "/share/hwdata/usb.ids")
+         (string-append "-Dwith-pci-ids-path="
+                        (ungexp (this-package-input "hwdata") "pci")
+                        "/share/hwdata/pci.ids"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-osinfo-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "osinfo/osinfo_loader.c"
+                (("path = DATA_DIR.*")
+                 (string-append "path = \"" #$osinfo-db "/share/osinfo\";"))))))))
     (inputs
-     `(("libsoup" ,libsoup-minimal-2)
-       ("libxml2" ,libxml2)
-       ("libxslt" ,libxslt)
-       ("osinfo-db" ,osinfo-db)))
+     (list libsoup-minimal-2
+           libxml2
+           libxslt
+           osinfo-db
+           `(,hwdata "pci")
+           `(,hwdata "usb")))
     (native-inputs
-     `(("glib" ,glib "bin")  ; glib-mkenums, etc.
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk-doc" ,gtk-doc/stable)
-       ("vala" ,vala)
-       ("intltool" ,intltool)
-       ("pkg-config" ,pkg-config)
-       ("pci.ids"
-        ,(origin
-           (method url-fetch)
-           (uri "https://github.com/pciutils/pciids/raw/ad02084f0bc143e3c15e31a6152a3dfb1d7a3156/pci.ids")
-           (sha256
-            (base32
-             "0kfhpj5rnh24hz2714qhfmxk281vwc2w50sm73ggw5d15af7zfsw"))))
-       ("usb.ids"
-        ,(origin
-           (method url-fetch)
-           (uri "https://svn.code.sf.net/p/linux-usb/repo/trunk/htdocs/usb.ids?r=2681")
-           (file-name "usb.ids")
-           (sha256
-            (base32
-             "1m6yhvz5k8aqzxgk7xj3jkk8frl1hbv0h3vgj4wbnvnx79qnvz3r"))))))
+     (list `(,glib "bin")  ; glib-mkenums, etc.
+           gobject-introspection
+           gtk-doc/stable
+           vala
+           intltool
+           pkg-config))
     (home-page "https://libosinfo.org/")
     (synopsis "Operating system information database")
     (description "libosinfo is a GObject based library API for managing
-- 
2.34.0





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

* [bug#54069] [PATCH v3 6/7] gnu: libosinfo: Use this-package-input.
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
                     ` (4 preceding siblings ...)
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 5/7] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
@ 2022-03-10  9:31   ` Brendan Tildesley
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 7/7] gnu: libpciaccess: Use hwdata for pci.ids Brendan Tildesley
  6 siblings, 0 replies; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

*  gnu/packages/virtualization.scm (libosinfo): [arguments]: Use
this-package-input for osinfo-db to support package-transformations.
---
 gnu/packages/virtualization.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 5756c49b07..10d9bd0de9 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1048,7 +1048,9 @@ (define-public libosinfo
             (lambda* (#:key inputs #:allow-other-keys)
               (substitute* "osinfo/osinfo_loader.c"
                 (("path = DATA_DIR.*")
-                 (string-append "path = \"" #$osinfo-db "/share/osinfo\";"))))))))
+                 (string-append "path = \""
+                                #$(this-package-input "osinfo-db")
+                                "/share/osinfo\";"))))))))
     (inputs
      (list libsoup-minimal-2
            libxml2
-- 
2.34.0





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

* [bug#54069] [PATCH v3 7/7] gnu: libpciaccess: Use hwdata for pci.ids.
  2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
                     ` (5 preceding siblings ...)
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 6/7] gnu: libosinfo: Use this-package-input Brendan Tildesley
@ 2022-03-10  9:31   ` Brendan Tildesley
  2022-03-22 22:02     ` [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Maxim Cournoyer
  6 siblings, 1 reply; 41+ messages in thread
From: Brendan Tildesley @ 2022-03-10  9:31 UTC (permalink / raw)
  To: 54069; +Cc: John Kehayias, Ludovic Courtès, Maxime Devos,
	Maxim Cournoyer

* gnu/packages/xorg.scm (libpciaccess):
[arguments]: Remove zlib support since pci.ids isn't gzipped. Use Gexp.
[inputs]: Add hwdata:pci, remove zlib, pciutils.
[native-inputs]: Remove pkg-config since zlib isn't used.
---
 gnu/packages/xorg.scm | 34 +++++++++-------------------------
 1 file changed, 9 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 14cd3bc789..67ce0c9980 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;; Copyright © 2021 qblade <qblade@protonmail.com>
 ;;; Copyright © 2021 Lu Hui <luhux76@gmail.com>
+;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1150,36 +1151,19 @@ (define-public libpciaccess
         (method url-fetch)
         (uri (string-append
                "mirror://xorg/individual/lib/libpciaccess-"
-               version
-               ".tar.bz2"))
+               version ".tar.bz2"))
         (sha256
           (base32
             "12glp4w1kgvmqn89lk19cgr6jccd3awxra4dxisp7pagi06rsk11"))))
     (build-system gnu-build-system)
     (arguments
-     '(;; Make sure libpciaccess can read compressed 'pci.ids' files as
-       ;; provided by pciutils.
-       #:configure-flags
-       (list "--with-zlib"
-             (string-append "--with-pciids-path="
-                            (assoc-ref %build-inputs "pciutils")
-                            "/share/hwdata"))
-
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'add-L-zlib
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             ;; Provide '-LZLIB/lib' next to '-lz' in the .la file.
-             (let ((zlib (assoc-ref inputs "zlib"))
-                   (out  (assoc-ref outputs "out")))
-               (substitute* (string-append out "/lib/libpciaccess.la")
-                 (("-lz")
-                  (string-append "-L" zlib "/lib -lz")))
-               #t))))))
-    (inputs
-     (list zlib pciutils))                   ;for 'pci.ids.gz'
-    (native-inputs
-       (list pkg-config))
+     (list
+      #:configure-flags
+      #~(list (string-append
+               "--with-pciids-path="
+               (ungexp (this-package-input "hwdata") "pci")
+               "/share/hwdata/pci.ids"))))
+    (inputs (list `(,hwdata "pci")))
     (home-page "https://www.x.org/wiki/")
     (synopsis "Xorg PCI access library")
     (description "Xorg Generic PCI access library.")
-- 
2.34.0





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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 7/7] gnu: libpciaccess: Use hwdata for pci.ids Brendan Tildesley
@ 2022-03-22 22:02     ` Maxim Cournoyer
  0 siblings, 0 replies; 41+ messages in thread
From: Maxim Cournoyer @ 2022-03-22 22:02 UTC (permalink / raw)
  To: Brendan Tildesley
  Cc: John Kehayias, 54069, Ludovic Courtès, Maxime Devos

Hi Brendan,

Brendan Tildesley <mail@brendan.scot> writes:

> * gnu/packages/xorg.scm (libpciaccess):
> [arguments]: Remove zlib support since pci.ids isn't gzipped. Use Gexp.
> [inputs]: Add hwdata:pci, remove zlib, pciutils.
> [native-inputs]: Remove pkg-config since zlib isn't used.

While that simplify things a bit, it's not really required since the
pci.ids.gz from pciutils will now be generated from hwdata:pci, right?

I think I'd rather it stay that way for now.

Thanks,

Maxim




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

* [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 4/7] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
@ 2022-03-23  1:57     ` Maxim Cournoyer
  0 siblings, 0 replies; 41+ messages in thread
From: Maxim Cournoyer @ 2022-03-23  1:57 UTC (permalink / raw)
  To: Brendan Tildesley
  Cc: John Kehayias, 54069, Ludovic Courtès, Maxime Devos

Hi Brendan,

Brendan Tildesley <mail@brendan.scot> writes:

> * gnu/packages/pciutils.scm (pciutils):
> [inputs]: Add hwdata:pci for latest pci.ids file.
> [arguments]: Don't install update-pciids script or it's man page. Don't
> install bundled old pci.ids file, use hwdata instead. Copy the pci.ids
> over so it can be gzipped.

The GNU changelog idea is to stick to changes in the commit message; if
explanations are needed they can go in the code as comments.
Alternatively, you can also put explanations as a paragraph between the
commit summary (first line) and the changelog.

> ---
>  gnu/packages/pciutils.scm | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
> index 41ba10f1e1..648d1385e4 100644
> --- a/gnu/packages/pciutils.scm
> +++ b/gnu/packages/pciutils.scm
> @@ -93,8 +93,13 @@ (define-public pciutils
>      (arguments
>       `(#:phases
>         (modify-phases %standard-phases
> +         (add-after 'unpack 'unbundle-pci.ids
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
                                     ^ not needed
                                     
> +             (copy-file (string-append (assoc-ref inputs "hwdata:pci")
> +                                       "/share/hwdata/pci.ids")
> +                        "pci.ids")))

I used search-input-file, making sure to use (or native-inputs inputs)
as its first argument, so that it works even when cross-compiling.

>           (replace 'configure
> -           (lambda* (#:key outputs #:allow-other-keys)
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
                              ^ not needed
                              
>               ;; There's no 'configure' script, just a raw makefile.
>               (substitute* "Makefile"
>                 ,@(if (%current-target-system)
> @@ -124,13 +129,19 @@ (define-public pciutils
>                 (("^SHARED=.*$")
>                  ;; Build libpciutils.so.
>                  "SHARED := yes\n")
> +
>                 (("^ZLIB=.*$")
>                  ;; Ask for zlib support, for 'pci.ids.gz' decompression.
>                  "ZLIB := yes\n")
>  
>                 (("^IDSDIR=.*$")
>                  ;; Installation directory of 'pci.ids.gz'.
> -                "IDSDIR = $(SHAREDIR)/hwdata\n"))))
> +                "IDSDIR = $(SHAREDIR)/hwdata\n")
> +               ;; Don't install update script or its man page,
> +               ((".*INSTALL.*update-pciids .*") "")
> +               (("update-pciids update-pciids.8 ") "")
> +               (("(.*INSTALL.*)(update-pciids.8)(.*)" _ a _ b)
> +                (string-append a b)))))
>           (replace 'install
>             (lambda* (#:key outputs #:allow-other-keys)
>               ;; Install the commands, library, and .pc files.
> @@ -159,7 +170,8 @@ (define-public pciutils
>         ,@(if (hurd-target?)
>               `(("hurd-patch" ,(search-patch "pciutils-hurd-fix.patch")))
>               '())
> -       ("zlib" ,zlib)))
> +       ("zlib" ,zlib)
> +       ("hwdata:pci" ,hwdata "pci")))

I moved hwdata to native-inputs,

And pushed as 387a9772c2571d4375d6c3682c7572d12e7ec5b2 to the
core-updates branch.

Thank you!

Maxim






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

* bug#54069: [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest.
  2022-03-10  9:31   ` [bug#54069] [PATCH v3 5/7] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
@ 2022-03-23  2:14     ` Maxim Cournoyer
  0 siblings, 0 replies; 41+ messages in thread
From: Maxim Cournoyer @ 2022-03-23  2:14 UTC (permalink / raw)
  To: Brendan Tildesley
  Cc: John Kehayias, Ludovic Courtès, 54069-done, Maxime Devos

Hi!

Brendan Tildesley <mail@brendan.scot> writes:

> * gnu/packages/virtualization.scm (libosinfo):
> [arguments]: Use Gexp style. Use hwdata package for latest usb.ids and
> pci.ids.
> [inputs]: Add hwdata:pci, hwdata:usb. remove pci.ids, usb.ids origins.
> Use new input style.

I've squashed the modified the libosinfo patches a little bit, updated
it to 1.10.0, and made some other small adjustments, and pushed the
hwdata and libosinfo patches as
4b3b873344eb78a4cd96742e4035b39cbec79577.

Thank you!

Closing.

Maxim




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

end of thread, other threads:[~2022-03-23  2:15 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-20  9:53 [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
2022-02-20  9:55 ` [bug#54069] [PATCH 1/2] gnu: Add hwdata Brendan Tildesley
2022-02-20  9:55   ` [bug#54069] [PATCH 2/2] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
2022-02-21 19:40     ` [bug#54069] [PATCH 0/2] " Maxim Cournoyer
2022-02-22  8:40       ` Brendan Tildesley
2022-02-24  3:32   ` Maxim Cournoyer
2022-02-25  4:44     ` Brendan Tildesley
2022-02-26  5:00       ` Maxim Cournoyer
2022-02-21 16:19 ` John Kehayias via Guix-patches via
2022-02-22 19:34   ` John Kehayias via Guix-patches via
2022-02-22 21:00     ` Maxim Cournoyer
2022-02-22 21:22       ` John Kehayias via Guix-patches via
2022-02-23  1:08         ` Maxim Cournoyer
2022-02-23  6:16           ` John Kehayias via Guix-patches via
2022-02-26  4:32 ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Brendan Tildesley
2022-02-26  4:32   ` [bug#54069] [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
2022-02-26 14:19     ` Maxim Cournoyer
2022-02-26  4:32   ` [bug#54069] [PATCH v2 3/4] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
2022-02-26 11:21     ` Maxime Devos
2022-02-27  1:37       ` Brendan Tildesley
2022-02-27 10:46         ` Maxime Devos
2022-02-27 10:56           ` Maxime Devos
2022-02-27 21:23             ` Ludovic Courtès
2022-02-27 22:17               ` Maxime Devos
2022-02-28 11:48                 ` Ludovic Courtès
2022-02-27 22:18               ` Maxime Devos
2022-02-27 12:12     ` Maxime Devos
2022-02-26  4:32   ` [bug#54069] [PATCH v2 4/4] gnu: libpciaccess: Use hwdata for pci.ids Brendan Tildesley
2022-02-26 23:14   ` [bug#54069] [PATCH v2 1/4] gnu: Add hwdata Maxim Cournoyer
2022-02-27 12:08     ` Maxime Devos
2022-03-10  9:31 ` [bug#54069] [PATCHES v3 0/7]: Update and make use of hwdata Brendan Tildesley
2022-03-10  9:31   ` [bug#54069] [PATCH v3 1/7] gnu: hwdata: Set #:target #f Brendan Tildesley
2022-03-10  9:31   ` [bug#54069] [PATCH v3 2/7] gnu: hwdata: Remove unused gzip native-input Brendan Tildesley
2022-03-10  9:31   ` [bug#54069] [PATCH v3 3/7] gnu: hwdata: Update to 0.357 Brendan Tildesley
2022-03-10  9:31   ` [bug#54069] [PATCH v3 4/7] gnu: pciutils: Unbundle pci.ids and use latest Brendan Tildesley
2022-03-23  1:57     ` [bug#54069] [PATCH 0/2] " Maxim Cournoyer
2022-03-10  9:31   ` [bug#54069] [PATCH v3 5/7] gnu: libosinfo: Unbundle usb.ids, pci.ids Brendan Tildesley
2022-03-23  2:14     ` bug#54069: [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Maxim Cournoyer
2022-03-10  9:31   ` [bug#54069] [PATCH v3 6/7] gnu: libosinfo: Use this-package-input Brendan Tildesley
2022-03-10  9:31   ` [bug#54069] [PATCH v3 7/7] gnu: libpciaccess: Use hwdata for pci.ids Brendan Tildesley
2022-03-22 22:02     ` [bug#54069] [PATCH 0/2] gnu: pciutils: Unbundle pci.ids and use latest Maxim Cournoyer

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.