From aac8d52075b26e66582b7b09b8594c07971a88d7 Mon Sep 17 00:00:00 2001
From: sknigh <sknigh@sandia.gov>
Date: Wed, 10 Oct 2018 14:57:28 -0700
Subject: [PATCH]  vtk: added v8.1.1, added option to disable libharu (#9475)

* Added VTK 8.1.1, added option to disable libharu
* Add variant description to vtk+libharu
---
 var/spack/repos/builtin/packages/vtk/package.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py
index 4f1d88f2ee..b71c38485f 100644
--- a/var/spack/repos/builtin/packages/vtk/package.py
+++ b/var/spack/repos/builtin/packages/vtk/package.py
@@ -36,6 +36,7 @@ class Vtk(CMakePackage):
     url      = "http://www.vtk.org/files/release/8.0/VTK-8.0.1.tar.gz"
     list_url = "http://www.vtk.org/download/"
 
+    version('8.1.1', sha256='71a09b4340f0a9c58559fe946dc745ab68a866cf20636a41d97b6046cb736324')
     version('8.0.1', '692d09ae8fadc97b59d35cab429b261a')
     version('7.1.0', 'a7e814c1db503d896af72458c2d0228f')
     version('7.0.0', '5fe35312db5fb2341139b8e4955c367d')
@@ -48,6 +49,10 @@ class Vtk(CMakePackage):
     variant('python', default=False, description='Enable Python support')
     variant('qt', default=False, description='Build with support for Qt')
 
+    # Haru causes trouble on Fedora and Ubuntu in v8.1.1
+    # See https://bugzilla.redhat.com/show_bug.cgi?id=1460059#c13
+    variant('haru', default=True, description='Enable libharu')
+
     patch('gcc.patch', when='@6.1.0')
 
     # At the moment, we cannot build with both osmesa and qt, but as of
@@ -69,13 +74,14 @@ class Vtk(CMakePackage):
     # VTK will need Qt5OpenGL, and qt needs '-opengl' for that
     depends_on('qt+opengl', when='+qt')
 
+    depends_on('libharu', when='+haru')
+
     depends_on('expat')
     depends_on('freetype')
     depends_on('glew')
     depends_on('hdf5')
     depends_on('libjpeg')
     depends_on('jsoncpp')
-    depends_on('libharu')
     depends_on('libxml2')
     depends_on('lz4')
     depends_on('netcdf')
@@ -104,6 +110,9 @@ def cmake_args(self):
             '-DBUILD_SHARED_LIBS=ON',
             '-DVTK_RENDERING_BACKEND:STRING={0}'.format(opengl_ver),
 
+            '-DVTK_USE_SYSTEM_LIBHARU=%s' % (
+                'ON' if '+haru' in spec else 'OFF'),
+
             # In general, we disable use of VTK "ThirdParty" libs, preferring
             # spack-built versions whenever possible
             '-DVTK_USE_SYSTEM_LIBRARIES=ON',
-- 
GitLab