1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages pciutils)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages pkg-config)
27 #:use-module (gnu packages linux)
28 #:use-module (gnu packages base))
30 (define-public pciutils
37 "mirror://kernel.org/software/utils/pciutils/pciutils-"
41 "1x9rb5y82rzg8b67lh42yy9ag9xr7kzibz566lffd41g37xghqhx"))))
42 (build-system gnu-build-system)
45 (modify-phases %standard-phases
47 (lambda* (#:key outputs #:allow-other-keys)
48 ;; There's no 'configure' script, just a raw makefile.
49 (substitute* "Makefile"
51 (string-append "PREFIX := " (assoc-ref outputs "out")
54 ;; By default the thing tries to automatically
55 ;; determine whether to use $prefix/man or
56 ;; $prefix/share/man, and wrongly so.
57 (string-append "MANDIR := " (assoc-ref outputs "out")
61 ;; Build libpciutils.so.
64 ;; Ask for zlib support, for 'pci.ids.gz' decompression.
68 ;; Installation directory of 'pci.ids.gz'.
69 "IDSDIR = $(SHAREDIR)/hwdata\n"))
72 (lambda* (#:key outputs #:allow-other-keys)
73 ;; Install the commands, library, and .pc files.
74 (zero? (system* "make" "install" "install-lib")))))
76 ;; Make sure programs have an RPATH so they can find libpciutils.so.
77 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
78 (assoc-ref %outputs "out") "/lib"))
84 ("pkg-config" ,pkg-config)))
88 (home-page "http://mj.ucw.cz/sw/pciutils/")
89 (synopsis "Programs for inspecting and manipulating PCI devices")
91 "The PCI Utilities are a collection of programs for inspecting and
92 manipulating configuration of PCI devices, all based on a common portable
93 library libpci which offers access to the PCI configuration space on a variety
94 of operating systems. This includes the @command{lspci} and @command{setpci}
96 (license license:gpl2+)))