gnu: libcpuid: Build on more architectures.

* gnu/packages/hardware.scm (libcpuid)[arguments]: When building for
armhf-linux or aarch64-linux adjust the 'absoultize phase to adjust the
dkms installation directory.
[inputs]: When building for armhf-linux or aarch64-linux add
linux-libre-headers.
[supported-systems]: Also allow armhf and aarch64 systems.

Change-Id: Idd24651da77129782461074caae9a3cc3dcaf351
This commit is contained in:
Efraim Flashner 2025-07-10 10:33:01 +03:00
parent 3adadd3051
commit d2e03bf414
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -1476,14 +1476,26 @@ management, attestation, encryption, and signing.")
(substitute* '("libcpuid/rdmsr.c"
"libcpuid/rdcpuid.c")
(("modprobe")
(search-input-file inputs "/bin/modprobe")))))))))
(search-input-file inputs "/bin/modprobe"))))
;; TODO: Build kernel module.
(when (and #$(target-linux?)
#$(target-arm?))
(substitute* "drivers/arm/linux/CMakeLists.txt"
(("/usr/src/") (string-append #$output "/src/")))))))))
(inputs
(append
(if (target-linux?)
(list kmod)
'())
(if (and (target-arm?)
(target-linux?))
(list linux-libre-headers)
'())
'()))
(native-inputs (list python-3)) ;required by tests
(supported-systems
(filter (lambda (t) (or (target-x86-64? t) (target-x86-32? t)))
(filter (lambda (t) (or (target-x86-64? t) (target-x86-32? t)
(target-aarch64? t) (target-arm32? t)))
%supported-systems))
(home-page "https://libcpuid.sourceforge.net/")
(synopsis "Small library for x86 CPU detection and feature extraction")