(use-modules (guix svn-download) ((guix licenses) #:prefix license:) (gnu packages linux) (gnu packages python) (guix packages) (guix gexp) (guix packages) (guix git-download) (guix build-system cmake) (guix utils) (srfi srfi-1)) (define-public libcpuid ;; We need to remove blobs from the source, first we have to isolate the blob ;; source in build system. ;; See . (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 ;; Now 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 #:modules '((rnrs exceptions) (guix build cmake-build-system) (guix build utils)) #:configure-flags #~'("-DLIBCPUID_TESTS=ON") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'absolutize (lambda* (#:key inputs #:allow-other-keys) ;; modprobe doesn't exist on the Hurd (guard (c ((search-error? c) (values))) (substitute* "libcpuid/rdmsr.c" (("modprobe") (search-input-file inputs "bin/modprobe"))))))))) (inputs (if (target-linux?) (list kmod) ; linux-only '())) ;; a python from the 3. series is required by tests (native-inputs (list python-3)) (supported-systems (filter (lambda (t) (or (target-x86-64? t) (target-x86-32? t))) %supported-systems)) (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. This library is not to be confused with the @code{cpuid} command line utility fromm the @code{cpuid} package.") (license license:bsd-2)))) libcpuid