summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorEthan Stam <33101855+EthanS94@users.noreply.github.com>2020-08-04 11:51:49 -0600
committerGitHub <noreply@github.com>2020-08-04 12:51:49 -0500
commitb3dd90b95ceef1262d98efd8103dde87d7d8b7c8 (patch)
treec458e82fec56b55ba1980308bf463c0151ab6866 /var
parentd77f388a0d33cb886ff41d4953f31d3107e95e27 (diff)
downloadspack-b3dd90b95ceef1262d98efd8103dde87d7d8b7c8.tar.gz
spack-b3dd90b95ceef1262d98efd8103dde87d7d8b7c8.tar.bz2
spack-b3dd90b95ceef1262d98efd8103dde87d7d8b7c8.tar.xz
spack-b3dd90b95ceef1262d98efd8103dde87d7d8b7c8.zip
ParaView: Allow all ParaView versions to depend on Python 2 (#17484)
* Allow all ParaView versions to depend on Python 2 * Keep conflict for 5.9 and up with python 2 * Fix line too long * Don't use backslash * Try fixing indent * Clean logic for python cmake flags * Try fixing indent
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/paraview/package.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py
index bb8b140b74..30b00ad7d5 100644
--- a/var/spack/repos/builtin/packages/paraview/package.py
+++ b/var/spack/repos/builtin/packages/paraview/package.py
@@ -51,7 +51,8 @@ class Paraview(CMakePackage, CudaPackage):
description='Use module kits')
conflicts('+python', when='+python3')
- conflicts('+python', when='@5.6:')
+ # Python 2 support dropped with 5.9.0
+ conflicts('+python', when='@5.9:')
conflicts('+python3', when='@:5.5')
conflicts('+shared', when='+cuda')
# Legacy rendering dropped in 5.5
@@ -110,6 +111,11 @@ class Paraview(CMakePackage, CudaPackage):
depends_on('zlib')
depends_on('cmake@3.3:', type='build')
+ # Can't contretize with python2 and py-setuptools@45.0.0:
+ depends_on('py-setuptools@:44.99.99', when='+python')
+ # Can't contretize with python2 and py-pillow@7.0.0:
+ depends_on('py-pillow@:6', when='+python')
+
patch('stl-reader-pv440.patch', when='@4.4.0')
# Broken gcc-detection - improved in 5.1.0, redundant later
@@ -232,13 +238,20 @@ class Paraview(CMakePackage, CudaPackage):
'-DPARAVIEW_QT_VERSION=%s' % spec['qt'].version[0],
])
+ # CMake flags for python have changed with newer ParaView versions
+ # Make sure Spack uses the right cmake flags
if '+python' in spec or '+python3' in spec:
+ py_use_opt = 'USE' if spec.satisfies('@5.8:') else 'ENABLE'
+ py_ver_opt = 'PARAVIEW' if spec.satisfies('@5.7:') else 'VTK'
+ py_ver_val = 3 if '+python3' in spec else 2
cmake_args.extend([
- '-DPARAVIEW_ENABLE_PYTHON:BOOL=ON',
+ '-DPARAVIEW_%s_PYTHON:BOOL=ON' % py_use_opt,
'-DPYTHON_EXECUTABLE:FILEPATH=%s' %
spec['python'].command.path,
- '-DVTK_USE_SYSTEM_MPI4PY:BOOL=%s' % variant_bool('+mpi')
+ '-DVTK_USE_SYSTEM_MPI4PY:BOOL=%s' % variant_bool('+mpi'),
+ '-D%s_PYTHON_VERSION:STRING=%d' % (py_ver_opt, py_ver_val)
])
+
else:
cmake_args.append('-DPARAVIEW_ENABLE_PYTHON:BOOL=OFF')