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
|
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 {
|
2020-06-10 20:20:53 +00:00
|
|
|
name = "pciutils-3.7.0"; # with release-date database
|
2012-09-29 03:15:49 +00:00
|
|
|
|
2007-02-19 20:18:20 +00:00
|
|
|
src = fetchurl {
|
2014-11-10 19:16:16 +00:00
|
|
|
url = "mirror://kernel/software/utils/pciutils/${name}.tar.xz";
|
2020-06-10 20:20:53 +00:00
|
|
|
sha256 = "1ss0rnfsx8gvqjxaji4mvbhf9xyih4cadmgadbwwv8mnx1xvjh4x";
|
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 ];
|
2020-09-24 01:54:41 +00:00
|
|
|
buildInputs = [ zlib kmod which ] ++
|
2021-02-14 23:05:32 +00:00
|
|
|
lib.optional stdenv.hostPlatform.isDarwin IOKit;
|
2020-09-24 01:54:41 +00:00
|
|
|
|
|
|
|
preConfigure = if stdenv.cc.isGNU then null else ''
|
|
|
|
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
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://mj.ucw.cz/pciutils.html";
|
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
|
|
|
}
|