unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: goodoldpaul@autistici.org
To: 38128@debbugs.gnu.org
Subject: [bug#38128] [PATCH] gnu: Add boost-with-python3
Date: Fri, 08 Nov 2019 10:59:26 +0000	[thread overview]
Message-ID: <2894916c81c703293e028556070cd964@autistici.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

Hello Guixers!

Given the recent discussion about dropping python 2 completely I thought 
it's time to build our libboost against python 3. I didn't have the time 
to check if every boost dependency (there are a lot ;) ) supported 
python 3, so I added a new variable "boost-with-python3". I'm not sure 
if I should have made it hidden or if I should have update directly 
boost definition so any feedback is welcome.

Thanks for your patience reviewing this patch,

Giacomo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-boost-with-python3.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-boost-with-python3.patch, Size: 4295 bytes --]

From 6eef72ea2bc904ff1371fbbe1211a3890625d99c Mon Sep 17 00:00:00 2001
From: Giacomo Leidi <goodoldpaul@autistici.org>
Date: Fri, 8 Nov 2019 11:52:42 +0100
Subject: [PATCH] gnu: Add boost-with-python3.

* gnu/packages/boost.scm (boost-with-python3): New variable.
---
 gnu/packages/boost.scm | 55 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index a2253a9efc..4007c34993 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -128,6 +129,60 @@ across a broad spectrum of applications.")
     (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt"
                                 "Some components have other similar licences."))))
 
+(define-public boost-with-python3
+  (package
+    (inherit boost)
+    (source (origin
+              (inherit (package-source boost))))
+    (native-inputs
+     `(("perl" ,perl)
+       ("python" ,python)
+       ("tcsh" ,tcsh)))
+    (arguments (substitute-keyword-arguments (package-arguments boost)
+                 ((#:phases phases)
+                  `(modify-phases ,phases
+                     (replace 'configure
+                       (lambda* (#:key inputs outputs #:allow-other-keys)
+                         (let ((icu (assoc-ref inputs "icu4c"))
+                               (python (assoc-ref inputs "python"))
+                               (out (assoc-ref outputs "out")))
+                           (substitute* '("libs/config/configure"
+                                          "libs/spirit/classic/phoenix/test/runtest.sh"
+                                          "tools/build/src/engine/execunix.c"
+                                          "tools/build/src/engine/Jambase"
+                                          "tools/build/src/engine/jambase.c")
+                             (("/bin/sh") (which "sh")))
+
+                           (setenv "SHELL" (which "sh"))
+                           (setenv "CONFIG_SHELL" (which "sh"))
+
+                           (substitute* "tools/build/src/tools/python.jam"
+                             (("include/python\\$\\(version\\)")
+                              "include/python$(version)m"))
+
+                           (invoke "./bootstrap.sh"
+                                   (string-append "--prefix=" out)
+                                   ;; Auto-detection looks for dependencies only
+                                   ;; in traditional install locations.
+                                   (string-append "--with-icu=" icu)
+                                   (string-append "--with-python=" python "/bin/python3")
+                                   (string-append "--with-python-root=" python)
+                                   "--with-python-version=3.7"
+                                   "--with-toolset=gcc"))))
+                     (replace 'provide-libboost_python
+                       (lambda* (#:key outputs #:allow-other-keys)
+                         (let ((out (assoc-ref outputs "out")))
+                           (with-directory-excursion (string-append out "/lib")
+                             ;; 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
+                             ;; <https://github.com/boostorg/python/issues/203>.
+                             (symlink "libboost_python37.so" "libboost_python.so")
+                             ;; Some packages also look for libboost_python3.so
+                             (symlink "libboost_python37.so" "libboost_python3.so"))
+                           #t)))))))))
+
 (define-public boost-for-mysql
   ;; Older version for MySQL 5.7.23.
   (package
-- 
2.24.0


             reply	other threads:[~2019-11-08 11:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 10:59 goodoldpaul [this message]
2019-11-10 21:50 ` bug#38128: [PATCH] gnu: Add boost-with-python3 Marius Bakke
2019-11-11  9:36   ` [bug#38128] " Efraim Flashner
2019-11-12  0:06     ` goodoldpaul
2019-11-16  9:04       ` [bug#38228] Fwd: [PATCH] gnu: boost: Build with python3 goodoldpaul
2019-11-20  0:01         ` Marius Bakke
2019-12-09 11:24           ` goodoldpaul
2020-01-08 21:11             ` bug#38228: " Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2894916c81c703293e028556070cd964@autistici.org \
    --to=goodoldpaul@autistici.org \
    --cc=38128@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).