gnu: freeipmi: Fix cross-compilation to riscv64-linux-gnu.

* gnu/packages/freeipmi.scm (freeipmi)[arguments]: When cross-compilation to
riscv64-linux-gnu, add update-config-scripts phase.
[native-inputs]: When cross compiling to riscv64-linux-gnu, add config.

Change-Id: I0059d2048524b476703514ddbe111870257f4ac6
This commit is contained in:
Zheng Junjie 2024-09-09 18:00:11 +08:00
parent b9c466276c
commit 1864659189
No known key found for this signature in database
GPG key ID: 3B5AA993E1A2DFF0

View file

@ -20,9 +20,12 @@
(define-module (gnu packages freeipmi)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix gexp)
#:use-module (guix licenses)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages autotools)
#:use-module (gnu packages gnupg))
(define-public freeipmi
@ -38,13 +41,32 @@ (define-public freeipmi
"1dgd2izbp6mqk7l0bgw9fkpvl4mjz672p8baz3ac9k5pfrfaqg8s"))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags '("--disable-static"
,@(if (%current-target-system)
;; We cannot check for these devices
;; when cross compiling.
`("ac_cv_file__dev_random=yes"
"ac_cv_file__dev_urandom=yes")
'()))))
(append (if (and (%current-target-system)
(target-riscv64?))
(list #:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'update-config-scripts
(lambda* (#:key inputs native-inputs #:allow-other-keys)
;; Replace outdated config.guess and config.sub.
(for-each (lambda (file)
(install-file
(search-input-file
(or native-inputs inputs)
(string-append "/bin/" file)) "config"))
'("config.guess" "config.sub"))))))
'())
`(#:configure-flags '("--disable-static"
,@(if (%current-target-system)
;; We cannot check for these devices
;; when cross compiling.
`("ac_cv_file__dev_random=yes"
"ac_cv_file__dev_urandom=yes")
'())))))
(native-inputs
(if (and (%current-target-system)
(target-riscv64?))
(list config)
'()))
(inputs
(list libgcrypt))
(home-page "https://www.gnu.org/software/freeipmi/")