2021-01-15 15:45:37 +01:00
|
|
|
{ lib, stdenv, fetchurl, perl }:
|
2020-09-17 18:47:14 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cpuid";
|
2020-10-24 17:16:12 +02:00
|
|
|
version = "20201006";
|
2020-09-17 18:47:14 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "${pname}-${version}.src.tar.gz";
|
|
|
|
url = "http://etallen.com/cpuid/${pname}-${version}.src.tar.gz";
|
2020-10-24 17:16:12 +02:00
|
|
|
sha256 = "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k";
|
2020-09-17 18:47:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# For pod2man during the build process.
|
|
|
|
nativeBuildInputs = [ perl ];
|
|
|
|
|
|
|
|
# As runtime dependency for cpuinfo2cpuid.
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
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.
|
|
|
|
'';
|
|
|
|
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2021-01-15 15:45:37 +01:00
|
|
|
license = lib.licenses.gpl2;
|
2020-09-17 18:47:14 +02:00
|
|
|
homepage = "http://etallen.com/cpuid.html";
|
2021-01-15 15:45:37 +01:00
|
|
|
maintainers = with lib.maintainers; [ blitz ];
|
2020-09-17 18:47:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|