gnu: libcpuid: Update to 0.8.0.

* gnu/packages/hardware.scm (libcpuid): Update to 0.8.0.
[source]: Update snippet for changes in source location.
[arguments]: Update configure-flag.  Update 'absolutize phase to find
more instances for substitution.

Change-Id: Id418fb77402039cbfbbde9d945e81521de369def
This commit is contained in:
Efraim Flashner 2025-07-10 09:50:04 +03:00
parent e008e5c2d3
commit 3adadd3051
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -14,7 +14,7 @@
;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2022 Marcel Kupiec <formbi@protonmail.com>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2022, 2025 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2023 Spencer Skylar Chan <schan12@umd.edu>
;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
;;; Copyright © 2024 Giacomo Leidi <goodoldpaul@autistici.org>
@ -1445,55 +1445,52 @@ management, attestation, encryption, and signing.")
(license license:bsd-3)))
(define-public libcpuid
;; We need to remove blobs from the source, first we have to isolate the blob
;; source in build system.
;; See https://github.com/anrieff/libcpuid/pull/159.
(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
#:configure-flags #~(list "-DLIBCPUID_TESTS=ON")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'absolutize
(lambda* (#:key inputs #:allow-other-keys)
;; Linux specific
(when #$(target-linux?)
(substitute* "libcpuid/rdmsr.c"
(("modprobe") (which "modprobe")))))))))
(inputs
(if (target-linux?)
(list kmod)
'()))
(native-inputs (list python-3)) ;required by tests
(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
(package
(name "libcpuid")
(version "0.8.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/anrieff/libcpuid")
(commit (string-append "v" version))))
(sha256
(base32 "09brfdvv9289cqyq9cd32c8qqyv8cixj06ld8yb8ifi7d4j0zzlv"))
(modules '((guix build utils)))
(snippet
;; Now remove blobs.
#~(begin
(delete-file "libcpuid/msrdriver.c")
(delete-file-recursively "drivers/x86")))
(file-name (git-file-name name version))))
(build-system cmake-build-system)
(arguments
(list
#:configure-flags #~(list "-DLIBCPUID_ENABLE_TESTS=ON")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'absolutize
(lambda* (#:key inputs #:allow-other-keys)
;; Linux specific
(when #$(target-linux?)
(substitute* '("libcpuid/rdmsr.c"
"libcpuid/rdcpuid.c")
(("modprobe")
(search-input-file inputs "/bin/modprobe")))))))))
(inputs
(if (target-linux?)
(list kmod)
'()))
(native-inputs (list python-3)) ;required by tests
(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 from package @code{cpuid}.")
(license license:bsd-2))))
(license license:bsd-2)))
(define-public liblxi
(package