Package: guix-patches;
Reported by: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com>
Date: Thu, 29 Feb 2024 15:20:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69476 in the body.
You can then email your comments to 69476 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:20:02 GMT) Full text and rfc822 format available.Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com>
:efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org
.
(Thu, 29 Feb 2024 15:20:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: guix-patches <at> gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 0/8] guix: Add xtensa-ath9k-elf platform. Date: Thu, 29 Feb 2024 16:19:17 +0100
Hello, As the ath9k-htc-firmware package requires a custom toolchain to build the firmware I thought it was best to have a target for this specific package as it modifies the default configuration of the Xtensa target in GCC. To work around this a new target is added: xtensa-ath9k-elf. It uses binutils <at> 2.33 and the patched version of GCC to properly compile the firmware. So, as a result it allows using #:target keyword parameter to cross-compile the firmware and avoids explicitly adding the cross compiler in the NATIVE-INPUTS field. As a result the ath9k-htc-firmware package was splitted into two and uses the cmake-build-sytem now to use Guix's cross-compilation support properly, so it removes the need for the ath9k-htc-firmware-objcopy.patch. The [PATCH 7/8] contains a patch that was already sent to: https://issues.guix.gnu.org/68366 I don't have the hardware to test this firmware but the build produces the same hashes for the firmware so it's safe to say that the firmware should keep working. The hashes with this patch series: a5481cc67d962b217de1300121a6c7584e847cbe215442553d24a2173ca9202e /gnu/store/0i3zw28pvrr8l85fx79i8lq0f9vmgyjz-ath9k-htc-ar9271-firmware-1.4.0/lib/firmware/htc_9271.fw eef84c16e3edad3fdec19c985d190b5ed3f5bd5bae20be5579681ab35f001406 /gnu/store/iqbd77grzy4sngkxz9lgyvk52apn8vzj-ath9k-htc-ar7010-firmware-1.4.0/lib/firmware/htc_7010.fw And the hashes in master at commit 75bad75367fcf2c289fae3b40dbcc850f92177be: a5481cc67d962b217de1300121a6c7584e847cbe215442553d24a2173ca9202e /gnu/store/0m45gn74b5bavxq77158i3l593lh082r-ath9k-htc-firmware-1.4.0/lib/firmware/htc_9271.fw eef84c16e3edad3fdec19c985d190b5ed3f5bd5bae20be5579681ab35f001406 /gnu/store/0m45gn74b5bavxq77158i3l593lh082r-ath9k-htc-firmware-1.4.0/lib/firmware/htc_7010.fw Jean-Pierre De Jesus DIAZ (8): doc: Add documentation for x86_64-linux-gnux32. guix: Add xtensa-ath9k-elf platform. gnu: ath9k-htc-firmware: Remove binary blobs. gnu: ath9k-htc-firmware: Allow using other targets. gnu: ath9k-htc-firmware: Use xtensa-ath9k-elf. gnu: cross-binutils: Use binutils-2.33 for ath9k. guix: cmake-build-system: Handle unknown systems. gnu: ath9k-htc-firmware: Split package. Makefile.am | 1 + doc/guix.texi | 12 +++ gnu/local.mk | 1 - gnu/packages/cross-base.scm | 17 +++- gnu/packages/firmware.scm | 88 +++++++++---------- .../patches/ath9k-htc-firmware-objcopy.patch | 14 --- gnu/system.scm | 3 +- guix/build/cmake-build-system.scm | 10 ++- guix/platforms/xtensa.scm | 28 ++++++ 9 files changed, 105 insertions(+), 69 deletions(-) delete mode 100644 gnu/packages/patches/ath9k-htc-firmware-objcopy.patch create mode 100644 guix/platforms/xtensa.scm base-commit: 75bad75367fcf2c289fae3b40dbcc850f92177be -- 2.41.0
guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:02 GMT) Full text and rfc822 format available.Message #8 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 1/8] doc: Add documentation for x86_64-linux-gnux32. Date: Thu, 29 Feb 2024 16:20:43 +0100
* doc/guix.texi: Add documentation for x86_64-linux-gnux32. Change-Id: I408d57ae5ae3e9b1449633b82c41aba0d40ded06 --- doc/guix.texi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index f6476e0d81..7153c9e7a4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16963,6 +16963,7 @@ Cross-Compilation - powerpc64le-linux-gnu - riscv64-linux-gnu - x86_64-linux-gnu + - x86_64-linux-gnux32 - x86_64-w64-mingw32 @end example @@ -46732,6 +46733,11 @@ Supported Platforms Platform targeting x86 64-bit CPU running GNU/Linux. @end defvar +@defvar x86_64-linux-x32 +Platform targeting x86 64-bit CPU running GNU/Linux with the run-time using +the X32 ABI. +@end defvar + @defvar i686-mingw Platform targeting x86 CPU running Windows, with run-time support from MinGW. -- 2.41.0
guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, rekado <at> elephly.net, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:02 GMT) Full text and rfc822 format available.Message #11 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 2/8] guix: Add xtensa-ath9k-elf platform. Date: Thu, 29 Feb 2024 16:20:44 +0100
* Makefile.am (MODULES): Add guix/platforms/xtensa.scm. * guix/platforms/xtensa.scm (xtensa-ath9k-elf): New variable. * doc/guix.texi: Add xtensa-ath9k-elf documentation. Change-Id: I51eef245142ed58613340c16d4bf7266e6bf6adb --- Makefile.am | 1 + doc/guix.texi | 6 ++++++ guix/platforms/xtensa.scm | 28 ++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 guix/platforms/xtensa.scm diff --git a/Makefile.am b/Makefile.am index cef972880c..df62c4e255 100644 --- a/Makefile.am +++ b/Makefile.am @@ -144,6 +144,7 @@ MODULES = \ guix/platforms/powerpc.scm \ guix/platforms/riscv.scm \ guix/platforms/x86.scm \ + guix/platforms/xtensa.scm \ guix/build-system.scm \ guix/build-system/agda.scm \ guix/build-system/android-ndk.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 7153c9e7a4..d3db1ee03d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16965,6 +16965,7 @@ Cross-Compilation - x86_64-linux-gnu - x86_64-linux-gnux32 - x86_64-w64-mingw32 + - xtensa-ath9k-elf @end example Targets are specified as GNU triplets (@pxref{Specifying Target @@ -46763,6 +46764,11 @@ Supported Platforms C standard library. @end defvar +@defvar xtensa-ath9k-elf +Platform targeting Xtensa CPU used in the Qualcomm Atheros AR7010 and AR9271 +USB 802.11n @acronym{NICs, Network Interface Controllers}. +@end defvar + @node System Images @chapter Creating System Images diff --git a/guix/platforms/xtensa.scm b/guix/platforms/xtensa.scm new file mode 100644 index 0000000000..304e23ab1a --- /dev/null +++ b/guix/platforms/xtensa.scm @@ -0,0 +1,28 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Foundation Devices, Inc. <hello <at> foundationdevices.com> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix platforms xtensa) + #:use-module (guix platform) + #:use-module (guix records) + #:export (xtensa-ath9k-elf)) + +(define xtensa-ath9k-elf + (platform + (target "xtensa-ath9k-elf") + (system #f) + (glibc-dynamic-linker #f))) -- 2.41.0
efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:03 GMT) Full text and rfc822 format available.Message #14 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 3/8] gnu: ath9k-htc-firmware: Remove binary blobs. Date: Thu, 29 Feb 2024 16:20:45 +0100
* gnu/packages/firmware.scm (ath9k-htc-firmware) <source>: Add snippet to remove bundled binary files. Change-Id: I2f0592d03039ff9d5a5f3a79b0c62566164f3762 --- gnu/packages/firmware.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 828bc7402a..a9f218eb9f 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -99,6 +99,10 @@ (define-public ath9k-htc-firmware (uri (git-reference (url "https://github.com/qca/open-ath9k-htc-firmware") (commit version))) + (modules '((guix build utils))) + (snippet + ;; Delete binary blobs. + #~(for-each delete-file (find-files "." "\\.(a|o)$"))) (sha256 (base32 "16jbj8avg5jkgvq5lxm0hdxxn4c3zn7fx8b4nxllvr024apk9w23")) -- 2.41.0
efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:03 GMT) Full text and rfc822 format available.Message #17 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 4/8] gnu: ath9k-htc-firmware: Allow using other targets. Date: Thu, 29 Feb 2024 16:20:46 +0100
* gnu/packages/firmware.scm (ath9k-htc-firmware): Override the TARGET environment variable in the configure script to use xtensa-elf. * gnu/packages/patches/ath9k-htc-firmware-objcopy.patch: Adapt to use TARGET environment variable for objcopy. Change-Id: Ia44f0f25dde532b90168f2f2456412a43ac9af24 --- gnu/packages/firmware.scm | 1 + gnu/packages/patches/ath9k-htc-firmware-objcopy.patch | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index a9f218eb9f..da7835a95d 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -121,6 +121,7 @@ (define-public ath9k-htc-firmware ;; 'configure' is a simple script that runs 'cmake' with ;; the right flags. (substitute* "configure" + (("^TARGET.*$") "TARGET=xtensa-elf\n") (("^TOOLCHAIN=.*$") (string-append "TOOLCHAIN=" (assoc-ref (or native-inputs inputs) "cross-gcc") diff --git a/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch b/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch index 2172f8353f..13c3ca1413 100644 --- a/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch +++ b/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch @@ -1,5 +1,5 @@ The firmware is cross-compiled, but the build system ends up using -'objcopy' instead of 'xtensa-elf-objcopy' by default. Force it to +'objcopy' instead of '$TARGET-objcopy' by default. Force it to use the right one. --- source/target_firmware/configure 2014-10-28 20:57:26.834436561 +0100 @@ -8,7 +8,7 @@ use the right one. cat > "$TOOLCHAIN_FILE" <<EOF INCLUDE(CMakeForceCompiler) -+SET(CMAKE_OBJCOPY xtensa-elf-objcopy) ++SET(CMAKE_OBJCOPY ${TARGET}-objcopy) SET(CMAKE_SYSTEM_PROCESSOR xtensa) SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN}/$TARGET) SET(CMAKE_STRIP :) -- 2.41.0
efraim <at> flashner.co.il, ludo <at> gnu.org, vagrant <at> debian.org, guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:03 GMT) Full text and rfc822 format available.Message #20 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 5/8] gnu: ath9k-htc-firmware: Use xtensa-ath9k-elf. Date: Thu, 29 Feb 2024 16:20:47 +0100
* gnu/packages/firmware.scm (ath9k-htc-firmware): Use the xtensa-ath9k-elf target for the cross toolchain. Change-Id: Ic1a7c4088312290a86a508f371f4f0e784e301a5 --- gnu/packages/cross-base.scm | 4 ++-- gnu/packages/firmware.scm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 2d79e0acf6..93383089e5 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -118,8 +118,8 @@ (define* (cross-binutils* target #:key (binutils binutils)) ;; target libs, not native libs, so this is safe. `(cons "--with-sysroot=/" ,flags))))))) - ;; For Xtensa, apply Qualcomm's patch. - (cross (cond ((string-prefix? "xtensa-" target) + ;; For xtensa-ath9k-elf, apply Qualcomm's patch. + (cross (cond ((string=? target "xtensa-ath9k-elf") (package-with-patches binutils (search-patches "ath9k-htc-firmware-binutils.patch"))) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index da7835a95d..6993925387 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -121,7 +121,7 @@ (define-public ath9k-htc-firmware ;; 'configure' is a simple script that runs 'cmake' with ;; the right flags. (substitute* "configure" - (("^TARGET.*$") "TARGET=xtensa-elf\n") + (("^TARGET.*$") "TARGET=xtensa-ath9k-elf\n") (("^TOOLCHAIN=.*$") (string-append "TOOLCHAIN=" (assoc-ref (or native-inputs inputs) "cross-gcc") @@ -140,12 +140,12 @@ (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-elf" + "xtensa-ath9k-elf" #:xbinutils (cross-binutils - "xtensa-elf" + "xtensa-ath9k-elf" #:binutils binutils-2.33))) ("cross-binutils" ,(cross-binutils - "xtensa-elf" + "xtensa-ath9k-elf" #:binutils binutils-2.33)) ("cmake" ,cmake-minimal) ("perl" ,perl))) -- 2.41.0
efraim <at> flashner.co.il, ludo <at> gnu.org, vagrant <at> debian.org, guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:04 GMT) Full text and rfc822 format available.Message #23 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 6/8] gnu: cross-binutils: Use binutils-2.33 for ath9k. Date: Thu, 29 Feb 2024 16:20:48 +0100
* 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 --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 <at> 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") -- 2.41.0
guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:04 GMT) Full text and rfc822 format available.Message #26 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 7/8] guix: cmake-build-system: Handle unknown systems. Date: Thu, 29 Feb 2024 16:20:49 +0100
* guix/build/cmake-build-system.scm (configure): Use Generic as the system name if the system is unknown. Change-Id: Ifd4a618ef67eb420b02d48f05291571aea44e46e --- guix/build/cmake-build-system.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index d1ff5071be..0774124c95 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -69,9 +69,13 @@ (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) target "-gcc") (string-append "-DCMAKE_CXX_COMPILER=" target "-g++") - (if (string-contains target "mingw") - "-DCMAKE_SYSTEM_NAME=Windows" - "-DCMAKE_SYSTEM_NAME=Linux")) + (cond + ((string-contains target "mingw") + "-DCMAKE_SYSTEM_NAME=Windows") + ((string-contains target "linux") + "-DCMAKE_SYSTEM_NAME=Linux") + (else + "-DCMAKE_SYSTEM_NAME=Generic"))) '()) ,@configure-flags))) (format #t "running 'cmake' with arguments ~s~%" args) -- 2.41.0
efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Thu, 29 Feb 2024 15:23:05 GMT) Full text and rfc822 format available.Message #29 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> To: 69476 <at> debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: [PATCH 8/8] gnu: ath9k-htc-firmware: Split package. Date: Thu, 29 Feb 2024 16:20:50 +0100
* gnu/local.mk (dist_patch_DATA): Remove ath9k-htc-firmware-objcopy.patch. * gnu/packages/firmware.scm (ath9k-htc-firmware): Remove variable. * gnu/packages/firmware.scm (ath9k-htc-ar7010-firmware): New variable. * gnu/packages/firmware.scm (ath9k-htc-ar9271-firmware): New variable. * gnu/packages/patches/ath9k-htc-firmware-objcopy.patch: Delete file. * gnu/system.scm (%base-firmware): Use new ath9k packages. Change-Id: I86259e398427abd139c1f310a95bb15e2c03cee3 --- gnu/local.mk | 1 - gnu/packages/firmware.scm | 79 +++++++++---------- .../patches/ath9k-htc-firmware-objcopy.patch | 14 ---- gnu/system.scm | 3 +- 4 files changed, 39 insertions(+), 58 deletions(-) delete mode 100644 gnu/packages/patches/ath9k-htc-firmware-objcopy.patch diff --git a/gnu/local.mk b/gnu/local.mk index 725093fb09..70d2e99481 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -941,7 +941,6 @@ dist_patch_DATA = \ %D%/packages/patches/ath9k-htc-firmware-binutils.patch \ %D%/packages/patches/ath9k-htc-firmware-gcc.patch \ %D%/packages/patches/ath9k-htc-firmware-gcc-compat.patch \ - %D%/packages/patches/ath9k-htc-firmware-objcopy.patch \ %D%/packages/patches/atlas-gfortran-compat.patch \ %D%/packages/patches/audacity-ffmpeg-fallback.patch \ %D%/packages/patches/audiofile-fix-datatypes-in-tests.patch \ diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index ad687d1de6..47d4c08b0d 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -37,6 +37,7 @@ (define-module (gnu packages firmware) #:use-module (guix utils) #:use-module (guix git-download) #:use-module (guix build-system copy) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system meson) #:use-module (guix build-system python) @@ -90,9 +91,9 @@ (define-module (gnu packages firmware) #:export (make-ergodox-firmware make-qmk-firmware)) -(define-public ath9k-htc-firmware +(define-public ath9k-htc-ar7010-firmware (package - (name "ath9k-htc-firmware") + (name "ath9k-htc-ar7010-firmware") (version "1.4.0") (source (origin (method git-fetch) @@ -106,51 +107,45 @@ (define-public ath9k-htc-firmware (sha256 (base32 "16jbj8avg5jkgvq5lxm0hdxxn4c3zn7fx8b4nxllvr024apk9w23")) - (file-name (git-file-name name version)) - (patches (search-patches "ath9k-htc-firmware-objcopy.patch" - "ath9k-htc-firmware-gcc-compat.patch")))) - (build-system gnu-build-system) + (file-name (git-file-name "open-ath9k-htc-firmware" version)) + (patches (search-patches "ath9k-htc-firmware-gcc-compat.patch")))) + (build-system cmake-build-system) (arguments - '(#:target #f ; Package produces firmware. - #:phases - (modify-phases %standard-phases - (add-before 'configure 'pre-configure - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (chdir "target_firmware") - - ;; 'configure' is a simple script that runs 'cmake' with - ;; the right flags. - (substitute* "configure" - (("^TARGET.*$") "TARGET=xtensa-ath9k-elf\n") - (("^TOOLCHAIN=.*$") - (string-append "TOOLCHAIN=" - (assoc-ref (or native-inputs inputs) "cross-gcc") - "\n"))) - #t)) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (fw-dir (string-append out "/lib/firmware"))) - (for-each (lambda (file) - (install-file file fw-dir)) - (find-files "." "\\.fw$")) - #t)))) - #:tests? #f)) - - ;; 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")) - ("cross-binutils" ,(cross-binutils "xtensa-ath9k-elf")) - ("cmake" ,cmake-minimal) - ("perl" ,perl))) + (list #:target "xtensa-ath9k-elf" + #:tests? #f + #:configure-flags #~'("-DTARGET_MAGPIE=ON") + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'change-directory + (lambda _ + (chdir "target_firmware"))) + (replace 'install + (lambda _ + (let ((fw-dir (string-append #$output "/lib/firmware"))) + (for-each (lambda (file) + (install-file file fw-dir)) + (find-files "." "\\.fw$")))))))) + (native-inputs (list perl)) (home-page "https://wireless.wiki.kernel.org/en/users/Drivers/ath9k_htc") - (synopsis "Firmware for the Atheros AR7010 and AR9271 USB 802.11n NICs") + (synopsis "Firmware for the Atheros AR7010 USB 802.11n NICs") (description - "This is the firmware for the Qualcomm Atheros AR7010 and AR9271 USB -802.11n NICs (aka Wi-Fi USB dongles). It is used by the ath9k driver of -Linux-libre.") + "This is the firmware for the Qualcomm Atheros AR7010 802.11n USB NICs +(aka Wi-Fi USB dongle). It is used by the ath9k driver of Linux-libre.") (license (license:non-copyleft "http://directory.fsf.org/wiki/License:ClearBSD")))) +(define-public ath9k-htc-ar9271-firmware + (package + (inherit ath9k-htc-ar7010-firmware) + (name "ath9k-htc-ar9271-firmware") + (arguments + (substitute-keyword-arguments + (package-arguments ath9k-htc-ar7010-firmware) + ((#:configure-flags flags) #~'("-DTARGET_K2=ON")))) + (synopsis "Firmware for the Atheros AR9271 USB 802.11n NICs") + (description + "This is the firmware for the Qualcomm Atheros AR9271 802.11n USB NICs +(aka Wi-Fi USB dongle). It is used by the ath9k driver of Linux-libre."))) + (define-public b43-tools (let ((commit "27892ef741e7f1d08cb939744f8b8f5dac7b04ae") (revision "1")) diff --git a/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch b/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch deleted file mode 100644 index 13c3ca1413..0000000000 --- a/gnu/packages/patches/ath9k-htc-firmware-objcopy.patch +++ /dev/null @@ -1,14 +0,0 @@ -The firmware is cross-compiled, but the build system ends up using -'objcopy' instead of '$TARGET-objcopy' by default. Force it to -use the right one. - ---- source/target_firmware/configure 2014-10-28 20:57:26.834436561 +0100 -+++ source/target_firmware/configure 2014-10-28 20:57:29.666436530 +0100 -@@ -11,6 +11,7 @@ mkdir -p build - cat > "$TOOLCHAIN_FILE" <<EOF - INCLUDE(CMakeForceCompiler) - -+SET(CMAKE_OBJCOPY ${TARGET}-objcopy) - SET(CMAKE_SYSTEM_PROCESSOR xtensa) - SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN}/$TARGET) - SET(CMAKE_STRIP :) diff --git a/gnu/system.scm b/gnu/system.scm index aede35775e..927abc642c 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -876,7 +876,8 @@ (define* (operating-system-with-provenance os (define %base-firmware ;; Firmware usable by default. - (list ath9k-htc-firmware + (list ath9k-htc-ar7010-firmware + ath9k-htc-ar9271-firmware openfwwf-firmware)) (define %base-packages-artwork -- 2.41.0
guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Tue, 26 Mar 2024 14:37:01 GMT) Full text and rfc822 format available.Message #32 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Vagrant Cascadian <vagrant <at> debian.org> To: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com>, 69476 <at> debbugs.gnu.org Cc: Efraim Flashner <efraim <at> flashner.co.il> Subject: Re: [bug#69476] [PATCH 0/8] guix: Add xtensa-ath9k-elf platform. Date: Mon, 25 Mar 2024 23:17:53 -0700
[Message part 1 (text/plain, inline)]
On 2024-02-29, Jean-Pierre De Jesus DIAZ wrote: > As the ath9k-htc-firmware package requires a custom toolchain to build > the firmware I thought it was best to have a target for this specific > package as it modifies the default configuration of the Xtensa target in > GCC. > > To work around this a new target is added: xtensa-ath9k-elf. > > It uses binutils <at> 2.33 and the patched version of GCC to properly compile > the firmware. So, as a result it allows using #:target keyword parameter > to cross-compile the firmware and avoids explicitly adding the cross > compiler in the NATIVE-INPUTS field. I am not in a position to evaluate the correctness of the proposed toolchain changes, but conceptually it makes sense. > As a result the ath9k-htc-firmware package was splitted into two and > uses the cmake-build-sytem now to use Guix's cross-compilation support > properly, so it removes the need for the ath9k-htc-firmware-objcopy.patch. This makes sense to me too. > The [PATCH 7/8] contains a patch that was already sent to: > > https://issues.guix.gnu.org/68366 Ok, one of these two patch series will need to be refactored depending on which gets applied first. > I don't have the hardware to test this firmware but the build produces > the same hashes for the firmware so it's safe to say that the firmware > should keep working. I do have some of the hardware to test, though have not had a chance to test the patches... will try to get on that. Obviously producing identical hashes is quite compelling; this is an excellent example of applying Reproducible Builds to refactoring code! > The hashes with this patch series: > > a5481cc67d962b217de1300121a6c7584e847cbe215442553d24a2173ca9202e /gnu/store/0i3zw28pvrr8l85fx79i8lq0f9vmgyjz-ath9k-htc-ar9271-firmware-1.4.0/lib/firmware/htc_9271.fw > eef84c16e3edad3fdec19c985d190b5ed3f5bd5bae20be5579681ab35f001406 /gnu/store/iqbd77grzy4sngkxz9lgyvk52apn8vzj-ath9k-htc-ar7010-firmware-1.4.0/lib/firmware/htc_7010.fw > > And the hashes in master at commit 75bad75367fcf2c289fae3b40dbcc850f92177be: > > a5481cc67d962b217de1300121a6c7584e847cbe215442553d24a2173ca9202e /gnu/store/0m45gn74b5bavxq77158i3l593lh082r-ath9k-htc-firmware-1.4.0/lib/firmware/htc_9271.fw > eef84c16e3edad3fdec19c985d190b5ed3f5bd5bae20be5579681ab35f001406 /gnu/store/0m45gn74b5bavxq77158i3l593lh082r-ath9k-htc-firmware-1.4.0/lib/firmware/htc_7010.fw Yay! live well, vagrant
[signature.asc (application/pgp-signature, inline)]
Ludovic Courtès <ludo <at> gnu.org>
:Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com>
:Message #37 received at 69476-done <at> debbugs.gnu.org (full text, mbox):
From: Ludovic Courtès <ludo <at> gnu.org> To: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Cc: Vagrant Cascadian <vagrant <at> debian.org>, 69476-done <at> debbugs.gnu.org, Efraim Flashner <efraim <at> flashner.co.il> Subject: Re: [bug#69476] [PATCH 0/8] guix: Add xtensa-ath9k-elf platform. Date: Wed, 17 Apr 2024 11:22:12 +0200
Hi Jean-Pierre, Looks like this patch series had fallen through the cracks. Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> skribis: > As the ath9k-htc-firmware package requires a custom toolchain to build > the firmware I thought it was best to have a target for this specific > package as it modifies the default configuration of the Xtensa target in > GCC. > > To work around this a new target is added: xtensa-ath9k-elf. > > It uses binutils <at> 2.33 and the patched version of GCC to properly compile > the firmware. So, as a result it allows using #:target keyword parameter > to cross-compile the firmware and avoids explicitly adding the cross > compiler in the NATIVE-INPUTS field. > > As a result the ath9k-htc-firmware package was splitted into two and > uses the cmake-build-sytem now to use Guix's cross-compilation support > properly, so it removes the need for the ath9k-htc-firmware-objcopy.patch. > > The [PATCH 7/8] contains a patch that was already sent to: > > https://issues.guix.gnu.org/68366 Neat. > I don't have the hardware to test this firmware but the build produces > the same hashes for the firmware so it's safe to say that the firmware > should keep working. > > The hashes with this patch series: > > a5481cc67d962b217de1300121a6c7584e847cbe215442553d24a2173ca9202e /gnu/store/0i3zw28pvrr8l85fx79i8lq0f9vmgyjz-ath9k-htc-ar9271-firmware-1.4.0/lib/firmware/htc_9271.fw > eef84c16e3edad3fdec19c985d190b5ed3f5bd5bae20be5579681ab35f001406 /gnu/store/iqbd77grzy4sngkxz9lgyvk52apn8vzj-ath9k-htc-ar7010-firmware-1.4.0/lib/firmware/htc_7010.fw > > And the hashes in master at commit 75bad75367fcf2c289fae3b40dbcc850f92177be: > > a5481cc67d962b217de1300121a6c7584e847cbe215442553d24a2173ca9202e /gnu/store/0m45gn74b5bavxq77158i3l593lh082r-ath9k-htc-firmware-1.4.0/lib/firmware/htc_9271.fw > eef84c16e3edad3fdec19c985d190b5ed3f5bd5bae20be5579681ab35f001406 /gnu/store/0m45gn74b5bavxq77158i3l593lh082r-ath9k-htc-firmware-1.4.0/lib/firmware/htc_7010.fw Excellent; thanks for taking the time to check this! (FWIW I use a WiFi dongle that relies on this firmware so you’ll soon hear from me if something goes wrong. ;-)) > doc: Add documentation for x86_64-linux-gnux32. > guix: Add xtensa-ath9k-elf platform. > gnu: ath9k-htc-firmware: Remove binary blobs. > gnu: ath9k-htc-firmware: Allow using other targets. > gnu: ath9k-htc-firmware: Use xtensa-ath9k-elf. > gnu: cross-binutils: Use binutils-2.33 for ath9k. > guix: cmake-build-system: Handle unknown systems. > gnu: ath9k-htc-firmware: Split package. Applied, thanks! Ludo’.
guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Wed, 17 Apr 2024 09:55:13 GMT) Full text and rfc822 format available.Message #40 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Ludovic Courtès <ludo <at> gnu.org> To: Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Cc: 69476 <at> debbugs.gnu.org Subject: Re: [bug#69476] [PATCH 7/8] guix: cmake-build-system: Handle unknown systems. Date: Wed, 17 Apr 2024 11:54:03 +0200
[Message part 1 (text/plain, inline)]
Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> skribis: > * guix/build/cmake-build-system.scm (configure): Use Generic as the > system name if the system is unknown. > > Change-Id: Ifd4a618ef67eb420b02d48f05291571aea44e46e > --- > guix/build/cmake-build-system.scm | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm > index d1ff5071be..0774124c95 100644 > --- a/guix/build/cmake-build-system.scm > +++ b/guix/build/cmake-build-system.scm > @@ -69,9 +69,13 @@ (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) > target "-gcc") > (string-append "-DCMAKE_CXX_COMPILER=" > target "-g++") > - (if (string-contains target "mingw") > - "-DCMAKE_SYSTEM_NAME=Windows" > - "-DCMAKE_SYSTEM_NAME=Linux")) > + (cond > + ((string-contains target "mingw") > + "-DCMAKE_SYSTEM_NAME=Windows") > + ((string-contains target "linux") > + "-DCMAKE_SYSTEM_NAME=Linux") > + (else > + "-DCMAKE_SYSTEM_NAME=Generic"))) I spoke too fast. This patch is good but it triggers a rebuild of everything that depends on CMake. So for now, I instead amended the last patch of the series like this:
[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 373ed0e81f..6f0c2da806 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -113,7 +113,9 @@ (define-public ath9k-htc-ar7010-firmware (arguments (list #:target "xtensa-ath9k-elf" #:tests? #f - #:configure-flags #~'("-DTARGET_MAGPIE=ON") + #:configure-flags + #~'("-DCMAKE_SYSTEM_NAME=Generic" ;override default value + "-DTARGET_MAGPIE=ON") #:phases #~(modify-phases %standard-phases (add-before 'configure 'change-directory @@ -140,7 +142,9 @@ (define-public ath9k-htc-ar9271-firmware (arguments (substitute-keyword-arguments (package-arguments ath9k-htc-ar7010-firmware) - ((#:configure-flags flags) #~'("-DTARGET_K2=ON")))) + ((#:configure-flags flags) + #~'("-DCMAKE_SYSTEM_NAME=Generic" ;override default value + "-DTARGET_K2=ON")))) (synopsis "Firmware for the Atheros AR9271 USB 802.11n NICs") (description "This is the firmware for the Qualcomm Atheros AR9271 802.11n USB NICs
[Message part 3 (text/plain, inline)]
I confirmed that this builds and that I get the same hashes. That said, we should arrange to land the ‘cmake-build-system.scm’ patch either on the next ‘core-updates’ branch or on a topic branch. Thoughts? Thanks, Ludo’.
guix-patches <at> gnu.org
:bug#69476
; Package guix-patches
.
(Wed, 17 Apr 2024 14:02:01 GMT) Full text and rfc822 format available.Message #43 received at 69476 <at> debbugs.gnu.org (full text, mbox):
From: Jean-Pierre De Jesus Diaz <jean <at> foundation.xyz> To: Ludovic Courtès <ludo <at> gnu.org> Cc: 69476 <at> debbugs.gnu.org, Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> Subject: Re: [bug#69476] [PATCH 7/8] guix: cmake-build-system: Handle unknown systems. Date: Wed, 17 Apr 2024 14:00:55 +0000
>That said, we should arrange to land the ‘cmake-build-system.scm’ patch >either on the next ‘core-updates’ branch or on a topic branch. > >Thoughts? I think it'd appropiate for it to be on core-updates or a topic branch, the most convenient for you and then the rest of the patches can be applied IMO. Thanks for applying some of the patches. P.S.: The patch for CMake was also sent to <https://issues.guix.gnu.org/68366> before working on this issue as I discovered it while working on other targets. On Wed, Apr 17, 2024 at 9:54 AM Ludovic Courtès <ludo <at> gnu.org> wrote: > > Jean-Pierre De Jesus DIAZ <jean <at> foundationdevices.com> skribis: > > > * guix/build/cmake-build-system.scm (configure): Use Generic as the > > system name if the system is unknown. > > > > Change-Id: Ifd4a618ef67eb420b02d48f05291571aea44e46e > > --- > > guix/build/cmake-build-system.scm | 10 +++++++--- > > 1 file changed, 7 insertions(+), 3 deletions(-) > > > > diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm > > index d1ff5071be..0774124c95 100644 > > --- a/guix/build/cmake-build-system.scm > > +++ b/guix/build/cmake-build-system.scm > > @@ -69,9 +69,13 @@ (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t) > > target "-gcc") > > (string-append "-DCMAKE_CXX_COMPILER=" > > target "-g++") > > - (if (string-contains target "mingw") > > - "-DCMAKE_SYSTEM_NAME=Windows" > > - "-DCMAKE_SYSTEM_NAME=Linux")) > > + (cond > > + ((string-contains target "mingw") > > + "-DCMAKE_SYSTEM_NAME=Windows") > > + ((string-contains target "linux") > > + "-DCMAKE_SYSTEM_NAME=Linux") > > + (else > > + "-DCMAKE_SYSTEM_NAME=Generic"))) > > I spoke too fast. > > This patch is good but it triggers a rebuild of everything that depends > on CMake. > > So for now, I instead amended the last patch of the series like this: > > > I confirmed that this builds and that I get the same hashes. > > That said, we should arrange to land the ‘cmake-build-system.scm’ patch > either on the next ‘core-updates’ branch or on a topic branch. > > Thoughts? > > Thanks, > Ludo’.
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Thu, 16 May 2024 11:24:16 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.