| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 |
|
| 25 | (define-module (gnu packages pciutils)
|
| 26 | #:use-module (guix gexp)
|
| 27 | #:use-module (guix packages)
|
| 28 | #:use-module (guix download)
|
| 29 | #:use-module ((guix licenses) #:prefix license:)
|
| 30 | #:use-module (guix utils)
|
| 31 | #:use-module (guix git-download)
|
| 32 | #:use-module (guix build-system gnu)
|
| 33 | #:use-module (gnu packages)
|
| 34 | #:use-module (gnu packages compression)
|
| 35 | #:use-module (gnu packages pkg-config)
|
| 36 | #:use-module (gnu packages linux)
|
| 37 | #:use-module (gnu packages base))
|
| 38 |
|
| 39 | (define-public hwdata
|
| 40 | (package
|
| 41 | (name "hwdata")
|
| 42 | (version "0.411") |
| 43 | (source (origin
|
| 44 | (method git-fetch)
|
| 45 | (uri (git-reference
|
| 46 | (url "https://github.com/vcrhonek/hwdata")
|
| 47 | (commit (string-append "v" version))))
|
| 48 | (file-name (git-file-name name version))
|
| 49 | (sha256
|
| 50 | (base32
|
| 51 | "0h4dgyrpjiq24qb039n6dj5gs95h870ardfc39i2jg4q4dcq2s33"))))
|
| 52 | (build-system gnu-build-system)
|
| 53 | (arguments
|
| 54 | |
| 55 | (list
|
| 56 | #:tests? #f
|
| 57 | |
| 58 | #:target #f
|
| 59 | #:configure-flags #~(list (string-append "--datadir=" #$output "/share"))))
|
| 60 | (home-page "https://github.com/vcrhonek/hwdata")
|
| 61 | (synopsis "Hardware identification and configuration data")
|
| 62 | (description "@code{hwdata} contains various hardware identification and
|
| 63 | configuration data, such as the @file{pci.ids} and @file{usb.ids} databases.
|
| 64 | Each database is contained in a specific package output, such as the
|
| 65 | @code{pci} output for @file{pci.ids}, the @code{usb} output for
|
| 66 | @file{usb.ids}, etc.")
|
| 67 | (license (list license:gpl2+
|
| 68 | license:expat)))) |
| 69 |
|
| 70 | (define-public pciutils
|
| 71 | (package
|
| 72 | (name "pciutils")
|
| 73 | (version "3.13.0")
|
| 74 | (source (origin
|
| 75 | (method url-fetch)
|
| 76 | (uri (string-append
|
| 77 | "mirror://kernel.org/software/utils/pciutils/pciutils-"
|
| 78 | version ".tar.xz"))
|
| 79 | (sha256
|
| 80 | (base32
|
| 81 | "09j9rfjaw2ahdwvvlp7ldjgn522pbbqhh0zm396n60l555w1zwbp"))
|
| 82 | (patches (search-patches "pciutils-hurd64.patch"))))
|
| 83 | (build-system gnu-build-system)
|
| 84 | (arguments
|
| 85 | (list
|
| 86 | #:phases
|
| 87 | #~(modify-phases %standard-phases
|
| 88 | (add-after 'unpack 'unbundle-pci.ids
|
| 89 | (lambda* (#:key native-inputs inputs #:allow-other-keys)
|
| 90 | (copy-file (search-input-file (or native-inputs inputs)
|
| 91 | "share/hwdata/pci.ids")
|
| 92 | "pci.ids")))
|
| 93 | (replace 'configure
|
| 94 | (lambda _
|
| 95 | |
| 96 | (substitute* "Makefile"
|
| 97 | #$@(if (%current-target-system)
|
| 98 | #~((("^CROSS_COMPILE=.*$")
|
| 99 | (string-append "CROSS_COMPILE="
|
| 100 | #$(%current-target-system) "-"
|
| 101 | "\n"))
|
| 102 | (("^HOST=.*$")
|
| 103 | (string-append "HOST="
|
| 104 | #$(gnu-triplet->nix-system
|
| 105 | (%current-target-system)) "\n"))
|
| 106 | |
| 107 | |
| 108 | (("^STRIP=.*$")
|
| 109 | "STRIP=\n"))
|
| 110 | '())
|
| 111 | (("^PREFIX=.*$")
|
| 112 | (string-append "PREFIX := " #$output
|
| 113 | "\n"))
|
| 114 | (("^MANDIR:=.*$")
|
| 115 | |
| 116 | |
| 117 | |
| 118 | (string-append "MANDIR := " #$output
|
| 119 | "/share/man\n"))
|
| 120 |
|
| 121 | (("^SHARED=.*$")
|
| 122 | |
| 123 | "SHARED := yes\n")
|
| 124 |
|
| 125 | (("^ZLIB=.*$")
|
| 126 | |
| 127 | "ZLIB := yes\n")
|
| 128 |
|
| 129 | (("^IDSDIR=.*$")
|
| 130 | |
| 131 | "IDSDIR = $(SHAREDIR)/hwdata\n")
|
| 132 |
|
| 133 | |
| 134 | ((".*INSTALL.*update-pciids .*") "")
|
| 135 | (("update-pciids update-pciids.8 ") "")
|
| 136 | (("(.*INSTALL.*)update-pciids.8(.*)" _ head tail)
|
| 137 | (string-append head tail)))))
|
| 138 | (replace 'install
|
| 139 | (lambda _
|
| 140 | |
| 141 | (invoke "make" "install" "install-lib"))))
|
| 142 |
|
| 143 | |
| 144 | #:make-flags
|
| 145 | #~(list #$(string-append "CC=" (cc-for-target))
|
| 146 | (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib"))
|
| 147 |
|
| 148 | |
| 149 | #:tests? #f))
|
| 150 | (native-inputs
|
| 151 | (list hwdata pkg-config which))
|
| 152 | (inputs
|
| 153 | (append
|
| 154 | (if (not (target-hurd?))
|
| 155 | (list kmod)
|
| 156 | '())
|
| 157 | (list zlib)))
|
| 158 | (home-page "https://mj.ucw.cz/sw/pciutils/")
|
| 159 | (synopsis "Programs for inspecting and manipulating PCI devices")
|
| 160 | (description
|
| 161 | "The PCI Utilities are a collection of programs for inspecting and
|
| 162 | manipulating configuration of PCI devices, all based on a common portable
|
| 163 | library libpci which offers access to the PCI configuration space on a variety
|
| 164 | of operating systems. This includes the @command{lspci} and @command{setpci}
|
| 165 | commands.")
|
| 166 | (license license:gpl2+)))
|