me
/
guix
Archived
1
0
Fork 0

gnu: crda: Use G-expressions.

* gnu/packages/linux.scm (crda)[arguments]:
Rewrite as G-expressions.
master
Tobias Geerinckx-Rice 2023-07-02 02:00:01 +02:00
parent 7629377556
commit 59da3b6892
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 51 additions and 51 deletions

View File

@ -4569,60 +4569,60 @@ interface.")
(patches (search-patches "crda-optional-gcrypt.patch")))) (patches (search-patches "crda-optional-gcrypt.patch"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases (modify-phases %standard-phases (list #:phases
(delete 'configure) #~(modify-phases %standard-phases
(add-after 'unpack 'gzip-determinism (delete 'configure)
(lambda _ (add-after 'unpack 'gzip-deterministically
(substitute* "Makefile" (lambda _
(("gzip") "gzip --no-name")))) (substitute* "Makefile"
,@(if (%current-target-system) (("gzip" command)
'((add-after (string-append command " --no-name")))))
'unpack 'fix-pkg-config #$@(if (%current-target-system)
(lambda* (#:key target #:allow-other-keys) #~((add-after 'unpack 'fix-pkg-config
(substitute* (lambda* (#:key target #:allow-other-keys)
"Makefile" (substitute* "Makefile"
(("pkg-config") (("pkg-config" command)
(string-append target "-pkg-config")))))) (string-append target "-" command))))))
'()) #~())
(add-before 'build 'patch-Makefile (add-before 'build 'patch-Makefile
(lambda _ (lambda _
(substitute* "Makefile" (substitute* "Makefile"
(("ldconfig") "true")))) (("ldconfig") "true"))))
(add-before 'build 'set-regulatory-db-file-name (add-before 'build 'set-regulatory-db-file-name
(lambda* (#:key native-inputs inputs #:allow-other-keys) (lambda* (#:key native-inputs inputs #:allow-other-keys)
;; Tell CRDA where to find our database. ;; Tell CRDA where to find our database.
(let ((regdb (assoc-ref (or native-inputs inputs) (let ((regdb (assoc-ref (or native-inputs inputs)
"wireless-regdb"))) "wireless-regdb")))
(substitute* "crda.c" (substitute* "crda.c"
(("\"/lib/crda/regulatory.bin\"") (("\"/lib/crda/regulatory.bin\"")
(string-append "\"" regdb (string-append "\"" regdb
"/lib/crda/regulatory.bin\""))))))) "/lib/crda/regulatory.bin\"")))))))
#:test-target "verify" #:test-target "verify"
#:make-flags (let ((out (assoc-ref %outputs "out")) #:make-flags
(regdb (assoc-ref %build-inputs "wireless-regdb"))) #~(list
(list (string-append "CC=" #$(cc-for-target))
(string-append "CC=" ,(cc-for-target)) "V=1"
"V=1"
;; Disable signature-checking on 'regulatory.bin'. ;; Disable signature-checking on 'regulatory.bin'.
;; The reason is that this simplifies maintenance ;; The reason is that this simplifies maintenance
;; on our side (no need to manage a distro key ;; on our side (no need to manage a distro key
;; pair), and we can guarantee integrity of ;; pair), and we can guarantee integrity of
;; 'regulatory.bin' by other means anyway, such as ;; 'regulatory.bin' by other means anyway, such as
;; 'guix gc --verify'. See ;; 'guix gc --verify'. See
;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb> ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
;; for a discssion. ;; for a discssion.
"USE_OPENSSL=0" "USE_OPENSSL=0"
(string-append "PREFIX=" out) (string-append "PREFIX=" #$output)
(string-append "SBINDIR=" out "/sbin/") (string-append "SBINDIR=" #$output "/sbin/")
(string-append "UDEV_RULE_DIR=" (string-append "UDEV_RULE_DIR="
out "/lib/udev/rules.d") #$output "/lib/udev/rules.d")
(string-append "LDFLAGS=-Wl,-rpath=" (string-append "LDFLAGS=-Wl,-rpath="
out "/lib -L.") #$output "/lib -L.")
(string-append "REG_BIN=" regdb (string-append "REG_BIN="
"/lib/crda/regulatory.bin") #$(this-package-native-input "wireless-regdb")
"all_noverify")))) "/lib/crda/regulatory.bin")
"all_noverify")))
(native-inputs (list pkg-config wireless-regdb)) (native-inputs (list pkg-config wireless-regdb))
(inputs (list libnl)) (inputs (list libnl))
(home-page (home-page