gnu: pciutils: Move 'pci.ids.gz' to 'share/hwdata'.
[jackhill/guix/guix.git] / gnu / packages / pciutils.scm
CommitLineData
42422cc2 1;;; GNU Guix --- Functional package management for GNU
841e06af 2;;; Copyright © 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
fb3c8553 3;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
42422cc2
LC
4;;;
5;;; This file is part of GNU Guix.
6;;;
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.
11;;;
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.
16;;;
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/>.
19
20(define-module (gnu packages pciutils)
21 #:use-module (guix packages)
22 #:use-module (guix download)
b5b73a82 23 #:use-module ((guix licenses) #:prefix license:)
42422cc2
LC
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages pkg-config)
43ec6ca0 27 #:use-module (gnu packages linux)
ce0614dd 28 #:use-module (gnu packages base))
42422cc2
LC
29
30(define-public pciutils
31 (package
32 (name "pciutils")
539a68f9 33 (version "3.5.5")
42422cc2
LC
34 (source (origin
35 (method url-fetch)
36 (uri (string-append
37 "mirror://kernel.org/software/utils/pciutils/pciutils-"
fb3c8553 38 version ".tar.xz"))
42422cc2
LC
39 (sha256
40 (base32
539a68f9 41 "1x9rb5y82rzg8b67lh42yy9ag9xr7kzibz566lffd41g37xghqhx"))))
42422cc2
LC
42 (build-system gnu-build-system)
43 (arguments
0ef7a93d
EF
44 '(#:phases
45 (modify-phases %standard-phases
46 (replace 'configure
47 (lambda* (#:key outputs #:allow-other-keys)
48 ;; There's no 'configure' script, just a raw makefile.
49 (substitute* "Makefile"
50 (("^PREFIX=.*$")
51 (string-append "PREFIX := " (assoc-ref outputs "out")
52 "\n"))
53 (("^MANDIR:=.*$")
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")
58 "/share/man\n"))
841e06af 59
0ef7a93d
EF
60 (("^SHARED=.*$")
61 ;; Build libpciutils.so.
62 "SHARED := yes\n")
63 (("^ZLIB=.*$")
841e06af
LC
64 ;; Ask for zlib support, for 'pci.ids.gz' decompression.
65 "ZLIB := yes\n")
66
67 (("^IDSDIR=.*$")
68 ;; Installation directory of 'pci.ids.gz'.
69 "IDSDIR = $(SHAREDIR)/hwdata\n"))
70 #t))
0ef7a93d
EF
71 (replace 'install
72 (lambda* (#:key outputs #:allow-other-keys)
73 ;; Install the commands, library, and .pc files.
74 (zero? (system* "make" "install" "install-lib")))))
42422cc2
LC
75
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"))
79
80 ;; No test suite.
81 #:tests? #f))
82 (native-inputs
83 `(("which" ,which)
84 ("pkg-config" ,pkg-config)))
85 (inputs
43ec6ca0
EF
86 `(("kmod" ,kmod)
87 ("zlib" ,zlib)))
42422cc2
LC
88 (home-page "http://mj.ucw.cz/sw/pciutils/")
89 (synopsis "Programs for inspecting and manipulating PCI devices")
90 (description
91 "The PCI Utilities are a collection of programs for inspecting and
92manipulating configuration of PCI devices, all based on a common portable
93library libpci which offers access to the PCI configuration space on a variety
94of operating systems. This includes the 'lspci' and 'setpci' commands.")
95 (license license:gpl2+)))