2016-09-10 15:32:48 +02:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch
|
|
|
|
, withGUI ? false, gtk2, pkgconfig, sqlite # compile GUI
|
|
|
|
}:
|
2010-11-15 10:52:57 +01:00
|
|
|
|
2016-09-10 15:32:48 +02:00
|
|
|
let numVersion = "02.18"; # :(
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "lshw-${numVersion}b";
|
|
|
|
version = "B.${numVersion}";
|
2010-11-15 10:52:57 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2016-09-10 15:32:48 +02:00
|
|
|
url = "http://ezix.org/software/files/lshw-${version}.tar.gz";
|
|
|
|
sha256 = "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf";
|
2010-11-15 10:52:57 +01:00
|
|
|
};
|
|
|
|
|
2016-09-10 15:32:48 +02: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";
|
|
|
|
})];
|
|
|
|
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2017-10-02 02:22:12 +02:00
|
|
|
|
2017-09-05 23:26:13 +02:00
|
|
|
buildInputs = lib.optionals withGUI [ gtk2 sqlite ];
|
2016-09-10 15:32:48 +02:00
|
|
|
|
2017-09-30 11:37:47 +02:00
|
|
|
# Fix version info.
|
|
|
|
preConfigure = ''
|
|
|
|
sed -e "s/return \"unknown\"/return \"${version}\"/" \
|
|
|
|
-i src/core/version.cc
|
|
|
|
'';
|
|
|
|
|
2016-09-10 15:32:48 +02:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
buildFlags = [ "all" ] ++ lib.optional withGUI "gui";
|
2010-11-15 10:52:57 +01:00
|
|
|
|
2016-09-10 15:32:48 +02:00
|
|
|
installTargets = [ "install" ] ++ lib.optional withGUI "install-gui";
|
2010-11-15 10:52:57 +01:00
|
|
|
|
2016-09-10 15:32:48 +02:00
|
|
|
enableParallelBuilding = true;
|
2010-11-15 10:52:57 +01:00
|
|
|
|
2010-11-15 21:36:50 +01:00
|
|
|
meta = with stdenv.lib; {
|
2018-01-05 20:42:46 +01:00
|
|
|
homepage = https://ezix.org/project/wiki/HardwareLiSter;
|
2013-10-06 11:49:53 +02:00
|
|
|
description = "Provide detailed information on the hardware configuration of the machine";
|
2010-11-15 10:52:57 +01:00
|
|
|
license = licenses.gpl2;
|
2015-06-22 08:25:07 +02:00
|
|
|
maintainers = with maintainers; [ phreedom jgeerds ];
|
2010-11-15 10:52:57 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2010-11-15 21:36:50 +01:00
|
|
|
}
|