diff mbox series

[bug#69476,6/8] gnu: cross-binutils: Use binutils-2.33 for ath9k.

Message ID 4f6ab97323db3c8dfe2d5f40d5fe0811a21d4e58.1709219325.git.jean@foundationdevices.com
State New
Headers show
Series guix: Add xtensa-ath9k-elf platform. | expand

Commit Message

Jean-Pierre De Jesus DIAZ Feb. 29, 2024, 3:20 p.m. UTC
* gnu/packages/cross-base.scm (cross-binutils-package): New procedure.
* gnu/packages/cross-base.scm (cross-binutils): Select binutils default
value with cross-binutils-package.
* gnu/packages/firmware.scm (ath9k-htc-firmware) <native-inputs>: Do not
explicitly set the #:xbinutils keyword argument.

Change-Id: I0eb25eb2b494241c205286837bfa79a61de8e0b7
---
 gnu/packages/cross-base.scm | 13 ++++++++++++-
 gnu/packages/firmware.scm   | 10 ++--------
 2 files changed, 14 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 93383089e5..d275ae894d 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -97,7 +97,18 @@  (define* (cross-binutils/deprecated target #:optional (binutils binutils))
   (warning (G_ "'cross-binutils' must be used with keyword arguments~%"))
   (cross-binutils* target #:binutils binutils))
 
-(define* (cross-binutils* target #:key (binutils binutils))
+(define (cross-binutils-package target)
+  "Returns the default package to use for a cross-Binutils for TARGET."
+  (cond
+    ;; The xtensa-ath9k-elf target is used solely to build the firmware for
+    ;; ath9k devices, the patches to binutils have not been updated and
+    ;; only apply to binutils@2.33.
+    ((string=? target "xtensa-ath9k-elf") binutils-2.33)
+    (else binutils)))
+
+(define* (cross-binutils* target
+                          #:key
+                          (binutils (cross-binutils-package target)))
   "Return a cross-Binutils for TARGET using BINUTILS."
   (let ((binutils (package
                     (inherit binutils)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 6993925387..ad687d1de6 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -139,14 +139,8 @@  (define-public ath9k-htc-firmware
 
     ;; The firmware is cross-compiled using a "bare bones" compiler (no libc.)
     ;; Use our own tool chain for that.
-    (native-inputs `(("cross-gcc" ,(cross-gcc
-                                    "xtensa-ath9k-elf"
-                                    #:xbinutils (cross-binutils
-                                                 "xtensa-ath9k-elf"
-                                                 #:binutils binutils-2.33)))
-                     ("cross-binutils" ,(cross-binutils
-                                         "xtensa-ath9k-elf"
-                                         #:binutils binutils-2.33))
+    (native-inputs `(("cross-gcc" ,(cross-gcc "xtensa-ath9k-elf"))
+                     ("cross-binutils" ,(cross-binutils "xtensa-ath9k-elf"))
                      ("cmake" ,cmake-minimal)
                      ("perl" ,perl)))
     (home-page "https://wireless.wiki.kernel.org/en/users/Drivers/ath9k_htc")