From 7ac9e6dd9d327c59d6d90dc0628a65fe26946021 Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Tue, 11 Jan 2022 22:56:14 +0800 Subject: [PATCH 1/6] gnu: Add libcpuid. * gnu/packages/hardware.scm (libcpuid): New variable. --- gnu/packages/hardware.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm index 8727f0f20a..230800e44d 100644 --- a/gnu/packages/hardware.scm +++ b/gnu/packages/hardware.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2021 Raghav Gururajan ;;; Copyright © 2021 Vinicius Monego ;;; Copyright © 2021, 2022 John Kehayias +;;; Copyright © 2022 Zhu Zihao ;;; ;;; This file is part of GNU Guix. ;;; @@ -953,3 +954,34 @@ (define-public tpm2-tss libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm and libtss2-tcti-mssim.") (license license:bsd-2))) + +(define-public libcpuid + (let ((commit "2e61160983f32ba840b2246d3c3850c44626ab0d") + (revision "1")) + (package + (name "libcpuid") + (version (git-version "0.5.1" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/anrieff/libcpuid") + (commit commit))) + (sha256 + (base32 "1mphvkiqq6z33sq6i490fq27sbyylacwrf8bg7ccvpcjms208sww")) + (modules '((guix build utils))) + (snippet + ;; Remove blobs + #~(begin + (delete-file "libcpuid/msrdriver.c") + (delete-file-recursively "contrib/MSR Driver"))) + (file-name (git-file-name name version)))) + (build-system cmake-build-system) + (arguments + (list #:tests? #f)) ;broken + (supported-systems '("x86_64-linux" "i686-linux")) + (home-page "https://libcpuid.sourceforge.net/") + (synopsis "Small library for x86 CPU detection and feature extraction") + (description "Libcpuid is a small C library to get vendor, model, branding +string, code name and other information from x86 CPU.") + (license license:bsd-2)))) -- 2.34.0