VTK package: patch to fix NetCDFC - HDF5 interface (#43087)

Patch from Windows is also needed on Linux
This commit is contained in:
John W. Parent 2024-08-22 12:48:13 -04:00 committed by GitHub
parent 8e1bd9a403
commit f19b657235
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 7 deletions

View File

@ -66,7 +66,7 @@ class NetcdfC(CMakePackage, AutotoolsPackage):
# no upstream PR (or set of PRs) covering all changes in this path. # no upstream PR (or set of PRs) covering all changes in this path.
# When #2595 lands, this patch should be updated to include only # When #2595 lands, this patch should be updated to include only
# the changes not incorporated into that PR # 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: # Some of the patches touch configure.ac and, therefore, require forcing the autoreconf stage:
_force_autoreconf_when = [] _force_autoreconf_when = []
@ -359,7 +359,7 @@ def cmake_args(self):
@run_after("install") @run_after("install")
def patch_hdf5_pkgconfigcmake(self): 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 due to incorrectly using hdf5 target names
https://github.com/spack/spack/pull/42878 https://github.com/spack/spack/pull/42878
""" """
@ -367,11 +367,10 @@ def patch_hdf5_pkgconfigcmake(self):
return return
pkgconfig_file = find(self.prefix, "netcdf.pc", recursive=True) 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) ncconfig_file = find(self.prefix, "nc-config", recursive=True)
settingsconfig_file = find(self.prefix, "libnetcdf.settings", 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" config = "shared" if self.spec.satisfies("+shared") else "static"
filter_file(f"hdf5-{config}", "hdf5", *files, ignore_absent=True) filter_file(f"hdf5-{config}", "hdf5", *files, ignore_absent=True)
filter_file(f"hdf5_hl-{config}", "hdf5_hl", *files, ignore_absent=True) filter_file(f"hdf5_hl-{config}", "hdf5_hl", *files, ignore_absent=True)

View File

@ -20,7 +20,7 @@ class Vtk(CMakePackage):
url = "https://www.vtk.org/files/release/9.0/VTK-9.0.0.tar.gz" url = "https://www.vtk.org/files/release/9.0/VTK-9.0.0.tar.gz"
list_url = "https://www.vtk.org/download/" list_url = "https://www.vtk.org/download/"
maintainers("danlipsa", "vicentebolea") maintainers("chuckatkins", "danlipsa", "johnwparent")
license("BSD-3-Clause") license("BSD-3-Clause")
@ -131,10 +131,17 @@ class Vtk(CMakePackage):
patch("vtk_movie_link_ogg.patch", when="@8.2") patch("vtk_movie_link_ogg.patch", when="@8.2")
patch("vtk_use_sqlite_name_vtk_expects.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") 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 # 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 # 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_alias_hdf5.patch", when="@9:")
patch("vtk_findproj_config.patch", when="platform=windows")
depends_on("libxt", when="^[virtuals=gl] glx platform=linux") depends_on("libxt", when="^[virtuals=gl] glx platform=linux")
# VTK will need Qt5OpenGL, and qt needs '-opengl' for that # VTK will need Qt5OpenGL, and qt needs '-opengl' for that