Skip to content

Commit

Permalink
VTK package: patch to fix NetCDFC - HDF5 interface (spack#43087)
Browse files Browse the repository at this point in the history
Patch from Windows is also needed on Linux
  • Loading branch information
johnwparent authored Aug 22, 2024
1 parent 8e1bd9a commit f19b657
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
7 changes: 3 additions & 4 deletions var/spack/repos/builtin/packages/netcdf-c/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NetcdfC(CMakePackage, AutotoolsPackage):
# no upstream PR (or set of PRs) covering all changes in this path.
# When #2595 lands, this patch should be updated to include only
# the changes not incorporated into that PR
patch("netcdfc_correct_and_export_link_interface.patch", when="platform=windows")
patch("netcdfc_correct_and_export_link_interface.patch")

# Some of the patches touch configure.ac and, therefore, require forcing the autoreconf stage:
_force_autoreconf_when = []
Expand Down Expand Up @@ -359,19 +359,18 @@ def cmake_args(self):
@run_after("install")
def patch_hdf5_pkgconfigcmake(self):
"""
Incorrect hdf5 library names are put in the package config and config.cmake files
Incorrect hdf5 library names are put in the package config files
due to incorrectly using hdf5 target names
https://github.com/spack/spack/pull/42878
"""
if sys.platform == "win32":
return

pkgconfig_file = find(self.prefix, "netcdf.pc", recursive=True)
cmakeconfig_file = find(self.prefix, "netCDFTargets.cmake", recursive=True)
ncconfig_file = find(self.prefix, "nc-config", recursive=True)
settingsconfig_file = find(self.prefix, "libnetcdf.settings", recursive=True)

files = pkgconfig_file + cmakeconfig_file + ncconfig_file + settingsconfig_file
files = pkgconfig_file + ncconfig_file + settingsconfig_file
config = "shared" if self.spec.satisfies("+shared") else "static"
filter_file(f"hdf5-{config}", "hdf5", *files, ignore_absent=True)
filter_file(f"hdf5_hl-{config}", "hdf5_hl", *files, ignore_absent=True)
Expand Down
13 changes: 10 additions & 3 deletions var/spack/repos/builtin/packages/vtk/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Vtk(CMakePackage):
url = "https://www.vtk.org/files/release/9.0/VTK-9.0.0.tar.gz"
list_url = "https://www.vtk.org/download/"

maintainers("danlipsa", "vicentebolea")
maintainers("chuckatkins", "danlipsa", "johnwparent")

license("BSD-3-Clause")

Expand Down Expand Up @@ -131,10 +131,17 @@ class Vtk(CMakePackage):
patch("vtk_movie_link_ogg.patch", when="@8.2")
patch("vtk_use_sqlite_name_vtk_expects.patch", when="@8.2")
patch("vtk_proj_include_no_strict.patch", when="@9: platform=windows")
# allow proj to be detected via a CMake produced export config file
# failing that, falls back on standard library detection
# required for VTK to build against modern proj/more robustly
patch("vtk_findproj_config.patch", when="@9:")
# adds a fake target alias'ing the hdf5 target to prevent
# checks for that target from falling on VTK's empty stub target
# Required to consume netcdf and hdf5 both built
# with CMake from VTK
# a patch with the same name is also applied to paraview
# the two patches are the same but for the path to the files they patch
patch("vtk_alias_hdf5.patch", when="@9: platform=windows")
patch("vtk_findproj_config.patch", when="platform=windows")
patch("vtk_alias_hdf5.patch", when="@9:")
depends_on("libxt", when="^[virtuals=gl] glx platform=linux")

# VTK will need Qt5OpenGL, and qt needs '-opengl' for that
Expand Down

0 comments on commit f19b657

Please sign in to comment.