From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:53815) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbhv-0003dr-Sp for guix-patches@gnu.org; Wed, 02 Oct 2019 06:18:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFbhq-0006dH-QP for guix-patches@gnu.org; Wed, 02 Oct 2019 06:18:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54942) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFbhq-0006dA-MZ for guix-patches@gnu.org; Wed, 02 Oct 2019 06:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFbhq-00010g-GQ for guix-patches@gnu.org; Wed, 02 Oct 2019 06:18:02 -0400 Subject: [bug#36477] [PATCH v4 01/23] gnu: openssl: Fix cross-compilation. Resent-Message-ID: Date: Wed, 2 Oct 2019 13:17:14 +0300 From: Efraim Flashner Message-ID: <20191002101714.GD590@E5400> References: <20191002095904.6325-1-m.othacehe@gmail.com> <20191002095904.6325-2-m.othacehe@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GyRA7555PLgSTuth" Content-Disposition: inline In-Reply-To: <20191002095904.6325-2-m.othacehe@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Mathieu Othacehe Cc: 36477@debbugs.gnu.org --GyRA7555PLgSTuth Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 02, 2019 at 11:58:42AM +0200, Mathieu Othacehe wrote: > * gnu/packages/tls.scm (openssl-next)[arguments]: Pass CROSS_COMPILE > environment variable and target system to configure script. > --- > gnu/packages/tls.scm | 62 ++++++++++++++++++++++++++++++++------------ > 1 file changed, 45 insertions(+), 17 deletions(-) >=20 > diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm > index 6689375da6..8797429dcf 100644 > --- a/gnu/packages/tls.scm > +++ b/gnu/packages/tls.scm > @@ -13,6 +13,7 @@ > ;;; Copyright =C2=A9 2017, 2018, 2019 Tobias Geerinckx-Rice > ;;; Copyright =C2=A9 2017 Rutger Helling > ;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur > +;;; Copyright =C2=A9 2019 Mathieu Othacehe > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -301,6 +302,23 @@ required structures.") > #:disallowed-references ,(list (canonical-package perl)) > #: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"))) This needs a null case. I think I'd try (_ (string-append "linux-" (string-tokenize (%current-target-system) (char-set-compliment (char-set #\-= ))))) This would create something somewhat usable for uncovered cases, and in the case of x86_64-linux, it would (should) spit out "linux-x86_64" This is basically the code used in (gnu services desktop) for the enlightenment-setuid-programs. > + #t))) > + '()) > (replace 'configure > (lambda* (#:key outputs #:allow-other-keys) > (let* ((out (assoc-ref outputs "out")) > @@ -310,7 +328,9 @@ required structures.") > (("/usr/bin/env") > (string-append (assoc-ref %build-inputs "coreutils") > "/bin/env"))) > - (invoke "./config" > + (invoke ,@(if (%current-target-system) > + '("./Configure") > + '("./config")) > "shared" ;build shared libraries > "--libdir=3Dlib" > =20 > @@ -321,7 +341,10 @@ required structures.") > "/share/openssl-" ,version) > =20 > (string-append "--prefix=3D" out) > - (string-append "-Wl,-rpath," lib))))) > + (string-append "-Wl,-rpath," lib) > + ,@(if (%current-target-system) > + '((getenv "CONFIGURE_TARGET_ARCH")) > + '()))))) could this be changed to ,@(when (%current-target-system) '((getenv "CONFIGURE_TARGET_ARCH"))) if it works then you don't need the 'if not' null case. > (add-after 'install 'move-static-libraries > (lambda* (#:key outputs #:allow-other-keys) > ;; Move static libraries to the "static" output. > @@ -435,21 +458,26 @@ required structures.") > (("^MANDIR[[:blank:]]*=3D.*$") > (string-append "MANDIR =3D " out "/share/man\n"))) > #t))) > - (replace 'configure > - ;; Override this phase because OpenSSL 1.0 does not understand= -rpath. > - (lambda* (#:key outputs #:allow-other-keys) > - (let ((out (assoc-ref outputs "out"))) > - (invoke "./config" > - "shared" ;build shared libraries > - "--libdir=3Dlib" > - > - ;; The default for this catch-all directory is > - ;; PREFIX/ssl. Change that to something more > - ;; conventional. > - (string-append "--openssldir=3D" out > - "/share/openssl-" ,version) > - > - (string-append "--prefix=3D" out))))) > + (replace 'configure > + ;; Override this phase because OpenSSL 1.0 does not understand -rp= ath. > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((out (assoc-ref outputs "out"))) > + (invoke ,@(if (%current-target-system) > + '("./Configure") > + '("./config")) > + "shared" ;build shared libraries > + "--libdir=3Dlib" > + > + ;; The default for this catch-all directory is > + ;; PREFIX/ssl. Change that to something more > + ;; conventional. > + (string-append "--openssldir=3D" out > + "/share/openssl-" ,version) > + > + (string-append "--prefix=3D" out) > + ,@(if (%current-target-system) > + '((getenv "CONFIGURE_TARGET_ARCH")) > + '()))))) > (delete 'move-extra-documentation) > (add-after 'install 'move-man3-pages > (lambda* (#:key outputs #:allow-other-keys) > --=20 > 2.23.0 >=20 >=20 >=20 >=20 --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --GyRA7555PLgSTuth Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl2UeScACgkQQarn3Mo9 g1Hd6w//dVWoEQoSXc8s2i+pXMQAzZDnRNVOQNEUwqi4+6Js+MO1RlgPeJCFlrKF WcwlXH1or68SRlqlKGvsnuNcIayTOG8eS4AzhEn9ozr2rM/ja2rDUxmDHspK+c+4 eB1JpTxLYU+2wdfMV5wvsiijlJ29+mBU5R+cSOiAC7b4eqp6yUo0fPki1K/cY5L0 E5PJpSWnqEGxkUcdIqJYayAjof1m8YKSd4T9G4NjwLayMtkWLSRHlNlKdRZdAn8T OR9UXOqDfhRIcMmFWRx9699enfH0QnC7suUTA1EKyoerSaikfjbxObkzZ+uLXbXR WQTTxk0YVj8R39Y3ZvuKKkBQAXID+DXXiAtEb/FHlUykMVggkM1MxDstihI9ZBiO Nzh5SPDYC2GI/FjPxP2V32lsRSV79v1dyl24K2frXge4JiMsp0gS4QfE6z2tGHgA J1Lz9Ke2v9uW8p6TdtW/ztRRIHW6yAtY/UKKKPyrECJ2R2ZA//q9mjBgh/KpQiuG 6IrfK2j0tr4m+B8j+tmh4kNQKtIp/4APl1C6C6g1EQWEN9T6Fl/LTrbaZJ77yYlH MXLv6wFKrFoAsjUFHX8WZarA5Zn9dGU88h+vae44x83v6jMEdTclw31vz+Rx8NZL ZWmMp/MBbLFEJsEYaVumT0Ch5HOerfDFEZkDAq5vGPlNFb6R1q0= =Z5iI -----END PGP SIGNATURE----- --GyRA7555PLgSTuth--