From patchwork Wed Oct 2 09:58:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15567 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 0EB611749F; Wed, 2 Oct 2019 11:01:42 +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 B3F181749D for ; Wed, 2 Oct 2019 11:01:41 +0100 (BST) Received: from localhost ([::1]:53160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbS0-0004qK-9H for patchwork@mira.cbaines.net; Wed, 02 Oct 2019 06:01:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51115) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbQc-0003nD-1h for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFbQZ-00007a-HT for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:13 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54919) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFbQZ-00007N-Cd for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:11 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFbQZ-0000Zr-By for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:11 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v4 09/23] gnu: openldap: 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:11 +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.15700103851882 (code B ref 36477); Wed, 02 Oct 2019 10:00:11 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Oct 2019 09:59:45 +0000 Received: from localhost ([127.0.0.1]:35460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbQ8-0000UG-Vk for submit@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:45 -0400 Received: from mail-wm1-f43.google.com ([209.85.128.43]:54642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbPy-0000SA-VN for 36477@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:35 -0400 Received: by mail-wm1-f43.google.com with SMTP id p7so6485477wmp.4 for <36477@debbugs.gnu.org>; Wed, 02 Oct 2019 02:59:34 -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=fmVOYdeeqDuBBhwj3aZNr5DV6sPIrHGCeIwWQebuYIc=; b=lZ1WN6uwIwEv8B/+L8FLrmqcFIvmryZqXSEzYzJEIAYXXZnQDUIdxEow/rmd0arwwe ZPXKdOeBOGo0TnwN5C6w6D6/TR8Y1BiPufj/rtw4bJ5h15lp9rxgXUiO/C3/RpBLVhLH +JV8qo/WT3aeBhgor6mgqFfCEl7NJwY7x3IX3+yA7eSIbyfS2OnGqwpVFPIY+qyURzzy TYUQ+KgCiWz26AkH77NGaIaRtwqWQ8CHQWYrXrkAAmhfApdXhnAyCaSr0d5BUpnCztPv SO6bfg2Ug5ujk+hMc142zMJkMZQzL0H5WXjkemV8UECepZhKJMtGegI2uMMt/qir2Wfw fI4w== 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=fmVOYdeeqDuBBhwj3aZNr5DV6sPIrHGCeIwWQebuYIc=; b=KIXiFproLSKq/GlYZirm8xlfBLSmDY5fc8NDDykHDDPSbM/dTrLESFv8bAGYK8Q+LA RoGYNqY6f7QTVNkN1lZ+ce+qu3WFXggzArVJSKOr7Kog12Iw1kdhSz1RKMel5ZbFrJgi uENw0rapMTH5ka6leylVZ1QTxqp7Xg9Fr/dm5+AVXuWfeX4/QdVkM25cmNRTa6Whg7yB q43QPqmL6vh+lUPkP2mRhUDYB9GeE0Q5oLa892gU71yzbVokkeIu6VfX2ICv9boBvpIZ XIy3N30DKSdibWRFCfGHQuBMC4HNJ6Bur3610f9xbhUq7g1hEevp+wJgfzwNkQv9V7T7 x9yg== X-Gm-Message-State: APjAAAV0cKAZHAO3vsJPG2UmjlOUK/MlhYZ98axLLSW6qyyFy3q6Srsn e6RtfGC+ebpVNHU4Knlzuudd/3Kc X-Google-Smtp-Source: APXvYqwe9TCmgSvcuAVOgq3vAjF4OCuZyvNDJdwp7IhLOigYflqmQKzEHi7Cfj2OyiYHBQN0BG2F6A== X-Received: by 2002:a05:600c:22d9:: with SMTP id 25mr2028388wmg.133.1570010368860; Wed, 02 Oct 2019 02:59:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 02:59:27 -0700 (PDT) From: Mathieu Othacehe Date: Wed, 2 Oct 2019 11:58:50 +0200 Message-Id: <20191002095904.6325-10-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/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)