gnu: r-maldiquant: Move to (gnu packages cran).
[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>
280b62b0 4;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6eae9089 5;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
22ee7209 6;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
42422cc2
LC
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages pciutils)
24 #:use-module (guix packages)
25 #:use-module (guix download)
b5b73a82 26 #:use-module ((guix licenses) #:prefix license:)
6eae9089 27 #:use-module (guix utils)
42422cc2 28 #:use-module (guix build-system gnu)
22ee7209 29 #:use-module (gnu packages)
42422cc2
LC
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages pkg-config)
22ee7209 32 #:use-module (gnu packages hurd)
43ec6ca0 33 #:use-module (gnu packages linux)
ce0614dd 34 #:use-module (gnu packages base))
42422cc2
LC
35
36(define-public pciutils
37 (package
38 (name "pciutils")
2f144210 39 (version "3.6.4")
42422cc2
LC
40 (source (origin
41 (method url-fetch)
42 (uri (string-append
43 "mirror://kernel.org/software/utils/pciutils/pciutils-"
fb3c8553 44 version ".tar.xz"))
22ee7209 45 (patches (search-patches "pciutils-hurd-configure.patch"))
42422cc2
LC
46 (sha256
47 (base32
2f144210 48 "0mb0f2phdcmp4kfiqsszn2k6nlln0w160ffzrjjv4bbfjwrgfzzn"))))
42422cc2
LC
49 (build-system gnu-build-system)
50 (arguments
6eae9089 51 `(#:phases
0ef7a93d
EF
52 (modify-phases %standard-phases
53 (replace 'configure
54 (lambda* (#:key outputs #:allow-other-keys)
55 ;; There's no 'configure' script, just a raw makefile.
56 (substitute* "Makefile"
6eae9089
MO
57 ,@(if (%current-target-system)
58 `((("^CROSS_COMPILE=.*$")
59 (string-append "CROSS_COMPILE="
60 ,(%current-target-system) "-"
61 "\n"))
62 (("^HOST=.*$")
63 (string-append "HOST="
64 ,(gnu-triplet->nix-system
65 (%current-target-system)) "\n"))
66 ;; Disable 'install' strip option, that would fail when
67 ;; we are cross-compiling.
68 (("^STRIP=.*$")
69 "STRIP=\n"))
70 '())
0ef7a93d
EF
71 (("^PREFIX=.*$")
72 (string-append "PREFIX := " (assoc-ref outputs "out")
73 "\n"))
74 (("^MANDIR:=.*$")
75 ;; By default the thing tries to automatically
76 ;; determine whether to use $prefix/man or
77 ;; $prefix/share/man, and wrongly so.
78 (string-append "MANDIR := " (assoc-ref outputs "out")
79 "/share/man\n"))
841e06af 80
0ef7a93d
EF
81 (("^SHARED=.*$")
82 ;; Build libpciutils.so.
83 "SHARED := yes\n")
84 (("^ZLIB=.*$")
841e06af
LC
85 ;; Ask for zlib support, for 'pci.ids.gz' decompression.
86 "ZLIB := yes\n")
87
88 (("^IDSDIR=.*$")
89 ;; Installation directory of 'pci.ids.gz'.
90 "IDSDIR = $(SHAREDIR)/hwdata\n"))
91 #t))
0ef7a93d
EF
92 (replace 'install
93 (lambda* (#:key outputs #:allow-other-keys)
94 ;; Install the commands, library, and .pc files.
71a02196 95 (invoke "make" "install" "install-lib"))))
42422cc2
LC
96
97 ;; Make sure programs have an RPATH so they can find libpciutils.so.
98 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
99 (assoc-ref %outputs "out") "/lib"))
100
101 ;; No test suite.
102 #:tests? #f))
103 (native-inputs
104 `(("which" ,which)
105 ("pkg-config" ,pkg-config)))
106 (inputs
22ee7209
JN
107 `(,@(if (member (or (%current-target-system)
108 (%current-system))
109 (package-supported-systems kmod))
110 `(("kmod" ,kmod))
111 '())
43ec6ca0 112 ("zlib" ,zlib)))
8af77fe9 113 (home-page "https://mj.ucw.cz/sw/pciutils/")
42422cc2
LC
114 (synopsis "Programs for inspecting and manipulating PCI devices")
115 (description
116 "The PCI Utilities are a collection of programs for inspecting and
117manipulating configuration of PCI devices, all based on a common portable
118library libpci which offers access to the PCI configuration space on a variety
a48da398
LC
119of operating systems. This includes the @command{lspci} and @command{setpci}
120commands.")
42422cc2 121 (license license:gpl2+)))