gnu: Add emacs-helm-flycheck.
[guix.git] / gnu / packages / pciutils.scm
blobd9727615869730133603fbc2836e818081271c6b
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>
4 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages pciutils)
22   #:use-module (guix packages)
23   #:use-module (guix download)
24   #:use-module ((guix licenses) #:prefix license:)
25   #:use-module (guix build-system gnu)
26   #:use-module (gnu packages compression)
27   #:use-module (gnu packages pkg-config)
28   #:use-module (gnu packages linux)
29   #:use-module (gnu packages base))
31 (define-public pciutils
32   (package
33     (name "pciutils")
34     (version "3.5.6")
35     (source (origin
36               (method url-fetch)
37               (uri (string-append
38                     "mirror://kernel.org/software/utils/pciutils/pciutils-"
39                     version ".tar.xz"))
40               (sha256
41                (base32
42                 "08dvsk1b5m1r7qqzsm849h4glq67mngf8zw7bg0102ff1jwywipk"))))
43     (build-system gnu-build-system)
44     (arguments
45      '(#:phases
46        (modify-phases %standard-phases
47          (replace 'configure
48            (lambda* (#:key outputs #:allow-other-keys)
49              ;; There's no 'configure' script, just a raw makefile.
50              (substitute* "Makefile"
51                (("^PREFIX=.*$")
52                 (string-append "PREFIX := " (assoc-ref outputs "out")
53                                "\n"))
54                (("^MANDIR:=.*$")
55                  ;; By default the thing tries to automatically
56                  ;; determine whether to use $prefix/man or
57                  ;; $prefix/share/man, and wrongly so.
58                 (string-append "MANDIR := " (assoc-ref outputs "out")
59                                "/share/man\n"))
61                (("^SHARED=.*$")
62                 ;; Build libpciutils.so.
63                 "SHARED := yes\n")
64                (("^ZLIB=.*$")
65                 ;; Ask for zlib support, for 'pci.ids.gz' decompression.
66                 "ZLIB := yes\n")
68                (("^IDSDIR=.*$")
69                 ;; Installation directory of 'pci.ids.gz'.
70                 "IDSDIR = $(SHAREDIR)/hwdata\n"))
71              #t))
72          (replace 'install
73            (lambda* (#:key outputs #:allow-other-keys)
74              ;; Install the commands, library, and .pc files.
75              (invoke "make" "install" "install-lib"))))
77        ;; Make sure programs have an RPATH so they can find libpciutils.so.
78        #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
79                                          (assoc-ref %outputs "out") "/lib"))
81        ;; No test suite.
82        #:tests? #f))
83     (native-inputs
84      `(("which" ,which)
85        ("pkg-config" ,pkg-config)))
86     (inputs
87      `(("kmod" ,kmod)
88        ("zlib" ,zlib)))
89     (home-page "https://mj.ucw.cz/sw/pciutils/")
90     (synopsis "Programs for inspecting and manipulating PCI devices")
91     (description
92      "The PCI Utilities are a collection of programs for inspecting and
93 manipulating configuration of PCI devices, all based on a common portable
94 library libpci which offers access to the PCI configuration space on a variety
95 of operating systems.  This includes the @command{lspci} and @command{setpci}
96 commands.")
97     (license license:gpl2+)))