[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
47/61: gnu: crda: Fix cross-compilation
From: |
guix-commits |
Subject: |
47/61: gnu: crda: Fix cross-compilation |
Date: |
Wed, 21 Aug 2019 04:24:56 -0400 (EDT) |
mothacehe pushed a commit to branch wip-cross-system
in repository guix.
commit ffba54a2b0d4136599a1e5a89f336ab025866f32
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 7503e47..26cba84 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2793,13 +2793,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 _
@@ -2809,37 +2819,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)))
- 29/61: gnu: alsa-utils: Fix cross-compilation., (continued)
- 29/61: gnu: alsa-utils: Fix cross-compilation., guix-commits, 2019/08/21
- 21/61: gnu: mit-krb5: Fix cross-compilation., guix-commits, 2019/08/21
- 20/61: gnu: libsamplerate: Fix aarch64 cross-compilation., guix-commits, 2019/08/21
- 23/61: gnu: help2man: Fix cross-compilation., guix-commits, 2019/08/21
- 33/61: gnu: eudev: Fix cross-compilation., guix-commits, 2019/08/21
- 35/61: gnu: nghttp2: Fix cross-compilation., guix-commits, 2019/08/21
- 36/61: gnu: openldap: Fix cross-compilation., guix-commits, 2019/08/21
- 37/61: gnu: swig: Fix cross-compilation., guix-commits, 2019/08/21
- 18/61: gnu: bc: Fix cross-compilation., guix-commits, 2019/08/21
- 38/61: gnu: git: Fix cross-compilation., guix-commits, 2019/08/21
- 47/61: gnu: crda: Fix cross-compilation,
guix-commits <=
- 46/61: gnu: libnl: Fix cross-compilation., guix-commits, 2019/08/21
- 45/61: gnu: texinfo-4: Fix cross compilation, guix-commits, 2019/08/21
- 49/61: gnu: guile-wm: Fix cross-compilation., guix-commits, 2019/08/21
- 44/61: gnu: libtool: Fix cross-compilation., guix-commits, 2019/08/21
- 50/61: gnu: cmake: Fix cross-compilation., guix-commits, 2019/08/21
- 55/61: gnu: linux-libre: Enable built-in ext4 support., guix-commits, 2019/08/21
- 58/61: utils: Use target-arm64? and target-arm? helpers., guix-commits, 2019/08/21
- 52/61: gnu: mdadm: Fix cross-compilation., guix-commits, 2019/08/21
- 54/61: linux-initrd: Use native gzip., guix-commits, 2019/08/21
- 60/61: system: vm: Support cross-compilation., guix-commits, 2019/08/21