Archived
1
0
Fork 0

gnu: efivar: Fix cross-compilation.

[version]: Temporarily change the version to a git-version.
[source]: Fetch source from git, use newer commit to fix cross-build.
[arguments]<#:make-flags>: Set HOSTCC to gcc.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
dan 2023-07-02 21:44:37 +08:00 committed by Maxim Cournoyer
parent e2c9d8f94e
commit f38be97383
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -74,6 +74,7 @@
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu> ;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream> ;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 dan <i@dan.games>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -7255,48 +7256,50 @@ under OpenGL graphics workloads.")
(license license:gpl3))) (license license:gpl3)))
(define-public efivar (define-public efivar
(package ;; XXX: 15622b7e5761f3dde3f0e42081380b2b41639a48 fixes compilation on i686.
(name "efivar") ;; ca48d3964d26f5e3b38d73655f19b1836b16bd2d fixes cross-compilation.
(version "38") (let ((commit "ca48d3964d26f5e3b38d73655f19b1836b16bd2d")
(source (origin (revision "0"))
(method url-fetch) (package
(uri (string-append "https://github.com/rhboot/" name (name "efivar")
"/releases/download/" version "/" name (version (git-version "38" revision commit))
"-" version ".tar.bz2")) (source (origin
(sha256 (method git-fetch)
(base32 (uri (git-reference
"0jaka7b4lccswjqiv4liclkj6w78gildg7vd6dnw3wf595pfs67h")) (url "https://github.com/rhboot/efivar")
(patches (commit commit)))
(search-patches "efivar-211.patch")))) (file-name (git-file-name name version))
(sha256
(build-system gnu-build-system) (base32
(arguments "0zsab3hcv1v53cxwkvsk09ifnwhs48a6xa3kxlwvs87yxswspvi8"))))
(list (build-system gnu-build-system)
;; Tests require a UEFI system and is not detected in the chroot. (arguments
#:tests? #f (list
#:make-flags ;; Tests require a UEFI system and is not detected in the chroot.
#~(list (string-append "prefix=" #$output) #:tests? #f
(string-append "libdir=" #$output "/lib") #:make-flags #~(list (string-append "prefix="
(string-append "CC=" #$(cc-for-target)) #$output)
(string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib")) (string-append "libdir="
#:phases #$output "/lib")
#~(modify-phases %standard-phases (string-append "CC="
(add-after 'unpack 'build-deterministically #$(cc-for-target)) "HOSTCC=gcc"
(lambda _ (string-append "LDFLAGS=-Wl,-rpath="
(substitute* "src/include/defaults.mk" #$output "/lib"))
;; Don't use -march=native. #:phases #~(modify-phases %standard-phases
(("-march=native") (add-after 'unpack 'build-deterministically
"")))) (lambda _
(delete 'configure)))) (substitute* "src/include/defaults.mk"
(native-inputs ;; Don't use -march=native.
(list mandoc pkg-config)) (("-march=native")
(inputs ""))))
(list popt)) (delete 'configure))))
(home-page "https://github.com/rhboot/efivar") (native-inputs (list mandoc pkg-config))
(synopsis "Tool and library to manipulate EFI variables") (inputs (list popt))
(description "This package provides a library and a command line (home-page "https://github.com/rhboot/efivar")
(synopsis "Tool and library to manipulate EFI variables")
(description "This package provides a library and a command line
interface to the variable facility of UEFI boot firmware.") interface to the variable facility of UEFI boot firmware.")
(license license:lgpl2.1+))) (license license:lgpl2.1+))))
(define-public efibootmgr (define-public efibootmgr
(package (package