2021-11-06 16:45:44 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, perl
|
|
|
|
}:
|
2020-09-17 16:47:14 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cpuid";
|
2023-01-22 19:57:35 +00:00
|
|
|
version = "20230120";
|
2020-09-17 16:47:14 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://etallen.com/cpuid/${pname}-${version}.src.tar.gz";
|
2023-01-22 19:57:35 +00:00
|
|
|
sha256 = "sha256-uJtB+IldDVj9uwpUECu0kLx8WCjbLNFb6C0U0ZRjpXk=";
|
2020-09-17 16:47:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# For pod2man during the build process.
|
2021-11-06 16:45:44 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
perl
|
|
|
|
];
|
2020-09-17 16:47:14 +00:00
|
|
|
|
|
|
|
# As runtime dependency for cpuinfo2cpuid.
|
2021-11-06 16:45:44 +00:00
|
|
|
buildInputs = [
|
|
|
|
perl
|
|
|
|
];
|
2020-09-17 16:47:14 +00:00
|
|
|
|
|
|
|
# The Makefile hardcodes $(BUILDROOT)/usr as installation
|
|
|
|
# destination. Just nuke all mentions of /usr to get the right
|
|
|
|
# installation location.
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i -e 's,/usr/,/,' Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
make install BUILDROOT=$out
|
|
|
|
|
|
|
|
if [ ! -x $out/bin/cpuid ]; then
|
|
|
|
echo Failed to properly patch Makefile.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2021-11-06 16:45:44 +00:00
|
|
|
meta = with lib; {
|
2020-09-17 16:47:14 +00:00
|
|
|
description = "Linux tool to dump x86 CPUID information about the CPU";
|
|
|
|
longDescription = ''
|
|
|
|
cpuid dumps detailed information about the CPU(s) gathered from the CPUID
|
|
|
|
instruction, and also determines the exact model of CPU(s). It supports
|
|
|
|
Intel, AMD, VIA, Hygon, and Zhaoxin CPUs, as well as older Transmeta,
|
|
|
|
Cyrix, UMC, NexGen, Rise, and SiS CPUs.
|
|
|
|
'';
|
|
|
|
homepage = "http://etallen.com/cpuid.html";
|
2021-12-04 23:23:39 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-11-06 16:45:44 +00:00
|
|
|
maintainers = with maintainers; [ blitz ];
|
2021-12-04 23:23:39 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2020-09-17 16:47:14 +00:00
|
|
|
};
|
|
|
|
}
|