From patchwork Wed Oct 2 09:58:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15556 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 7EFAF1749F; Wed, 2 Oct 2019 11:00:24 +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 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 2A07E1749D for ; Wed, 2 Oct 2019 11:00:24 +0100 (BST) Received: from localhost ([::1]:53124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbQk-0003ir-0Z for patchwork@mira.cbaines.net; Wed, 02 Oct 2019 06:00:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50982) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbQV-0003hl-HQ for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFbQU-0008So-AO for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFbQU-0008Sk-6n for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFbQU-0000Xo-0F for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v4 01/23] gnu: openssl: Fix cross-compilation. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Oct 2019 10:00:05 +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 Cc: Mathieu Othacehe Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.15700103681736 (code B ref 36477); Wed, 02 Oct 2019 10:00:05 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Oct 2019 09:59:28 +0000 Received: from localhost ([127.0.0.1]:35434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbPs-0000Rv-3J for submit@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:28 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:36217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbPp-0000RK-Nu for 36477@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:26 -0400 Received: by mail-wr1-f54.google.com with SMTP id y19so18915118wrd.3 for <36477@debbugs.gnu.org>; Wed, 02 Oct 2019 02:59:25 -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=eNEcqbvCnwl3+DTASpixa1L+oCaYc/dkJ5rb6f0iszo=; b=JaVFgn6KTjSn5mWfLzTHGTInD+MIkcTmv2InJCMgELxxo1anWYTj+zBw53+xbWKSLd aPPlwiAr1Z7cvvmYBasS2FYkgomLy6171NkEcG62FHx1P/wbsLEi1NdO3pc0X2CEQyqD A7bpwB5V8/MQQ6HJH5OHbxUHQC0YBNqG5JDZsr94pS5+KheEa5ds5rOdecpJNwfCmCPC nHTVVpKDedAnrOPMO4KGob6fXZhRYZiBXKKIGiHgQVCeNarFqyokx5pibAbQTXexM/rD jRwSx/I1BIWtE+6bRVcsjaSxWOK5KTm2+sCULXKCaPl63UsgYeoT2ok9Fi/lSDNzr0A2 +WEA== 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=eNEcqbvCnwl3+DTASpixa1L+oCaYc/dkJ5rb6f0iszo=; b=ULy5e0MaXNQ1m4sxnzPLq4V8tHcUcTgfPXcnT6IE6iBxfiU+QTEizL0fL7GMlkKetx tXr+oP7v568auZaCxe4UN7OHbSyVaag2L42VMZpmwKd6EQTTVdDqjsNpQjEhxz+EZaaN PzQKdfUrlkFXyzTs6yYnKm8niviTPA/also4Bri2TJpf2MSzNsdenMFU/T3ujFP6XG2p i/4jXHISngSWuUgEWPVYmTFZg16QReTEfewRcaa97Q78hYP8bPOjMmvuYF166fSidXM+ gg+C2b8n0JpxFro4cUTh2roBZPlaXS2j1sggEwPDVPnYt0hNTLlwtw+O2TcUEnFcMN9V 9ltw== X-Gm-Message-State: APjAAAV0ZkqW5MXnex8XSQ9TET3C2gZ1HVDJKzlad5GbxMMJ0N5PutvI aKpJRacYQ+6oE0R8zdL5cIjCeibO X-Google-Smtp-Source: APXvYqzrC0iKPusURck6psfoJyuro7GKP4vNupvY2LEeVVo8AEsw2JbdRUabv07Bz5nWa6lGT8IpNA== X-Received: by 2002:a5d:4c92:: with SMTP id z18mr1900848wrs.111.1570010359718; Wed, 02 Oct 2019 02:59:19 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:fa:a50:21e:67ff:fe5b:4283]) by smtp.gmail.com with ESMTPSA id w12sm29621318wrg.47.2019.10.02.02.59.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 02:59:18 -0700 (PDT) From: Mathieu Othacehe Date: Wed, 2 Oct 2019 11:58:42 +0200 Message-Id: <20191002095904.6325-2-m.othacehe@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191002095904.6325-1-m.othacehe@gmail.com> References: <20191002095904.6325-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: , 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 6689375da6..8797429dcf 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. ;;; @@ -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"))) + #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=lib" @@ -321,7 +341,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. @@ -435,21 +458,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)