From patchwork Wed Oct 2 09:58:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15559 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 BEB0A1749F; Wed, 2 Oct 2019 11:01:02 +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 4A1DE1749D for ; Wed, 2 Oct 2019 11:01:02 +0100 (BST) Received: from localhost ([::1]:53136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbRM-000467-Lu for patchwork@mira.cbaines.net; Wed, 02 Oct 2019 06:01:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51066) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFbQZ-0003kc-Jf for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFbQX-0008Vg-PQ for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:11 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFbQX-0008VW-Lq for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFbQX-0000Yd-KC for guix-patches@gnu.org; Wed, 02 Oct 2019 06:00:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v4 06/23] gnu: boost: 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: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 Cc: Mathieu Othacehe Received: via spool by 36477-submit@debbugs.gnu.org id=B36477.15700103831853 (code B ref 36477); Wed, 02 Oct 2019 10:00:09 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Oct 2019 09:59:43 +0000 Received: from localhost ([127.0.0.1]:35451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbQ0-0000TB-Dh for submit@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:43 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFbPv-0000Ra-3V for 36477@debbugs.gnu.org; Wed, 02 Oct 2019 05:59:31 -0400 Received: by mail-wm1-f65.google.com with SMTP id b24so6251211wmj.5 for <36477@debbugs.gnu.org>; Wed, 02 Oct 2019 02:59:30 -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=1RaAbdaRDU7I3w4VSsxVX6OCnzGMJFsHT4wdA720YDI=; b=eiP09lbkOMVJwjBUf5yMGz4Zn59jcHxCySUPIpHxl3tkaJmllLhdMxbV8ig9fY8die 94A0CI9jiPj44VT3ukFAJm5L+TonQ/0JIcyVom0jfM7SwI8SPyLTUskQhrAh4RRfsbVv y6pqrxF77Gqlw66fZvHjo1L3VNTDltGklRDEAnmxQfzB0zW2I5gmoTmNjVJJwitE/eyq 6hVvHQ+TacQP0JMvAqxZ73GVQhLMYyU7hBA04jRaWXUDDKGIYiHPH4dQyEXdzZ4k/X1/ dX15B7NeVIzbw4OUKsSUI1P0K6/wXg45Mzxr2YQKVj+U1z1DT6gSE8srX9ngwNolhh/N jbaw== 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=1RaAbdaRDU7I3w4VSsxVX6OCnzGMJFsHT4wdA720YDI=; b=MIozPcqGfKwrN2/cbJ7QmFexZRgnKnmfv1TRHGW4j7M2FAqBIbZtm6P9b9yQzULPuY x6dc9sJSw9L9/antrvvi/GrvWrM9MeVPUsSUhXtVeuwzp0MMbsALYT4UBuXm3k/XZ46Y hiycGwwt/AKgO9zHdww9gU3xbv8uQZV09rhSjP74Uu0geAyxebIelmy5SPIwHix30FSd 4iG8douzp3Qg/I2judVU7YiK0o7JR4cUV3BQIw89wiUPw3Q5p6h4qv16Y+Xwi+POLUF2 J3asbbWVuaSzIKwKbwQuLtpF7bxsO3tvAYQ/k92lq5XzLMQNwaikIKYIrwrpQXB54sQy Vw4Q== X-Gm-Message-State: APjAAAXKBLuY396DKh5bUgGYJarvPRMr5xmV3il6tSSBOEnA+ly2AV3h awBDqKhnt+8B4HeKyR837Rzscvii X-Google-Smtp-Source: APXvYqzceoGLrhIBz0zTWBrJcftOmdp0UT+U9F8Ah/KgOQqMZvmspd60TgP+zN8ge35KGSjaxwgp8w== X-Received: by 2002:a7b:cb8b:: with SMTP id m11mr2208922wmi.145.1570010364941; Wed, 02 Oct 2019 02:59:24 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 02:59:24 -0700 (PDT) From: Mathieu Othacehe Date: Wed, 2 Oct 2019 11:58:47 +0200 Message-Id: <20191002095904.6325-7-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/patches/boost-dumpversion.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/boost.scm (boost)[source]: Apply it, [native-inputs]: add python unless cross-compiling, [arguments]: pass cross-compilation mandatory flags and fill a user-config.jam file pointing to cross-compiler. Disable python support that is broken when cross-compiling. Disable provide-libboost_python when cross-compiling. --- gnu/local.mk | 1 + gnu/packages/boost.scm | 59 +++++++++++++++----- gnu/packages/patches/boost-dumpversion.patch | 24 ++++++++ 3 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 gnu/packages/patches/boost-dumpversion.patch diff --git a/gnu/local.mk b/gnu/local.mk index 3acb44e450..2ec5ffe29e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -715,6 +715,7 @@ dist_patch_DATA = \ %D%/packages/patches/binutils-loongson-workaround.patch \ %D%/packages/patches/blender-2.79-newer-ffmpeg.patch \ %D%/packages/patches/blender-2.79-python-3.7-fix.patch \ + %D%/packages/patches/boost-dumpversion.patch \ %D%/packages/patches/byobu-writable-status.patch \ %D%/packages/patches/calibre-no-updates-dialog.patch \ %D%/packages/patches/calibre-remove-test-bs4.patch \ diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index a2253a9efc..4e1e68204f 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2018, 2019 Ricardo Wurmus ;;; Copyright © 2018 Maxim Cournoyer ;;; Copyright © 2018 Efraim Flashner +;;; Copyright © 2019 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -54,6 +55,8 @@ (string-append "https://dl.bintray.com/boostorg/release/" version "/source/boost_" version-with-underscores ".tar.bz2")))) + (patches + (search-patches "boost-dumpversion.patch")) (sha256 (base32 "0y47nc7w0arwgj4x1phadxbvl7wyfcgknbz5kv8lzpl98wsyh2j3")))) @@ -62,7 +65,9 @@ ("zlib" ,zlib))) (native-inputs `(("perl" ,perl) - ("python" ,python-2) + ,@(if (%current-target-system) + '() + `(("python" ,python-2))) ("tcsh" ,tcsh))) (arguments `(#:tests? #f @@ -76,7 +81,24 @@ ;; Set the RUNPATH to $libdir so that the libs find each other. (string-append "linkflags=-Wl,-rpath=" - (assoc-ref %outputs "out") "/lib")) + (assoc-ref %outputs "out") "/lib") + ,@(if (%current-target-system) + `("--user-config=user-config.jam" + ;; Python is not supported when cross-compiling. + "--without-python" + "binary-format=elf" + "target-os=linux" + ,@(cond + ((string-prefix? "arm" (%current-target-system)) + '("abi=aapcs" + "address-model=32" + "architecture=arm")) + ((string-prefix? "aarch64" (%current-target-system)) + '("abi=aapcs" + "address-model=64" + "architecture=arm")) + (else '()))) + '())) #:phases (modify-phases %standard-phases (delete 'bootstrap) @@ -94,6 +116,14 @@ (setenv "SHELL" (which "sh")) (setenv "CONFIG_SHELL" (which "sh")) + ,@(if (%current-target-system) + `((call-with-output-file "user-config.jam" + (lambda (port) + (format port + "using gcc : cross : ~a-c++ ;" + ,(%current-target-system))))) + '()) + (invoke "./bootstrap.sh" (string-append "--prefix=" out) ;; Auto-detection looks for ICU only in traditional @@ -108,17 +138,20 @@ (replace 'install (lambda* (#:key make-flags #:allow-other-keys) (apply invoke "./b2" "install" make-flags))) - (add-after 'install 'provide-libboost_python - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - ;; Boost can build support for both Python 2 and Python 3 since - ;; version 1.67.0, and suffixes each library with the Python - ;; version. Many consumers only check for libboost_python - ;; however, so we provide it here as suggested in - ;; . - (with-directory-excursion (string-append out "/lib") - (symlink "libboost_python27.so" "libboost_python.so")) - #t)))))) + ,@(if (%current-target-system) + '() + '((add-after 'install 'provide-libboost_python + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; Boost can build support for both Python 2 and + ;; Python 3 since version 1.67.0, and suffixes each + ;; library with the Python version. Many consumers + ;; only check for libboost_python however, so we + ;; provide it here as suggested in + ;; . + (with-directory-excursion (string-append out "/lib") + (symlink "libboost_python27.so" "libboost_python.so")) + #t)))))))) (home-page "https://www.boost.org") (synopsis "Peer-reviewed portable C++ source libraries") diff --git a/gnu/packages/patches/boost-dumpversion.patch b/gnu/packages/patches/boost-dumpversion.patch new file mode 100644 index 0000000000..7df779cfe6 --- /dev/null +++ b/gnu/packages/patches/boost-dumpversion.patch @@ -0,0 +1,24 @@ +This issue is described here: https://github.com/openwrt/packages/pull/8685 +and has not been solved as of 1.70.0 release. + +--- a/tools/build/src/tools/common.jam ++++ b/tools/build/src/tools/common.jam +@@ -973,18 +973,6 @@ + } + } + +- # From GCC 5, versioning changes and minor becomes patch +- if $(tag) = gcc && [ numbers.less 4 $(version[1]) ] +- { +- version = $(version[1]) ; +- } +- +- # Ditto, from Clang 4 +- if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ] +- { +- version = $(version[1]) ; +- } +- + # On intel, version is not added, because it does not matter and it is the + # version of vc used as backend that matters. Ideally, we should encode the + # backend version but that would break compatibility with V1.