1 { lib, stdenv, fetchFromGitHub, pkg-config, zlib, kmod, which
3 , static ? stdenv.hostPlatform.isStatic
8 stdenv.mkDerivation rec {
10 version = "3.13.0"; # with release-date database
12 src = fetchFromGitHub {
16 hash = "sha256-buhq7SN6eH+sckvT5mJ8eP4C1EP/4CUFt3gooJohJW0=";
19 nativeBuildInputs = [ pkg-config ];
20 buildInputs = [ which zlib ]
21 ++ lib.optionals stdenv.hostPlatform.isDarwin [ IOKit ]
22 ++ lib.optionals stdenv.hostPlatform.isLinux [ kmod ];
24 preConfigure = lib.optionalString (!stdenv.cc.isGNU) ''
25 substituteInPlace Makefile --replace 'CC=$(CROSS_COMPILE)gcc' ""
28 enableParallelBuilding = true;
31 "SHARED=${if static then "no" else "yes"}"
34 "HOST=${stdenv.hostPlatform.system}"
35 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
39 installTargets = [ "install" "install-lib" ];
42 # Remove update-pciids as it won't work on nixos
43 rm $out/sbin/update-pciids $out/man/man8/update-pciids.8
45 # use database from hwdata instead
46 # (we don't create a symbolic link because we do not want to pull in the
47 # full closure of hwdata)
48 cp --reflink=auto ${hwdata}/share/hwdata/pci.ids $out/share/pci.ids
51 passthru.updateScript = gitUpdater {
52 # No nicer place to find latest release.
53 url = "https://github.com/pciutils/pciutils.git";
58 homepage = "https://mj.ucw.cz/sw/pciutils/";
59 description = "Collection of programs for inspecting and manipulating configuration of PCI devices";
60 license = licenses.gpl2Plus;
61 platforms = platforms.unix;
62 maintainers = [ maintainers.vcunat ]; # not really, but someone should watch it
63 mainProgram = "lspci";