nongnu: broadcom-sta: Support 32-bit systems.

* nongnu/packages/linux.scm (broadcom-sta-version, broadcom-sta-x86_64-source,
broadcom-sta-i686-source): New variables.
(broadcom-sta): Move source to native-inputs and choose source by arch.
This commit is contained in:
Alex Griffin 2020-01-03 13:18:41 -06:00
parent 5a3c4d8dde
commit 59280e891b

View file

@ -27,6 +27,7 @@
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build-system linux-module) #:use-module (guix build-system linux-module)
#:use-module (guix build-system trivial) #:use-module (guix build-system trivial)
#:use-module (ice-9 match)
#:use-module (nonguix licenses)) #:use-module (nonguix licenses))
(define (linux-urls version) (define (linux-urls version)
@ -224,16 +225,14 @@ support for 5GHz and 802.11ac, among others.")
"https://git.kernel.org/pub/scm/linux/kernel/git/firmware" "https://git.kernel.org/pub/scm/linux/kernel/git/firmware"
"/linux-firmware.git/plain/LICENCE.iwlwifi_firmware"))))) "/linux-firmware.git/plain/LICENCE.iwlwifi_firmware")))))
(define-public broadcom-sta (define broadcom-sta-version "6.30.223.271")
(package
(name "broadcom-sta") (define broadcom-sta-x86_64-source
(version "6.30.223.271")
(source
(origin (origin
(method url-fetch/tarbomb) (method url-fetch/tarbomb)
(uri (string-append "https://docs.broadcom.com/docs-and-downloads/" (uri (string-append "https://docs.broadcom.com/docs-and-downloads/"
"docs/linux_sta/hybrid-v35_64-nodebug-pcoem-" "docs/linux_sta/hybrid-v35_64-nodebug-pcoem-"
(string-replace-substring version "." "_") (string-replace-substring broadcom-sta-version "." "_")
".tar.gz")) ".tar.gz"))
(patches (patches
(parameterize (parameterize
@ -258,11 +257,41 @@ support for 5GHz and 802.11ac, among others.")
(sha256 (sha256
(base32 (base32
"1gj485qqr190idilacpxwgqyw21il03zph2rddizgj7fbd6pfyaz")))) "1gj485qqr190idilacpxwgqyw21il03zph2rddizgj7fbd6pfyaz"))))
(define broadcom-sta-i686-source
(origin
(inherit broadcom-sta-x86_64-source)
(uri (string-append "https://docs.broadcom.com/docs-and-downloads/"
"docs/linux_sta/hybrid-v35-nodebug-pcoem-"
(string-replace-substring broadcom-sta-version "." "_")
".tar.gz"))
(sha256
(base32
"1kaqa2dw3nb8k23ffvx46g8jj3wdhz8xa6jp1v3wb35cjfr712sg"))))
(define-public broadcom-sta
(package
(name "broadcom-sta")
(version broadcom-sta-version)
(source #f)
(build-system linux-module-build-system) (build-system linux-module-build-system)
(arguments (arguments
`(#:linux ,linux `(#:linux ,linux
#:tests? #f)) #:tests? #f
(supported-systems '("x86_64-linux")) #:phases
(modify-phases %standard-phases
(replace 'unpack
(lambda* (#:key inputs #:allow-other-keys)
(let ((source (assoc-ref inputs "broadcom-sta-source")))
(invoke "tar" "xf" source)
(chdir ((@@ (guix build gnu-build-system) first-subdirectory) "."))
#t))))))
(supported-systems '("i686-linux" "x86_64-linux"))
(native-inputs
`(("broadcom-sta-source"
,(match (or (%current-target-system) (%current-system))
("x86_64-linux" broadcom-sta-x86_64-source)
(_ broadcom-sta-i686-source)))))
(home-page "https://www.broadcom.com/support/802.11") (home-page "https://www.broadcom.com/support/802.11")
(synopsis "Broadcom 802.11 Linux STA wireless driver") (synopsis "Broadcom 802.11 Linux STA wireless driver")
(description "This package contains Broadcom's IEEE 802.11a/b/g/n/ac hybrid (description "This package contains Broadcom's IEEE 802.11a/b/g/n/ac hybrid