3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/system/lshw/default.nix

48 lines
1.4 KiB
Nix
Raw Normal View History

2016-09-10 14:32:48 +01:00
{ stdenv, lib, fetchurl, fetchpatch
, withGUI ? false, gtk2, pkgconfig, sqlite # compile GUI
}:
2016-09-10 14:32:48 +01:00
let numVersion = "02.18"; # :(
in
stdenv.mkDerivation rec {
name = "lshw-${numVersion}b";
2018-11-04 23:50:34 +00:00
version = "${numVersion}";
src = fetchurl {
2018-11-04 23:50:34 +00:00
url = "https://ezix.org/software/files/lshw-B.${version}.tar.gz";
2016-09-10 14:32:48 +01:00
sha256 = "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf";
};
2016-09-10 14:32:48 +01:00
patches = [ (fetchpatch {
# fix crash in scan_dmi_sysfs() when run as non-root
url = "https://github.com/lyonel/lshw/commit/fbdc6ab15f7eea0ddcd63da355356ef156dd0d96.patch";
sha256 = "147wyr5m185f8swsmb4q1ahs9r1rycapbpa2548aqbv298bbish3";
})];
nativeBuildInputs = [ pkgconfig ];
buildInputs = lib.optionals withGUI [ gtk2 sqlite ];
2016-09-10 14:32:48 +01:00
# Fix version info.
preConfigure = ''
sed -e "s/return \"unknown\"/return \"${version}\"/" \
-i src/core/version.cc
'';
2016-09-10 14:32:48 +01:00
makeFlags = [ "PREFIX=$(out)" ];
buildFlags = [ "all" ] ++ lib.optional withGUI "gui";
2016-09-10 14:32:48 +01:00
installTargets = [ "install" ] ++ lib.optional withGUI "install-gui";
2016-09-10 14:32:48 +01:00
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = https://ezix.org/project/wiki/HardwareLiSter;
description = "Provide detailed information on the hardware configuration of the machine";
license = licenses.gpl2;
2015-06-22 07:25:07 +01:00
maintainers = with maintainers; [ phreedom jgeerds ];
platforms = platforms.linux;
};
}