2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libx86emu, flex, perl, libuuid }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "hwinfo";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "21.76";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opensuse";
|
|
|
|
repo = "hwinfo";
|
|
|
|
rev = version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "sha256-C0aYEgJC+ITxWcYBLPehNz9J1Y25gS1+UDVc3+7nIKQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# VERSION and changelog are usually generated using Git
|
|
|
|
# unless HWINFO_VERSION is defined (see Makefile)
|
|
|
|
export HWINFO_VERSION="${version}"
|
|
|
|
sed -i 's|^\(TARGETS\s*=.*\)\<changelog\>\(.*\)$|\1\2|g' Makefile
|
|
|
|
|
|
|
|
substituteInPlace Makefile --replace "/sbin" "/bin" --replace "/usr/" "/"
|
|
|
|
substituteInPlace src/isdn/cdb/Makefile --replace "lex isdn_cdb.lex" "flex isdn_cdb.lex"
|
|
|
|
substituteInPlace hwinfo.pc.in --replace "prefix=/usr" "prefix=$out"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ flex ];
|
|
|
|
buildInputs = [ libx86emu perl libuuid ];
|
|
|
|
|
|
|
|
makeFlags = [ "LIBDIR=/lib" ];
|
|
|
|
#enableParallelBuilding = true;
|
|
|
|
|
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Hardware detection tool from openSUSE";
|
2021-05-03 20:48:10 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/openSUSE/hwinfo";
|
|
|
|
maintainers = with maintainers; [ bobvanderlinden ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|