1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages firmware)
20 #:use-module (guix licenses)
21 #:use-module (guix packages)
22 #:use-module (guix git-download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages cmake)
26 #:use-module (gnu packages cross-base)
27 #:use-module (gnu packages perl))
29 (define-public ath9k-htc-firmware
31 (name "ath9k-htc-firmware")
36 (url "https://github.com/qca/open-ath9k-htc-firmware.git")
40 "16jbj8avg5jkgvq5lxm0hdxxn4c3zn7fx8b4nxllvr024apk9w23"))
41 (file-name (string-append name "-" version "-checkout"))
42 (patches (list (search-patch "ath9k-htc-firmware-objcopy.patch")))))
43 (build-system gnu-build-system)
45 '(#:phases (alist-cons-before
46 'configure 'pre-configure
47 (lambda* (#:key inputs #:allow-other-keys)
48 (chdir "target_firmware")
50 ;; 'configure' is a simple script that runs 'cmake' with
52 (substitute* "configure"
54 (string-append "TOOLCHAIN="
55 (assoc-ref inputs "cross-gcc")
59 (lambda* (#:key outputs #:allow-other-keys)
60 (let* ((out (assoc-ref outputs "out"))
61 (fw-dir (string-append out "/lib/firmware")))
63 (for-each (lambda (file)
65 (string-append fw-dir "/"
67 (find-files "." "\\.fw$"))
72 ;; The firmware is cross-compiled using a "bare bones" compiler (no libc.)
73 ;; Use our own tool chain for that.
74 (native-inputs `(("cross-gcc" ,xgcc-xtensa)
75 ("cross-binutils" ,(cross-binutils "xtensa-elf"))
78 (home-page "http://wireless.kernel.org/en/users/Drivers/ath9k_htc")
79 (synopsis "Firmware for the Atheros AR7010 and AR9271 USB 802.11n NICs")
81 "This is the firmware for the Qualcomm Atheros AR7010 and AR9271 USB
82 802.11n NICs (aka Wi-Fi USB dongles). It is used by the ath9k driver of
84 (license (non-copyleft "http://directory.fsf.org/wiki/License:ClearBSD"))))