Subject: Re: [PATCH v2 2/4] gnu: pciutils: Unbundle pci.ids and use latest.

From: Maxim Cournoyer <[email-masked]>
Date: Sat, 26 Feb 2022 09:19:28 -0500

Hi Brendan,

Brendan Tildesley <[email-masked]> 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