diff mbox series

[bug#60224,5/9] gnu: u-boot-firefly-rk3399: Use gexps and fix cross-build.

Message ID 20221220183427.31752-6-maxim.cournoyer@gmail.com
State New
Headers show
Series Improvements to our u-boot tooling | expand

Commit Message

Maxim Cournoyer Dec. 20, 2022, 6:34 p.m. UTC
* gnu/packages/bootloaders.scm (u-boot-firefly-rk3399) [arguments]: Use gexps.
[phases] {set-environment}: Look for the bl31.elf in native-inputs, useful when
cross-compiling.
---

 gnu/packages/bootloaders.scm | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 7e78b9af41..ae847080d0 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -1080,16 +1080,17 @@  (define-public u-boot-firefly-rk3399
       (arguments
        (substitute-keyword-arguments (package-arguments base)
          ((#:phases phases)
-          `(modify-phases ,phases
-             (add-after 'unpack 'set-environment
-               (lambda* (#:key inputs #:allow-other-keys)
-                 (setenv "BL31" (search-input-file inputs "/bl31.elf"))))
-             ;; Phases do not succeed on the bl31 ELF.
-             (delete 'strip)
-             (delete 'validate-runpath)))))
+          #~(modify-phases #$phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                  (setenv "BL31" (search-input-file (or native-inputs inputs)
+                                                    "bl31.elf"))))
+              ;; Phases do not succeed on the bl31 ELF.
+              (delete 'strip)
+              (delete 'validate-runpath)))))
       (native-inputs
-       `(("firmware" ,arm-trusted-firmware-rk3399)
-         ,@(package-native-inputs base))))))
+       (modify-inputs (package-native-inputs base)
+         (append arm-trusted-firmware-rk3399))))))
 
 (define-public u-boot-rockpro64-rk3399
   (let ((base (make-u-boot-package "rockpro64-rk3399" "aarch64-linux-gnu"