2020-09-01 06:10:34 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, zlib, kmod, which
|
|
|
|
, static ? stdenv.targetPlatform.isStatic
|
2020-09-24 01:54:41 +00:00
|
|
|
, darwin ? null
|
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
|
|
|
|
2017-09-05 21:26:13 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2020-09-24 01:54:41 +00:00
|
|
|
buildInputs = [ zlib kmod which ] ++
|
|
|
|
stdenv.lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.IOKit;
|
|
|
|
|
|
|
|
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
|
|
|
|
2012-09-29 03:15:49 +00:00
|
|
|
# Get rid of update-pciids as it won't work.
|
|
|
|
postInstall = "rm $out/sbin/update-pciids $out/man/man8/update-pciids.8";
|
|
|
|
|
2014-11-10 19:16:16 +00:00
|
|
|
meta = with stdenv.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
|
|
|
}
|