summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2017-03-02 18:36:10 -0600
committerGitHub <noreply@github.com>2017-03-02 18:36:10 -0600
commit7fcd414050c25782dcdca2d41eab90e091fcaee1 (patch)
tree35b96d153d3284b9d27b2b83efb5b586da0027c2 /var
parentbde0a674151dc514571b7e5357df7a2711b7ac3a (diff)
downloadspack-7fcd414050c25782dcdca2d41eab90e091fcaee1.tar.gz
spack-7fcd414050c25782dcdca2d41eab90e091fcaee1.tar.bz2
spack-7fcd414050c25782dcdca2d41eab90e091fcaee1.tar.xz
spack-7fcd414050c25782dcdca2d41eab90e091fcaee1.zip
Fixes to allow Boost to build with Python 3 (#3293)
* Fixes to allow Boost to build with Python 3 * Restrict patch to Python 3 only
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/boost/package.py8
-rw-r--r--var/spack/repos/builtin/packages/boost/python_jam.patch42
2 files changed, 47 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py
index 878e62db5c..6f891de664 100644
--- a/var/spack/repos/builtin/packages/boost/package.py
+++ b/var/spack/repos/builtin/packages/boost/package.py
@@ -130,6 +130,9 @@ class Boost(Package):
# Patch fix from https://svn.boost.org/trac/boost/ticket/11856
patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7')
+ # Patch fix from https://svn.boost.org/trac/boost/ticket/11120
+ patch('python_jam.patch', when='^python@3:')
+
# Patch fix from https://svn.boost.org/trac/boost/ticket/10125
patch('boost_10125.patch', when='@1.55.0%gcc@5.0:5.9')
@@ -153,7 +156,7 @@ class Boost(Package):
toolsets = {'g++': 'gcc',
'icpc': 'intel',
- 'clang++': 'clang',
+ 'clang++': 'clang',
'xlc++': 'xlcpp',
'xlc++_r': 'xlcpp'}
@@ -192,8 +195,7 @@ class Boost(Package):
options.append("--with-libraries=%s" % ','.join(withLibs))
if '+python' in spec:
- options.append('--with-python=%s' %
- join_path(spec['python'].prefix.bin, 'python'))
+ options.append('--with-python=%s' % python_exe)
with open('user-config.jam', 'w') as f:
# Boost may end up using gcc even though clang+gfortran is set in
diff --git a/var/spack/repos/builtin/packages/boost/python_jam.patch b/var/spack/repos/builtin/packages/boost/python_jam.patch
new file mode 100644
index 0000000000..70054ba4ed
--- /dev/null
+++ b/var/spack/repos/builtin/packages/boost/python_jam.patch
@@ -0,0 +1,42 @@
+diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam
+index 90377ea..123f66a 100644
+--- a/tools/build/src/tools/python.jam
++++ b/tools/build/src/tools/python.jam
+@@ -493,6 +493,10 @@ local rule probe ( python-cmd )
+ sys.$(s) = [ SUBST $(output) \\<$(s)=([^$(nl)]+) $1 ] ;
+ }
+ }
++ # Try to get python abiflags
++ full-cmd = $(python-cmd)" -c \"from sys import abiflags; print(abiflags, end='')\"" ;
++
++ sys.abiflags = [ SHELL $(full-cmd) ] ;
+ return $(output) ;
+ }
+ }
+@@ -502,7 +506,7 @@ local rule probe ( python-cmd )
+ # have a value based on the information given.
+ #
+ local rule compute-default-paths ( target-os : version ? : prefix ? :
+- exec-prefix ? )
++ exec-prefix ? : abiflags ? )
+ {
+ exec-prefix ?= $(prefix) ;
+
+@@ -539,7 +543,7 @@ local rule compute-default-paths ( target-os : version ? : prefix ? :
+ }
+ else
+ {
+- includes ?= $(prefix)/include/python$(version) ;
++ includes ?= $(prefix)/include/python$(version)$(abiflags) ;
+
+ local lib = $(exec-prefix)/lib ;
+ libraries ?= $(lib)/python$(version)/config $(lib) ;
+@@ -783,7 +787,7 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
+ exec-prefix = $(sys.exec_prefix) ;
+
+ compute-default-paths $(target-os) : $(sys.version) :
+- $(sys.prefix) : $(sys.exec_prefix) ;
++ $(sys.prefix) : $(sys.exec_prefix) : $(sys.abiflags) ;
+
+ version = $(sys.version) ;
+ interpreter-cmd ?= $(cmd) ;