[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#36477] [PATCH 10/31] gnu: openssl: Fix cross-compilation.
From: |
Mathieu Othacehe |
Subject: |
[bug#36477] [PATCH 10/31] gnu: openssl: Fix cross-compilation. |
Date: |
Mon, 8 Jul 2019 11:58:52 +0200 |
* gnu/packages/tls.scm (openssl-next)[arguments]: Pass CROSS_COMPILE
environment variable and target system to configure script.
---
gnu/packages/tls.scm | 59 +++++++++++++++++++++++++++++++++-----------
1 file changed, 45 insertions(+), 14 deletions(-)
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 8e20101e51..4e269bcc8c 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <address@hidden>
;;; Copyright © 2017 Rutger Helling <address@hidden>
;;; Copyright © 2018 Clément Lassieur <address@hidden>
+;;; Copyright © 2019 Mathieu Othacehe <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -310,11 +311,31 @@ required structures.")
(("^MANDIR[[:blank:]]*=.*$")
(string-append "MANDIR = " out "/share/man\n")))
#t)))
+ ,@(if (%current-target-system)
+ '((add-before
+ 'configure 'set-cross-compile
+ (lambda* (#:key target outputs #:allow-other-keys)
+ (setenv "CROSS_COMPILE" (string-append target "-"))
+ (setenv "CONFIGURE_TARGET_ARCH"
+ (cond
+ ((string-prefix? "i686" target)
+ "linux-x86")
+ ((string-prefix? "x86_64" target)
+ "linux-x86_64")
+ ((string-prefix? "armhf" target)
+ "linux-armv4")
+ ((string-prefix? "aarch64" target)
+ "linux-aarch64")))
+ #t)))
+ '())
(replace
'configure
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
- (invoke "./config"
+ (invoke
+ ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
"shared" ;build shared libraries
"--libdir=lib"
@@ -323,8 +344,11 @@ required structures.")
;; conventional.
(string-append "--openssldir=" out
"/share/openssl-" ,version)
+ (string-append "--prefix=" out)
- (string-append "--prefix=" out)))))
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(add-after
'install 'make-libraries-writable
(lambda* (#:key outputs #:allow-other-keys)
@@ -444,18 +468,25 @@ required structures.")
(("/usr/bin/env")
(string-append (assoc-ref %build-inputs "coreutils")
"/bin/env")))
- (invoke "./config"
- "shared" ;build shared libraries
- "--libdir=lib"
-
- ;; The default for this catch-all directory is
- ;; PREFIX/ssl. Change that to something more
- ;; conventional.
- (string-append "--openssldir=" out
- "/share/openssl-" ,version)
-
- (string-append "--prefix=" out)
- (string-append "-Wl,-rpath," lib)))))
+ (invoke
+ ,@(if (%current-target-system)
+ '("./Configure")
+ '("./config"))
+ "shared" ;build shared libraries
+ "--libdir=lib"
+
+ ;; The default for this catch-all directory is
+ ;; PREFIX/ssl. Change that to something more
+ ;; conventional.
+ (string-append "--openssldir=" out
+ "/share/openssl-" ,version)
+
+ (string-append "--prefix=" out)
+ (string-append "-Wl,-rpath," lib)
+
+ ,@(if (%current-target-system)
+ '((getenv "CONFIGURE_TARGET_ARCH"))
+ '())))))
(delete 'move-man3-pages)
(add-after 'install 'move-extra-documentation
--
2.17.1
[bug#36477] [PATCH 14/31] gnu: ath9k-htc-firmware: Fix cross compilation., Mathieu Othacehe, 2019/07/08
[bug#36477] [PATCH 10/31] gnu: openssl: Fix cross-compilation.,
Mathieu Othacehe <=
[bug#36477] [PATCH 12/31] gnu: cmake: Extend CMAKE_PREFIX_PATH to non-native inputs., Mathieu Othacehe, 2019/07/08
[bug#36477] [PATCH 07/31] gnu: libgpg-error: Fix cross compilation., Mathieu Othacehe, 2019/07/08
[bug#36477] [PATCH 04/31] gnu: tk: Fix cross-compilation., Mathieu Othacehe, 2019/07/08
[bug#36477] [PATCH 11/31] gnu: texinfo: Fix cross-compilation., Mathieu Othacehe, 2019/07/08
[bug#36477] [PATCH 08/31] gnu: python: Fix cross-compilation., Mathieu Othacehe, 2019/07/08