2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flex
|
|
|
|
, libuuid
|
|
|
|
, libx86emu
|
|
|
|
, perl
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "hwinfo";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "22.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opensuse";
|
|
|
|
repo = "hwinfo";
|
|
|
|
rev = version;
|
2022-08-21 13:32:41 +00:00
|
|
|
sha256 = "sha256-nGWpUqBkpiiNuH5kEHWR1/+0aYIeLf9k3AmzQR85Swk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flex
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libuuid
|
|
|
|
libx86emu
|
|
|
|
perl
|
|
|
|
];
|
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
makeFlags = [
|
|
|
|
"LIBDIR=/lib"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
installFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|