diff --git a/var/spack/repos/builtin/packages/gxsview/package.py b/var/spack/repos/builtin/packages/gxsview/package.py index ea45246d1c..a041847752 100644 --- a/var/spack/repos/builtin/packages/gxsview/package.py +++ b/var/spack/repos/builtin/packages/gxsview/package.py @@ -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):