From patchwork Wed Aug 21 08:54:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15084 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1770C17264; Wed, 21 Aug 2019 09:59:40 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id BF9521724B for ; Wed, 21 Aug 2019 09:59:39 +0100 (BST) Received: from localhost ([::1]:45680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0MSw-0002eI-Uj for patchwork@mira.cbaines.net; Wed, 21 Aug 2019 04:59:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58618) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0MPb-0006dt-C4 for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0MPZ-0005GX-WE for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:11 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54077) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0MPZ-0005GR-TE for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0MPZ-0006YW-Qv for guix-patches@gnu.org; Wed, 21 Aug 2019 04:56:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v2 10/61] gnu: openssl: Fix cross-compilation. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Aug 2019 08:56:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36477 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 36477@debbugs.gnu.org Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.156637772624719 (code B ref 36477); Wed, 21 Aug 2019 08:56:09 +0000 Received: (at 36477) by debbugs.gnu.org; 21 Aug 2019 08:55:26 +0000 Received: from localhost ([127.0.0.1]:34578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0MOs-0006QW-6v for submit@debbugs.gnu.org; Wed, 21 Aug 2019 04:55:26 -0400 Received: from mail-wm1-f47.google.com ([209.85.128.47]:39625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0MOg-0006NJ-8M for 36477@debbugs.gnu.org; Wed, 21 Aug 2019 04:55:15 -0400 Received: by mail-wm1-f47.google.com with SMTP id i63so1281195wmg.4 for <36477@debbugs.gnu.org>; Wed, 21 Aug 2019 01:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xZiXCEJLDLaiMJLjNLIR5UjClekf5jGRpSNaZ/Dr6sk=; b=lhlVg0HVDNHkYhKUIWPOrjx5mjv4uiRkyw+kxxKXSvKK47iX0W35dZsPDjLuISIo6k +GBJljJiCc62DMZDIZIXIKY9gfCnUJWNuv8xvLXATXz7osfrQWE740a+FCjPPoZf+fPP NE1h+k74Aa8+Ga29YLiDo6IchFD+Lh8SrPbx3T92pMy/7rIsTFzshY2nMVTvy4QduDxI IztFg6L34StHwLW0CM37JhSLq7JNFN58ZBXoIC3vBhstcbvPkkBhcdc5RWZ8IRh1YKce KvYMBPQXX1Xa1P53t5VkapHvVSpS8At/u/uNRfpJypgQzGxopMVEgWvw7T0rEgSzEvGk 9sbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xZiXCEJLDLaiMJLjNLIR5UjClekf5jGRpSNaZ/Dr6sk=; b=QptibpNUiunfIIs1iq4+mJSDakvpyf04Nic8V+pW96Rx68WYBUAd+qwEqEml1Cl2Hu DGaWBU8AQGaP72eRC1c8MCVEiN6hBsPOnxruUerKewRzlUch93sBYHCgvNexC0JMurVP 9ZwV4emNNaBsH/lXPj/K0R9A9xEGlDvfkDHbq/hyhT69gYuthISAQ9DQ6UJ2IRvxRnWH fM4/9jDmdw6b60VTIVoiv2zKB2m1jQpw0VIFMtGKEHC6gSUdqd2Baci+nassV/rN3nw+ Egz1rMF31dl3zNqnu6SW96VIreJsJ1aPyXIUCanzE661iiUpDt7AdW91wHux8fCkeyYq IaCA== X-Gm-Message-State: APjAAAURFOsMKwwn8+A5H8vEQE1VXc1+xFsm0svdDGzBpsBRIp1UdFB5 1qkpbZ9EMHtSaFT5mw+RNk/qDHV3LE8= X-Google-Smtp-Source: APXvYqwwVoZSCC5DScx2NzIKTdNo47MLbDf9DE5aMkM8MwYEzD4I8YQ3SMf9y0PrHRLaYkGkL8sj9A== X-Received: by 2002:a1c:6c0d:: with SMTP id h13mr4401273wmc.74.1566377708270; Wed, 21 Aug 2019 01:55:08 -0700 (PDT) Received: from fuji.Parrot.Biz (smtp.parrot.biz. [62.23.167.188]) by smtp.gmail.com with ESMTPSA id v3sm22110739wrq.34.2019.08.21.01.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2019 01:55:07 -0700 (PDT) From: Mathieu Othacehe Date: Wed, 21 Aug 2019 10:54:04 +0200 Message-Id: <20190821085455.18508-10-m.othacehe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821085455.18508-1-m.othacehe@gmail.com> References: <20190821085455.18508-1-m.othacehe@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mathieu Othacehe Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index f2e7f4ad0c..c43b325bff 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2017 Rutger Helling ;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -300,6 +301,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? "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")) @@ -309,7 +327,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=lib" @@ -320,7 +340,10 @@ required structures.") "/share/openssl-" ,version) (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 (lambda* (#:key outputs #:allow-other-keys) ;; Move static libraries to the "static" output. @@ -416,21 +439,26 @@ required structures.") (("^MANDIR[[:blank:]]*=.*$") (string-append "MANDIR = " 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=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))))) + (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 ,@(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) + ,@(if (%current-target-system) + '((getenv "CONFIGURE_TARGET_ARCH")) + '()))))) (delete 'move-extra-documentation) (add-after 'install 'move-man3-pages (lambda* (#:key outputs #:allow-other-keys)