[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#36477] [PATCH v4 16/23] gnu: crda: Fix cross-compilation
From: |
Mathieu Othacehe |
Subject: |
[bug#36477] [PATCH v4 16/23] gnu: crda: Fix cross-compilation |
Date: |
Wed, 2 Oct 2019 11:58:57 +0200 |
From: Pierre-Moana Levesque <address@hidden>
* 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 8ba3c7d9db..177c8f44ed 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2810,13 +2810,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 _
@@ -2826,37 +2836,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)))
--
2.23.0
- [bug#36477] [PATCH v4 02/23] gnu: cmake: Fix cross-compilation., (continued)
- [bug#36477] [PATCH v4 02/23] gnu: cmake: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 03/23] gnu: groff: Fix cross compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 04/23] gnu: cyrus-sasl: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 07/23] gnu: eudev: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 05/23] gnu: icu4c: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 08/23] gnu: bdb: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 06/23] gnu: boost: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 11/23] gnu: git: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 10/23] gnu: swig: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 09/23] gnu: openldap: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 16/23] gnu: crda: Fix cross-compilation,
Mathieu Othacehe <=
- [bug#36477] [PATCH v4 13/23] gnu: guile-gcrypt: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 18/23] gexp: Use cross extensions when cross-compiling., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 17/23] gnu: cmake: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 14/23] gnu: guile-sqlite3: Fix cross-compilation., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 19/23] utils: Use target-aarch64? and target-arm? helpers., Mathieu Othacehe, 2019/10/02
- [bug#36477] [PATCH v4 12/23] gnu: doxygen: Fix cross-compilation., Mathieu Othacehe, 2019/10/02