From patchwork Mon Sep 2 15:33:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15228 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 73D121734D; Mon, 2 Sep 2019 16:35:22 +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 25F0517329 for ; Mon, 2 Sep 2019 16:35:22 +0100 (BST) Received: from localhost ([::1]:37584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oMT-0002Dw-Dp for patchwork@mira.cbaines.net; Mon, 02 Sep 2019 11:35:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42550) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oMD-0002BO-Vj for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4oMC-0004GM-Nx for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4oMC-0004Fx-JX for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4oMC-0006ch-GI for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v3 20/48] gnu: openldap: Fix cross-compilation. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Sep 2019 15:35:04 +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.156743847025109 (code B ref 36477); Mon, 02 Sep 2019 15:35:04 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Sep 2019 15:34:30 +0000 Received: from localhost ([127.0.0.1]:58771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLd-0006WW-50 for submit@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:30 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:40228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLI-0006Qi-Pz for 36477@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:09 -0400 Received: by mail-wr1-f54.google.com with SMTP id c3so14448102wrd.7 for <36477@debbugs.gnu.org>; Mon, 02 Sep 2019 08:34:08 -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=M9kLbK9Yufkwn6OkKkwWXAXth9AIGN5tOPh0rJyG59M=; b=MFqUqdWrnt+GROBz6HAUDvwbhYUeY9KvejtJufzBeQyVDuAZkaZx+72laVA+xk9xfc Rhw8iSuxEZSdNBn2O2MPplD4b9WRTMthmSTpolFVfJYaoqAr1xhm8kX0JfXZL6Y3XpQN phHeVhQZJZoe5kNolar8Fqi1w8OmHfXhmRpGc5xmmBh9j6lCQeqpR0YPnIxNERB7DeBi dDfr+nrk2hDaEkQrbeHsN2rJDolvHnxCKcj3rNE78+c8uZZNwXLBJbGquhkJOi3ZyD1S k25N8TNsLrWChzHUl61h3nkoemlwPCFY+PjcgN7fN2E2JknGgWNGxk24xXv6T2NOoCF7 R5MA== 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=M9kLbK9Yufkwn6OkKkwWXAXth9AIGN5tOPh0rJyG59M=; b=V5bab0BQaK4Q/Xv3YeHBuoNwe0L8/15PyZboolUB8B2VGGk8Lg6OtuVwWSvy2aCZij OY2hxMO/o1Sw4MLzak2eH9sYXrgSN5s8LB3wdDs51av4y0MEqOKS3j73wUM4D4haNo7A PBPvsg7B/651UI4h40pGGUBxhMW5X7L0quVimCE/kKIEG1uDI0BaxrG1xR6WWdNcBG4L XI3W2EwiW2j0M8UEc1+our/l1nE9otYnUXvB3bFYYt9B0MUA88vlwNRjjqaz/AVX9gQ4 kEINjws0WXZubuvARwxTnuwMrytz1YoaIdlnulRkZmcxUW87m0jYJmLJm9+/BvjySg6F X2wg== X-Gm-Message-State: APjAAAV9AkHDj9OOgrIpT75i2ZHj/QBNX0WZX9n43IkIEHnybMUW8rto LW1gpMU+5dUAauKKzE6S6VxvD4il X-Google-Smtp-Source: APXvYqze3/ES+TQFbrv8yZURmcrYHrzbcgcK0LAoD3wSHgIf2yCRztPQQW93Ze6H86PmLJj8bBsdaw== X-Received: by 2002:a5d:6911:: with SMTP id t17mr36644707wru.255.1567438442980; Mon, 02 Sep 2019 08:34:02 -0700 (PDT) Received: from localhost.localdomain ([80.12.63.115]) by smtp.gmail.com with ESMTPSA id b26sm17232265wmj.14.2019.09.02.08.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 08:34:02 -0700 (PDT) From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:33:05 +0200 Message-Id: <20190902153333.11190-21-m.othacehe@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190902153333.11190-1-m.othacehe@gmail.com> References: <20190902153333.11190-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/openldap.scm (openldap)[inputs]: Move groff from here to ... [native-inputs]: ... here. Also add bdb and automake. [arguments]: Add cross-compilation specific configure-flags. Do not strip when cross-compiling. Add a new fix-configure phase to update outdated config.sub and config.guess. Add a fix-cross-gcc phase to set CC variable to cross-compiler name when cross-compiling. --- gnu/packages/openldap.scm | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm index 2f80920ed4..2c9b0d428e 100644 --- a/gnu/packages/openldap.scm +++ b/gnu/packages/openldap.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Leo Famulari ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus ;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +51,7 @@ #:use-module (gnu packages) #:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl)) #:use-module (guix packages) + #:use-module (guix utils) #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (guix build-system python)) @@ -79,16 +81,46 @@ (inputs `(("bdb" ,bdb-5.3) ("cyrus-sasl" ,cyrus-sasl) ("gnutls" ,gnutls) - ("groff" ,groff) ("icu4c" ,icu4c) ("libgcrypt" ,libgcrypt) ("zlib" ,zlib))) - (native-inputs `(("libtool" ,libtool))) + (native-inputs `(("libtool" ,libtool) + ("groff" ,groff) + ("bdb" ,bdb-5.3) + ;; For up to date 'config.guess' and 'config.sub'. + ("automake" ,automake))) (arguments `(#:tests? #f - #:configure-flags '("--disable-static") + #:configure-flags + '("--disable-static" + ,@(if (%current-target-system) + '("--with-yielding_select=yes" + "ac_cv_func_memcmp_working=yes") + '())) + ;; Disable install stripping as it breaks cross-compiling. + #:make-flags '("STRIP=") #:phases (modify-phases %standard-phases + (add-after 'unpack 'fix-configure + (lambda* (#:key inputs native-inputs #:allow-other-keys) + ;; Replace outdated config.sub and config.guess: + (with-directory-excursion "build" + (for-each (lambda (file) + (install-file (string-append + (assoc-ref + (or native-inputs inputs) "automake") + "/share/automake-" + ,(version-major+minor + (package-version automake)) + "/" file) ".")) + '("config.sub" "config.guess"))) + #t)) + ,@(if (%current-target-system) + '((add-before 'configure 'fix-cross-gcc + (lambda* (#:key target #:allow-other-keys) + (setenv "CC" (string-append target "-gcc")) + #t))) + '()) (add-after 'install 'patch-sasl-path ;; Give -L arguments for cyrus-sasl to avoid propagation. (lambda* (#:key inputs outputs #:allow-other-keys)