1{
2 lib,
3 stdenv,
4 fetchurl,
5 perl,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "cpuid";
10 version = "20250513";
11
12 src = fetchurl {
13 url = "http://etallen.com/cpuid/${pname}-${version}.src.tar.gz";
14 sha256 = "sha256-b0dKIrWEhIjkVLAaMduA65WNVWdLUzlTP8DmrreTYms=";
15 };
16
17 # For pod2man during the build process.
18 nativeBuildInputs = [ perl ];
19
20 # As runtime dependency for cpuinfo2cpuid.
21 buildInputs = [ perl ];
22
23 # The Makefile hardcodes $(BUILDROOT)/usr as installation
24 # destination. Just nuke all mentions of /usr to get the right
25 # installation location.
26 patchPhase = ''
27 sed -i -e 's,/usr/,/,' Makefile
28 '';
29
30 installPhase = ''
31 make install BUILDROOT=$out
32
33 if [ ! -x $out/bin/cpuid ]; then
34 echo Failed to properly patch Makefile.
35 exit 1
36 fi
37 '';
38
39 meta = with lib; {
40 description = "Linux tool to dump x86 CPUID information about the CPU";
41 longDescription = ''
42 cpuid dumps detailed information about the CPU(s) gathered from the CPUID
43 instruction, and also determines the exact model of CPU(s). It supports
44 Intel, AMD, VIA, Hygon, and Zhaoxin CPUs, as well as older Transmeta,
45 Cyrix, UMC, NexGen, Rise, and SiS CPUs.
46 '';
47 homepage = "http://etallen.com/cpuid.html";
48 license = licenses.gpl2Plus;
49 maintainers = with maintainers; [ blitz ];
50 platforms = [
51 "i686-linux"
52 "x86_64-linux"
53 ];
54 };
55}