Subject: [bug#60224] [PATCH 6/9] gnu: make-u-boot-sunxi64-package: Use gexps and adjust file name.

From: Maxim Cournoyer <[email-masked]>
Date: Tue, 20 Dec 2022 13:34:24 -0500

* gnu/packages/bootloaders.scm (make-u-boot-sunxi64-package)
[phases] {set-environment}: Replace bl31.bin with bl31.elf; bl31.elf doesn't
exist anymore due to the package being a true cross-build.
---

 gnu/packages/bootloaders.scm | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index ae847080d0..5f0182524d 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -925,17 +925,14 @@ (define*-public (make-u-boot-sunxi64-package board triplet
       (arguments
        (substitute-keyword-arguments (package-arguments base)
          ((#:phases phases)
-          `(modify-phases ,phases
-             (add-after 'unpack 'set-environment
-               (lambda* (#:key native-inputs inputs #:allow-other-keys)
-                 (let ((bl31
-                        (string-append
-                         (assoc-ref (or native-inputs inputs) "firmware")
-                         "/bl31.bin")))
-                   (setenv "BL31" bl31))))))))
+          #~(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"))))))))
       (native-inputs
-       `(("firmware" ,arm-trusted-firmware-sun50i-a64)
-         ,@(package-native-inputs base))))))
+       (modify-inputs (package-native-inputs base)
+         (append arm-trusted-firmware-rk3399))))))
 
 (define-public u-boot-pine64-plus
   (make-u-boot-sunxi64-package "pine64_plus" "aarch64-linux-gnu"))
-- 
2.38.1