pciutils.scm 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/>.
  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))
  29. (define-public pciutils
  30. (package
  31. (name "pciutils")
  32. (version "3.6.1")
  33. (source (origin
  34. (method url-fetch)
  35. (uri (string-append
  36. "mirror://kernel.org/software/utils/pciutils/pciutils-"
  37. version ".tar.xz"))
  38. (sha256
  39. (base32
  40. "1q39hh8scgvqppk1clzjh7yiq5p2r0knv52g3qzmdhsir4f47h7w"))))
  41. (build-system gnu-build-system)
  42. (arguments
  43. '(#:phases
  44. (modify-phases %standard-phases
  45. (replace 'configure
  46. (lambda* (#:key outputs #:allow-other-keys)
  47. ;; There's no 'configure' script, just a raw makefile.
  48. (substitute* "Makefile"
  49. (("^PREFIX=.*$")
  50. (string-append "PREFIX := " (assoc-ref outputs "out")
  51. "\n"))
  52. (("^MANDIR:=.*$")
  53. ;; By default the thing tries to automatically
  54. ;; determine whether to use $prefix/man or
  55. ;; $prefix/share/man, and wrongly so.
  56. (string-append "MANDIR := " (assoc-ref outputs "out")
  57. "/share/man\n"))
  58. (("^SHARED=.*$")
  59. ;; Build libpciutils.so.
  60. "SHARED := yes\n")
  61. (("^ZLIB=.*$")
  62. ;; Ask for zlib support, for 'pci.ids.gz' decompression.
  63. "ZLIB := yes\n")
  64. (("^IDSDIR=.*$")
  65. ;; Installation directory of 'pci.ids.gz'.
  66. "IDSDIR = $(SHAREDIR)/hwdata\n"))
  67. #t))
  68. (replace 'install
  69. (lambda* (#:key outputs #:allow-other-keys)
  70. ;; Install the commands, library, and .pc files.
  71. (invoke "make" "install" "install-lib"))))
  72. ;; Make sure programs have an RPATH so they can find libpciutils.so.
  73. #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
  74. (assoc-ref %outputs "out") "/lib"))
  75. ;; No test suite.
  76. #:tests? #f))
  77. (native-inputs
  78. `(("which" ,which)
  79. ("pkg-config" ,pkg-config)))
  80. (inputs
  81. `(("kmod" ,kmod)
  82. ("zlib" ,zlib)))
  83. (home-page "https://mj.ucw.cz/sw/pciutils/")
  84. (synopsis "Programs for inspecting and manipulating PCI devices")
  85. (description
  86. "The PCI Utilities are a collection of programs for inspecting and
  87. manipulating configuration of PCI devices, all based on a common portable
  88. library libpci which offers access to the PCI configuration space on a variety
  89. of operating systems. This includes the @command{lspci} and @command{setpci}
  90. commands.")
  91. (license license:gpl2+)))