From 0e8b852e0ff58a34141d804747b13b55088993b4 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Tue, 4 Jan 2022 16:40:14 -0500
Subject: [PATCH 1/4] gnu: Add pciutils-no-zlib.
* gnu/packages/pciutils.scm (pciutils-no-zlib): New variable. A hidden package
to provide pciutils with uncompressed pci.ids.
---
gnu/packages/pciutils.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
@@ -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 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -129,3 +130,23 @@ (define-public pciutils
of operating systems. This includes the @command{lspci} and @command{setpci}
commands.")
(license license:gpl2+)))
+
+;; This is a version of pciutils without zlib, so that the hardware pci.ids is
+;; uncompressed. This is useful for packages that try to read pci.ids
+;; directly. Alternatively, the uncompressed file could also be present in
+;; pciutils or the direct source of pci.ids could be made available
+;; separately, see: https://pci-ids.ucw.cz/
+(define-public pciutils-no-zlib
+ (hidden-package
+ (package
+ (inherit pciutils)
+ (arguments
+ (substitute-keyword-arguments (package-arguments pciutils)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'configure 'disable-zlib
+ ;; remove zlib from Makefile to have uncompressed pci.ids
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* "Makefile"
+ (("^ZLIB := .*$")
+ "ZLIB := no\n")))))))))))
--
2.34.0