gxsview: compiles against system qt and vtk on rhel8 (#43722)

* gxsview: compiles againts system qt and vtk on rhel8
* Update gxsview/package.py for blanks around operator
* Update gxsview/package.py import blank line
* Update gxsview/package.py for style
* Update gxsview/package.py checking vtk version
This commit is contained in:
Olivier Cessenat 2024-04-18 18:18:05 +02:00 committed by GitHub
parent f406f27d9c
commit c69951d6e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack.package import *
@ -51,11 +53,25 @@ def qmake_args(self):
vtk_suffix = self.spec["vtk"].version.up_to(2)
vtk_lib_dir = self.spec["vtk"].prefix.lib
vtk_include_dir = join_path(self.spec["vtk"].prefix.include, "vtk-{0}".format(vtk_suffix))
args = [
"VTK_LIB_DIR={0}".format(vtk_lib_dir),
"VTK_INC_DIR={0}".format(vtk_include_dir),
"VTK_MAJOR_VER={0}".format(str(vtk_suffix)),
]
args = []
if not os.path.exists(vtk_include_dir):
vtk_include_dir = join_path(self.spec["vtk"].prefix.include, "vtk")
args.append("VTK_NO_VER_SUFFIX=ON")
args.extend(
[
"VTK_LIB_DIR={0}".format(vtk_lib_dir),
"VTK_INC_DIR={0}".format(vtk_include_dir),
"VTK_MAJOR_VER={0}".format(str(vtk_suffix)),
]
)
# Below to avoid undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
if self.spec.satisfies("%gcc@8.0:8.9") or self.spec.satisfies("%fj"):
if "^vtk@9:" in self.spec:
fic = "vtk9.pri"
else:
fic = "vtk8.pri"
with open(fic, "a") as fh:
fh.write("-lstdc++fs\n")
return args
def install(self, spec, prefix):