Update nlopt package to add Python bindings to PYTHONPATH (#13688)

* Update nlopt package to add Python bindings to PYTHONPATH

* Use extends for nlopt/python fix

* nlopt - change develop to master and add python dep qualifiers
This commit is contained in:
Stephen Hudson 2019-11-12 11:46:12 -06:00 committed by Adam J. Stewart
parent 826e8c6394
commit cea7403b67

View File

@ -16,7 +16,7 @@ class Nlopt(CMakePackage):
url = "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
git = "https://github.com/stevengj/nlopt.git"
version('develop', branch='master')
version('master', branch='master')
version('2.5.0', sha256='c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae')
variant('shared', default=True, description='Enables the build of shared libraries')
@ -28,13 +28,14 @@ class Nlopt(CMakePackage):
# Note: matlab is licenced - spack does not download automatically
variant("matlab", default=False, description="Build the Matlab bindings.")
depends_on('cmake@3.0:', type='build', when='@develop')
depends_on('python', when='+python')
depends_on('cmake@3.0:', type='build', when='@master')
depends_on('python', when='+python', type=('build', 'run'))
depends_on('py-numpy', when='+python', type=('build', 'run'))
depends_on('swig', when='+python')
depends_on('guile', when='+guile')
depends_on('octave', when='+octave')
depends_on('matlab', when='+matlab')
extends('python', when='+python')
def cmake_args(self):
# Add arguments other than
@ -43,7 +44,7 @@ def cmake_args(self):
args = []
# Specify on command line to alter defaults:
# eg: spack install nlopt@develop +guile -octave +cxx
# eg: spack install nlopt@master +guile -octave +cxx
# Spack should locate python by default - but to point to a build
if '+python' in spec: