Skip to content
Snippets Groups Projects
Unverified Commit b3dd90b9 authored by Ethan Stam's avatar Ethan Stam Committed by GitHub
Browse files

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
parent d77f388a
Branches
Tags
No related merge requests found
......@@ -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 @@ def nvariant_bool(feature):
'-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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment