From b9a0390724c8bfe1cba18012927c013fafb62fbd Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Thu, 31 Jan 2019 12:35:13 -0500 Subject: [PATCH] Convert most "mesa" dependencies to use virtual gl and glx dependencies --- var/spack/repos/builtin/packages/catalyst/package.py | 7 ++++--- var/spack/repos/builtin/packages/dislin/package.py | 3 ++- var/spack/repos/builtin/packages/fsl/package.py | 2 +- var/spack/repos/builtin/packages/geant4/package.py | 8 ++++---- var/spack/repos/builtin/packages/gplates/package.py | 2 +- var/spack/repos/builtin/packages/libepoxy/package.py | 2 +- var/spack/repos/builtin/packages/mrtrix3/package.py | 2 +- var/spack/repos/builtin/packages/paraview/package.py | 4 +++- var/spack/repos/builtin/packages/r-rgl/package.py | 10 +++++----- var/spack/repos/builtin/packages/virtualgl/package.py | 6 +----- var/spack/repos/builtin/packages/vtk/package.py | 9 +++++---- 11 files changed, 28 insertions(+), 27 deletions(-) diff --git a/var/spack/repos/builtin/packages/catalyst/package.py b/var/spack/repos/builtin/packages/catalyst/package.py index c92ffc90808..ff1ff28eee2 100644 --- a/var/spack/repos/builtin/packages/catalyst/package.py +++ b/var/spack/repos/builtin/packages/catalyst/package.py @@ -35,14 +35,15 @@ class Catalyst(CMakePackage): variant('extras', default=False, description='Enable Extras support') variant('rendering', default=False, description='Enable VTK Rendering support') variant('osmesa', default=True, description='Use offscreen rendering') + conflicts('+osmesa', when='~rendering') depends_on('git', type='build') depends_on('mpi') depends_on('python@2:2.8', when='+python', type=("build", "link", "run")) depends_on('python', when='~python', type=("build")) - depends_on('mesa', when='+rendering') - depends_on('libx11', when='+rendering') - depends_on('libxt', when='+rendering') + depends_on('gl@3.2', when='+rendering') + depends_on('mesa+osmesa', when='+rendering+osmesa') + depends_on('glx', when='+rendering~osmesa') depends_on('cmake@3.3:', type='build') @when('@5.5.0:5.5.2') diff --git a/var/spack/repos/builtin/packages/dislin/package.py b/var/spack/repos/builtin/packages/dislin/package.py index 797b50f5d63..53d0e901b29 100644 --- a/var/spack/repos/builtin/packages/dislin/package.py +++ b/var/spack/repos/builtin/packages/dislin/package.py @@ -18,7 +18,8 @@ class Dislin(Package): version('11.0.linux.i586_64', '6fb099b54f41db009cafc702eebb5bc6') depends_on('motif') - depends_on('mesa') + depends_on('gl') + depends_on('glx') @property def libs(self): diff --git a/var/spack/repos/builtin/packages/fsl/package.py b/var/spack/repos/builtin/packages/fsl/package.py index e223f85ff7d..5b115dcbc0a 100644 --- a/var/spack/repos/builtin/packages/fsl/package.py +++ b/var/spack/repos/builtin/packages/fsl/package.py @@ -26,7 +26,7 @@ class Fsl(Package): depends_on('python', type=('build', 'run')) depends_on('expat') depends_on('libx11') - depends_on('mesa-glu') + depends_on('glu') depends_on('zlib') depends_on('libpng') depends_on('boost') diff --git a/var/spack/repos/builtin/packages/geant4/package.py b/var/spack/repos/builtin/packages/geant4/package.py index 8846d4555db..3d952afc9e7 100644 --- a/var/spack/repos/builtin/packages/geant4/package.py +++ b/var/spack/repos/builtin/packages/geant4/package.py @@ -3,7 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - from spack import * import platform import os @@ -60,7 +59,9 @@ class Geant4(CMakePackage): depends_on("expat") depends_on("zlib") - depends_on("mesa", when='+opengl') + depends_on("xerces-c") + depends_on("gl", when='+opengl') + depends_on("glx", when='+opengl+x11') depends_on("libx11", when='+x11') depends_on("libxmu", when='+x11') depends_on("motif", when='+motif') @@ -88,8 +89,7 @@ def cmake_args(self): '-DXERCESC_ROOT_DIR:STRING=%s' % spec['xerces-c'].prefix, ] - arch = platform.system().lower() - if arch != 'darwin': + if 'platform=darwin' not in spec: if "+x11" in spec and "+opengl" in spec: options.append('-DGEANT4_USE_OPENGL_X11=ON') if "+motif" in spec and "+opengl" in spec: diff --git a/var/spack/repos/builtin/packages/gplates/package.py b/var/spack/repos/builtin/packages/gplates/package.py index 49aea5b45e3..1afdd4f68fd 100644 --- a/var/spack/repos/builtin/packages/gplates/package.py +++ b/var/spack/repos/builtin/packages/gplates/package.py @@ -25,7 +25,7 @@ class Gplates(CMakePackage): # Qt 5 does not support (at least) the Q_WS_* constants. depends_on('qt+opengl@4.4.0:4.99') depends_on('qwt@6.0.1:') - depends_on('mesa-glu') + depends_on('glu') depends_on('glew') # GDAL's OGRSFDriverRegistrar is not compatible anymore starting with 2.0. depends_on('gdal@1.3.2:1.99') diff --git a/var/spack/repos/builtin/packages/libepoxy/package.py b/var/spack/repos/builtin/packages/libepoxy/package.py index 8e2cff43249..7165f279487 100644 --- a/var/spack/repos/builtin/packages/libepoxy/package.py +++ b/var/spack/repos/builtin/packages/libepoxy/package.py @@ -18,7 +18,7 @@ class Libepoxy(AutotoolsPackage): depends_on('pkgconfig', type='build') depends_on('meson') - depends_on('mesa') + depends_on('gl') def configure_args(self): # Disable egl, otherwise configure fails with: diff --git a/var/spack/repos/builtin/packages/mrtrix3/package.py b/var/spack/repos/builtin/packages/mrtrix3/package.py index 89b1e24eefa..63d00a200bb 100644 --- a/var/spack/repos/builtin/packages/mrtrix3/package.py +++ b/var/spack/repos/builtin/packages/mrtrix3/package.py @@ -19,7 +19,7 @@ class Mrtrix3(Package): depends_on('python@2.7:', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) - depends_on('mesa-glu') + depends_on('glu') depends_on('qt+opengl@4.7:') depends_on('eigen') depends_on('zlib') diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index 19ebbf6a57c..560ba8c3067 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -46,7 +46,9 @@ class Paraview(CMakePackage): depends_on('qt~opengl', when='@5.3.0:+qt~opengl2') depends_on('qt@:4', when='@:5.2.0+qt') - depends_on('mesa+swrender', when='+osmesa') + depends_on('mesa+osmesa', when='+osmesa') + depends_on('gl@3.2', when='+opengl2') + depends_on('gl@1.2', when='~opengl2') depends_on('libxt', when='+qt') conflicts('+qt', when='+osmesa') diff --git a/var/spack/repos/builtin/packages/r-rgl/package.py b/var/spack/repos/builtin/packages/r-rgl/package.py index ea3c24fe08d..372833f8ab5 100644 --- a/var/spack/repos/builtin/packages/r-rgl/package.py +++ b/var/spack/repos/builtin/packages/r-rgl/package.py @@ -26,8 +26,8 @@ class RRgl(RPackage): depends_on('libpng', type=('link')) depends_on('libx11') depends_on('freetype', type=('link')) - depends_on('mesa', type=('link')) - depends_on('mesa-glu', type=('link')) + depends_on('gl') + depends_on('glu') depends_on('r-htmlwidgets', type=('build', 'run')) depends_on('r-htmltools', type=('build', 'run')) depends_on('r-knitr', type=('build', 'run')) @@ -40,7 +40,7 @@ class RRgl(RPackage): def configure_args(self): args = ['--x-includes=%s' % self.spec['libx11'].prefix.include, '--x-libraries=%s' % self.spec['libx11'].prefix.lib, - '--with-gl-includes=%s' % self.spec['mesa'].prefix.include, - '--with-gl-libraries=%s' % self.spec['mesa'].prefix.lib, - '--with-gl-prefix=%s' % self.spec['mesa'].prefix] + '--with-gl-includes=%s' % self.spec['gl'].prefix.include, + '--with-gl-libraries=%s' % self.spec['gl'].prefix.lib, + '--with-gl-prefix=%s' % self.spec['gl'].prefix] return args diff --git a/var/spack/repos/builtin/packages/virtualgl/package.py b/var/spack/repos/builtin/packages/virtualgl/package.py index 808a16afc6b..bf4352f04a0 100644 --- a/var/spack/repos/builtin/packages/virtualgl/package.py +++ b/var/spack/repos/builtin/packages/virtualgl/package.py @@ -19,8 +19,4 @@ class Virtualgl(CMakePackage): version('2.5.2', '1a9f404f4a35afa9f56381cb33ed210c') depends_on("libjpeg-turbo") - # virtualgl require OpenGL but also wants to link libglu - # on systems without development packages, provide with spack and depends - # on mesa-glu, but we do not want Mesa OpenGL sw emulation, so added - # variant on mesa-glu to disable dependencies on sw emulated OpenGL - depends_on("mesa-glu~mesa") + depends_on("glu") diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py index 5586a0de20d..c8c76b5bc7a 100644 --- a/var/spack/repos/builtin/packages/vtk/package.py +++ b/var/spack/repos/builtin/packages/vtk/package.py @@ -5,6 +5,7 @@ import os +import sys from spack import * @@ -53,14 +54,14 @@ class Vtk(CMakePackage): # The use of the OpenGL2 backend requires at least OpenGL Core Profile # version 3.2 or higher. depends_on('gl@3.2:', when='+opengl2') + depends_on('gl@1.2:', when='~opengl2') - # If you didn't ask for osmesa, then hw rendering using vendor-specific - # drivers is faster, but it must be done externally. - depends_on('opengl', when='~osmesa') + if sys.platform != 'darwin': + depends_on('glx', when='~osmesa') # Note: it is recommended to use mesa+llvm, if possible. # mesa default is software rendering, llvm makes it faster - depends_on('mesa', when='+osmesa') + depends_on('mesa+osmesa', when='+osmesa') # VTK will need Qt5OpenGL, and qt needs '-opengl' for that depends_on('qt+opengl', when='+qt')