2022-04-27 09:35:20 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, hwdata
|
|
|
|
, gtk2
|
|
|
|
, pkg-config
|
|
|
|
, sqlite # compile GUI
|
|
|
|
, withGUI ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "lshw";
|
2022-04-27 09:35:20 +00:00
|
|
|
# Fix repology.org by not including the prefixed B, otherwise the `pname` attr
|
|
|
|
# gets filled as `lshw-B.XX.XX` in `nix-env --query --available --attr nixpkgs.lshw --meta`
|
|
|
|
# See https://github.com/NixOS/nix/pull/4463 for a definitive fix
|
|
|
|
version = "02.19";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lyonel";
|
|
|
|
repo = pname;
|
|
|
|
rev = "B.${version}";
|
|
|
|
sha256 = "sha256-PzbNGc1pPiPLWWgTeWoNfAo+SsXgi1HcjnXfYXA9S0I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
buildInputs = [ hwdata ]
|
|
|
|
++ lib.optionals withGUI [ gtk2 sqlite ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"VERSION=${src.rev}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildFlags = [ "all" ] ++ lib.optional withGUI "gui";
|
|
|
|
|
|
|
|
installTargets = [ "install" ] ++ lib.optional withGUI "install-gui";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://ezix.org/project/wiki/HardwareLiSter";
|
|
|
|
description = "Provide detailed information on the hardware configuration of the machine";
|
|
|
|
license = licenses.gpl2;
|
2022-04-27 09:35:20 +00:00
|
|
|
maintainers = with maintainers; [ thiagokokada ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|