[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
16/22: gnu: crda: Fix cross-compilation
From: |
guix-commits |
Subject: |
16/22: gnu: crda: Fix cross-compilation |
Date: |
Fri, 15 Nov 2019 11:32:46 -0500 (EST) |
mothacehe pushed a commit to branch core-updates
in repository guix.
commit 3403a4201057a9f7b02d332029d0c4f2ba158376
Author: Pierre-Moana Levesque <address@hidden>
Date: Wed Aug 14 09:40:21 2019 +0200
gnu: crda: Fix cross-compilation
* gnu/packages/linux.scm (crda)[arguments]: Patch Makefile to use cross
pkg-config when cross-compiling. Also search for wireless-regdb in both
native-inputs and inputs. Set CC variable to cross-compiler when
cross-compiling.
---
gnu/packages/linux.scm | 67 +++++++++++++++++++++++++++++++-------------------
1 file changed, 42 insertions(+), 25 deletions(-)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 911bd59..3950d86 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2854,13 +2854,23 @@ interface.")
(patches (search-patches "crda-optional-gcrypt.patch"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
+ `(#:phases (modify-phases %standard-phases
(delete 'configure)
(add-after 'unpack 'gzip-determinism
(lambda _
(substitute* "Makefile"
(("gzip") "gzip --no-name"))
#t))
+ ,@(if (%current-target-system)
+ '((add-after
+ 'unpack 'fix-pkg-config
+ (lambda* (#:key target #:allow-other-keys)
+ (substitute*
+ "Makefile"
+ (("pkg-config")
+ (string-append target "-pkg-config")))
+ #t)))
+ '())
(add-before
'build 'no-werror-no-ldconfig
(lambda _
@@ -2870,37 +2880,44 @@ interface.")
#t))
(add-before
'build 'set-regulator-db-file-name
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
;; Tell CRDA where to find our database.
- (let ((regdb (assoc-ref inputs "wireless-regdb")))
+ (let ((regdb (assoc-ref (or native-inputs inputs)
+ "wireless-regdb")))
(substitute* "crda.c"
(("\"/lib/crda/regulatory.bin\"")
(string-append "\"" regdb
"/lib/crda/regulatory.bin\"")))
#t))))
#:test-target "verify"
- #:make-flags (let ((out (assoc-ref %outputs "out"))
- (regdb (assoc-ref %build-inputs "wireless-regdb")))
- (list "CC=gcc" "V=1"
-
- ;; Disable signature-checking on 'regulatory.bin'.
- ;; The reason is that this simplifies maintenance
- ;; on our side (no need to manage a distro key
- ;; pair), and we can guarantee integrity of
- ;; 'regulatory.bin' by other means anyway, such as
- ;; 'guix gc --verify'. See
- ;;
<https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
- ;; for a discssion.
- "USE_OPENSSL=0"
-
- (string-append "PREFIX=" out)
- (string-append "SBINDIR=" out "/sbin/")
- (string-append "UDEV_RULE_DIR="
- out "/lib/udev/rules.d")
- (string-append "LDFLAGS=-Wl,-rpath="
- out "/lib -L.")
- (string-append "REG_BIN=" regdb
- "/lib/crda/regulatory.bin")))))
+ #:make-flags (let ((out (assoc-ref %outputs "out"))
+ (regdb (assoc-ref %build-inputs "wireless-regdb"))
+ (target ,(%current-target-system)))
+ (list
+ (string-append
+ "CC=" (if target
+ (string-append target "-gcc") "gcc"))
+ "V=1"
+
+ ;; Disable signature-checking on 'regulatory.bin'.
+ ;; The reason is that this simplifies maintenance
+ ;; on our side (no need to manage a distro key
+ ;; pair), and we can guarantee integrity of
+ ;; 'regulatory.bin' by other means anyway, such as
+ ;; 'guix gc --verify'. See
+ ;;
<https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
+ ;; for a discssion.
+ "USE_OPENSSL=0"
+
+ (string-append "PREFIX=" out)
+ (string-append "SBINDIR=" out "/sbin/")
+ (string-append "UDEV_RULE_DIR="
+ out "/lib/udev/rules.d")
+ (string-append "LDFLAGS=-Wl,-rpath="
+ out "/lib -L.")
+ (string-append "REG_BIN=" regdb
+ "/lib/crda/regulatory.bin")
+ "all_noverify"))))
(native-inputs `(("pkg-config" ,pkg-config)
("python" ,python-2)
("wireless-regdb" ,wireless-regdb)))
- 08/22: gnu: bdb: Fix cross-compilation., (continued)
- 08/22: gnu: bdb: Fix cross-compilation., guix-commits, 2019/11/15
- 07/22: gnu: eudev: Fix cross-compilation., guix-commits, 2019/11/15
- 18/22: utils: Use target-aarch64? and target-arm? helpers., guix-commits, 2019/11/15
- 15/22: gnu: libnl: Move python outputs to separate packages., guix-commits, 2019/11/15
- 09/22: gnu: openldap: Fix cross-compilation., guix-commits, 2019/11/15
- 19/22: build: vm: Fix arm32 support., guix-commits, 2019/11/15
- 21/22: system: vm: Support cross-compilation., guix-commits, 2019/11/15
- 20/22: system: vm: Add arm64 support., guix-commits, 2019/11/15
- 06/22: gnu: boost: Fix cross-compilation., guix-commits, 2019/11/15
- 22/22: scripts: system: Add --target option., guix-commits, 2019/11/15
- 16/22: gnu: crda: Fix cross-compilation,
guix-commits <=
- 03/22: gnu: groff: Fix cross compilation., guix-commits, 2019/11/15
- 14/22: gnu: guile-sqlite3: Fix cross-compilation., guix-commits, 2019/11/15