From 5fa0612d85736b759dbe9b2fc1db0cc420a59233 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Thu, 17 Sep 2020 18:47:14 +0200 Subject: [PATCH] cpuid: init at 20200427 cpuid is a tool to describe x86 CPU features. This is useful for people doing low-level software development. --- pkgs/os-specific/linux/cpuid/default.nix | 50 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/os-specific/linux/cpuid/default.nix diff --git a/pkgs/os-specific/linux/cpuid/default.nix b/pkgs/os-specific/linux/cpuid/default.nix new file mode 100644 index 000000000000..df0017eadc1f --- /dev/null +++ b/pkgs/os-specific/linux/cpuid/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchurl, perl }: + +stdenv.mkDerivation rec { + pname = "cpuid"; + version = "20200427"; + + src = fetchurl { + name = "${pname}-${version}.src.tar.gz"; + url = "http://etallen.com/cpuid/${pname}-${version}.src.tar.gz"; + sha256 = "1m31238z2ya8f8pzpyklwp0ksf5xicqrw1z941hhhx913wzldaf1"; + }; + + # 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" ]; + license = stdenv.lib.licenses.gpl2; + homepage = "http://etallen.com/cpuid.html"; + maintainers = with stdenv.lib.maintainers; [ blitz ]; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 35bfbcbdc736..952ddd197807 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -962,6 +962,8 @@ in cozy = callPackage ../applications/audio/cozy-audiobooks { }; + cpuid = callPackage ../os-specific/linux/cpuid { }; + ctrtool = callPackage ../tools/archivers/ctrtool { }; crowbar = callPackage ../tools/security/crowbar { };