gnu: openssl: Fix cross-compilation.
* gnu/packages/tls.scm (openssl-next)[arguments]: Pass CROSS_COMPILE environment variable and target system to configure script.master
parent
2387e2f2d1
commit
bdcdd55000
|
@ -13,6 +13,7 @@
|
||||||
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
|
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
|
||||||
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
|
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
|
||||||
|
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -297,6 +298,23 @@ required structures.")
|
||||||
#:disallowed-references ,(list (canonical-package perl))
|
#:disallowed-references ,(list (canonical-package perl))
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
|
,@(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? "arm" target)
|
||||||
|
"linux-armv4")
|
||||||
|
((string-prefix? "aarch64" target)
|
||||||
|
"linux-aarch64")))
|
||||||
|
#t)))
|
||||||
|
'())
|
||||||
(replace 'configure
|
(replace 'configure
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
|
@ -306,7 +324,9 @@ required structures.")
|
||||||
(("/usr/bin/env")
|
(("/usr/bin/env")
|
||||||
(string-append (assoc-ref %build-inputs "coreutils")
|
(string-append (assoc-ref %build-inputs "coreutils")
|
||||||
"/bin/env")))
|
"/bin/env")))
|
||||||
(invoke "./config"
|
(invoke ,@(if (%current-target-system)
|
||||||
|
'("./Configure")
|
||||||
|
'("./config"))
|
||||||
"shared" ;build shared libraries
|
"shared" ;build shared libraries
|
||||||
"--libdir=lib"
|
"--libdir=lib"
|
||||||
|
|
||||||
|
@ -317,7 +337,10 @@ required structures.")
|
||||||
"/share/openssl-" ,version)
|
"/share/openssl-" ,version)
|
||||||
|
|
||||||
(string-append "--prefix=" out)
|
(string-append "--prefix=" out)
|
||||||
(string-append "-Wl,-rpath," lib)))))
|
(string-append "-Wl,-rpath," lib)
|
||||||
|
,@(if (%current-target-system)
|
||||||
|
'((getenv "CONFIGURE_TARGET_ARCH"))
|
||||||
|
'())))))
|
||||||
(add-after 'install 'move-static-libraries
|
(add-after 'install 'move-static-libraries
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
;; Move static libraries to the "static" output.
|
;; Move static libraries to the "static" output.
|
||||||
|
@ -436,7 +459,9 @@ required structures.")
|
||||||
;; Override this phase because OpenSSL 1.0 does not understand -rpath.
|
;; Override this phase because OpenSSL 1.0 does not understand -rpath.
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(let ((out (assoc-ref outputs "out")))
|
||||||
(invoke "./config"
|
(invoke ,@(if (%current-target-system)
|
||||||
|
'("./Configure")
|
||||||
|
'("./config"))
|
||||||
"shared" ;build shared libraries
|
"shared" ;build shared libraries
|
||||||
"--libdir=lib"
|
"--libdir=lib"
|
||||||
|
|
||||||
|
@ -446,7 +471,10 @@ required structures.")
|
||||||
(string-append "--openssldir=" out
|
(string-append "--openssldir=" out
|
||||||
"/share/openssl-" ,version)
|
"/share/openssl-" ,version)
|
||||||
|
|
||||||
(string-append "--prefix=" out)))))
|
(string-append "--prefix=" out)
|
||||||
|
,@(if (%current-target-system)
|
||||||
|
'((getenv "CONFIGURE_TARGET_ARCH"))
|
||||||
|
'())))))
|
||||||
(delete 'move-extra-documentation)
|
(delete 'move-extra-documentation)
|
||||||
(add-after 'install 'move-man3-pages
|
(add-after 'install 'move-man3-pages
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
|
Reference in New Issue