From patchwork Mon Sep 2 15:33:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 15259 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 89AE01734D; Mon, 2 Sep 2019 16:38: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,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 1A5E917329 for ; Mon, 2 Sep 2019 16:38:42 +0100 (BST) Received: from localhost ([::1]:37678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oPh-0005wF-IW for patchwork@mira.cbaines.net; Mon, 02 Sep 2019 11:38:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42599) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4oMF-0002Dg-TQ for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4oMC-0004FH-8W for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50025) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4oMC-0004F6-4I 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-0006cY-0T for guix-patches@gnu.org; Mon, 02 Sep 2019 11:35:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36477] [PATCH v3 15/48] gnu: boost: 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:03 +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.156743846925083 (code B ref 36477); Mon, 02 Sep 2019 15:35:03 +0000 Received: (at 36477) by debbugs.gnu.org; 2 Sep 2019 15:34:29 +0000 Received: from localhost ([127.0.0.1]:58762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLV-0006VV-CC for submit@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:27 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4oLD-0006Pe-LO for 36477@debbugs.gnu.org; Mon, 02 Sep 2019 11:34:08 -0400 Received: by mail-wr1-f66.google.com with SMTP id 30so3508332wrk.11 for <36477@debbugs.gnu.org>; Mon, 02 Sep 2019 08:34:03 -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=qd3oR80x1Kco8K4vFHHAoiwrzSHulBUBLrAi7hpOrVk=; b=TdnAQxUR8xgOqEOh0t3GPE78a8aTJ2G10yVBnVs3kjNlJnT+vxytX2iLaPJYGF6FZ9 BFIvyCn/G6aH2ElNskF1OyUt3vBb5YNF2zxWsjid5iigLOpf9TA/mQsfgAbFhZLW08I+ gbQsNeBcA+Hlbuvhm6hYbl+3GY4o74dUasgOrarX5wkLdga5yPGo6hfkrXXDw3cZOHv4 evar0JcSOVkZtkxgqMr2HnsK4U5Kn6ts9YG7BN4L4i1pYBrUqDsWKbqAPNOEuaw2sElq Fa4V9fcCmOwKF6PRFvnw0acNOwT5T552ZBEY3DQqQrbrA8I02CJ1PuUZ53QZ+tRpHVrg ecPQ== 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=qd3oR80x1Kco8K4vFHHAoiwrzSHulBUBLrAi7hpOrVk=; b=En7KddxGslexS5knccA7la/hIFvhnOBgV8+MJ6ZITygwwBHvgqK87SzAqS3djL28Bv EU090pqhXKl7YE9Ic10tIPVPh57qgvlgtWfRalS4Dr3ZbDZ2fsG4IA7k72pWPTbpJXnY 9RRQ1ZLjK5ld0HOn0aDrO/3NWiksLDL4bpN1opT3PglmC4Wa+j/nAJKc/9hq6qi7jpiT T3Qf/wzwMdiFwls1x+KVm3h7a2ph6ZuS3nF6rGreZC2CYwAt9qQ1YiPKPuRD2j1hCQro IlXtHbe14s/G8vFICcj0C30QlO9f7CDHj1zaMN93A7k9jsMhpznd0uZnDfwQuYth4rVC HavA== X-Gm-Message-State: APjAAAX3nzLK5fDBz/Rd2+zrahKbo3OmNg+3w8zkiTaIRJyEP7i+Ym22 S1F+pzlgDOkohVl+nWI6pzZKa6J9 X-Google-Smtp-Source: APXvYqxC7amPP72e32fSo2Zpfbos+FReAidiT+gmffQDVJoEKKaofPi8wKqN0E8Pr3CB0vjNnHp1tw== X-Received: by 2002:a5d:46c4:: with SMTP id g4mr20153092wrs.189.1567438437864; Mon, 02 Sep 2019 08:33:57 -0700 (PDT) Received: from localhost.localdomain ([80.12.63.115]) by smtp.gmail.com with ESMTPSA id b26sm17232265wmj.14.2019.09.02.08.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 08:33:57 -0700 (PDT) From: Mathieu Othacehe Date: Mon, 2 Sep 2019 17:33:00 +0200 Message-Id: <20190902153333.11190-16-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/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 3550479ae6..ae53257a77 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -710,6 +710,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.