From b3dd90b95ceef1262d98efd8103dde87d7d8b7c8 Mon Sep 17 00:00:00 2001 From: Ethan Stam <33101855+EthanS94@users.noreply.github.com> Date: Tue, 4 Aug 2020 11:51:49 -0600 Subject: 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 --- var/spack/repos/builtin/packages/paraview/package.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'var') 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') -- cgit v1.2.3-70-g09d2