2016-09-10 13:32:48 +00:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch
|
2021-01-17 09:17:16 +00:00
|
|
|
, withGUI ? false, gtk2, pkg-config, sqlite # compile GUI
|
2016-09-10 13:32:48 +00:00
|
|
|
}:
|
2010-11-15 09:52:57 +00:00
|
|
|
|
2016-09-10 13:32:48 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-01 12:46:39 +00:00
|
|
|
pname = "lshw";
|
|
|
|
version = "B.02.18";
|
2010-11-15 09:52:57 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-01 12:46:39 +00:00
|
|
|
url = "https://ezix.org/software/files/lshw-${version}.tar.gz";
|
2016-09-10 13:32:48 +00:00
|
|
|
sha256 = "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf";
|
2010-11-15 09:52:57 +00:00
|
|
|
};
|
|
|
|
|
2019-01-09 16:43:02 +00: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";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
# support cross-compilation
|
|
|
|
url = "https://github.com/lyonel/lshw/commit/8486d25cea9b68794504fbd9e5c6e294bac6cb07.patch";
|
|
|
|
sha256 = "08f0wnxsq0agvsc66bhc7lxvk564ir0pp8pg3cym6a621prb9lm0";
|
|
|
|
})
|
|
|
|
];
|
2016-09-10 13:32:48 +00:00
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-10-02 00:22:12 +00:00
|
|
|
|
2017-09-05 21:26:13 +00:00
|
|
|
buildInputs = lib.optionals withGUI [ gtk2 sqlite ];
|
2016-09-10 13:32:48 +00:00
|
|
|
|
2017-09-30 09:37:47 +00:00
|
|
|
# Fix version info.
|
|
|
|
preConfigure = ''
|
|
|
|
sed -e "s/return \"unknown\"/return \"${version}\"/" \
|
|
|
|
-i src/core/version.cc
|
|
|
|
'';
|
|
|
|
|
2016-09-10 13:32:48 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
buildFlags = [ "all" ] ++ lib.optional withGUI "gui";
|
2010-11-15 09:52:57 +00:00
|
|
|
|
2016-09-10 13:32:48 +00:00
|
|
|
installTargets = [ "install" ] ++ lib.optional withGUI "install-gui";
|
2010-11-15 09:52:57 +00:00
|
|
|
|
2016-09-10 13:32:48 +00:00
|
|
|
enableParallelBuilding = true;
|
2010-11-15 09:52:57 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://ezix.org/project/wiki/HardwareLiSter";
|
2013-10-06 09:49:53 +00:00
|
|
|
description = "Provide detailed information on the hardware configuration of the machine";
|
2010-11-15 09:52:57 +00:00
|
|
|
license = licenses.gpl2;
|
2021-12-18 09:25:46 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2010-11-15 09:52:57 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2010-11-15 20:36:50 +00:00
|
|
|
}
|