2021-01-17 09:17:16 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, zlib, kmod, which
|
2021-02-14 20:22:13 +00:00
|
|
|
, hwdata
|
2020-12-20 06:11:26 +00:00
|
|
|
, static ? stdenv.hostPlatform.isStatic
|
2021-02-14 23:05:32 +00:00
|
|
|
, IOKit
|
2022-12-18 13:02:10 +00:00
|
|
|
, gitUpdater
|
2020-09-01 06:10:34 +00:00
|
|
|
}:
|
2007-02-19 20:18:20 +00:00
|
|
|
|
2010-07-21 12:01:57 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-07-27 14:21:24 +00:00
|
|
|
pname = "pciutils";
|
2023-05-11 05:05:47 +00:00
|
|
|
version = "3.10.0"; # with release-date database
|
2012-09-29 03:15:49 +00:00
|
|
|
|
2007-02-19 20:18:20 +00:00
|
|
|
src = fetchurl {
|
2021-07-27 14:21:24 +00:00
|
|
|
url = "mirror://kernel/software/utils/pciutils/pciutils-${version}.tar.xz";
|
2023-05-11 05:05:47 +00:00
|
|
|
sha256 = "sha256-I4ouJxZnMOU6F/4Hv60ingf6ObYYEX5ZRLbX7an7sOk=";
|
2007-02-19 20:18:20 +00:00
|
|
|
};
|
2012-09-29 03:15:49 +00:00
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2022-07-24 16:37:55 +00:00
|
|
|
buildInputs = [ which zlib ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ IOKit ]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ kmod ];
|
2020-09-24 01:54:41 +00:00
|
|
|
|
2022-07-24 16:37:55 +00:00
|
|
|
preConfigure = lib.optionalString (!stdenv.cc.isGNU) ''
|
2020-09-24 01:54:41 +00:00
|
|
|
substituteInPlace Makefile --replace 'CC=$(CROSS_COMPILE)gcc' ""
|
|
|
|
'';
|
2008-08-30 09:56:21 +00:00
|
|
|
|
2018-05-19 21:44:17 +00:00
|
|
|
makeFlags = [
|
2020-09-01 06:10:34 +00:00
|
|
|
"SHARED=${if static then "no" else "yes"}"
|
2018-05-19 21:44:17 +00:00
|
|
|
"PREFIX=\${out}"
|
|
|
|
"STRIP="
|
|
|
|
"HOST=${stdenv.hostPlatform.system}"
|
|
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
|
|
"DNS=yes"
|
|
|
|
];
|
2008-08-30 09:56:21 +00:00
|
|
|
|
2019-11-03 22:10:08 +00:00
|
|
|
installTargets = [ "install" "install-lib" ];
|
2008-08-30 09:56:21 +00:00
|
|
|
|
2021-02-14 20:22:13 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Remove update-pciids as it won't work on nixos
|
|
|
|
rm $out/sbin/update-pciids $out/man/man8/update-pciids.8
|
|
|
|
|
|
|
|
# use database from hwdata instead
|
|
|
|
# (we don't create a symbolic link because we do not want to pull in the
|
|
|
|
# full closure of hwdata)
|
|
|
|
cp --reflink=auto ${hwdata}/share/hwdata/pci.ids $out/share/pci.ids
|
|
|
|
'';
|
2012-09-29 03:15:49 +00:00
|
|
|
|
2022-12-18 13:02:10 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
|
|
|
# No nicer place to find latest release.
|
|
|
|
url = "https://github.com/pciutils/pciutils.git";
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-07-13 07:03:26 +00:00
|
|
|
homepage = "https://mj.ucw.cz/sw/pciutils/";
|
2008-08-30 09:56:21 +00:00
|
|
|
description = "A collection of programs for inspecting and manipulating configuration of PCI devices";
|
2014-11-10 19:16:16 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.vcunat ]; # not really, but someone should watch it
|
2007-02-26 12:07:46 +00:00
|
|
|
};
|
2007-02-19 20:18:20 +00:00
|
|
|
}
|