From 333ba63a16024f05f9172fe403f9eced000389e5 Mon Sep 17 00:00:00 2001 From: DownerCase <119755054+DownerCase@users.noreply.github.com> Date: Wed, 14 Aug 2024 04:27:07 +0100 Subject: [PATCH] [vtk]: Convert dependencies into default features (#40279) --- ports/opencv3/vcpkg.json | 7 +- ports/opencv4/vcpkg.json | 7 +- ports/pcl/vcpkg.json | 6 +- ports/vtk/no-libharu-for-ioexport.patch | 12 +++ ports/vtk/no-libproj-for-netcdf.patch | 24 +++++ ports/vtk/portfile.cmake | 53 ++++++++++ ports/vtk/vcpkg.json | 135 ++++++++++++++++++------ versions/baseline.json | 8 +- versions/o-/opencv3.json | 5 + versions/o-/opencv4.json | 5 + versions/p-/pcl.json | 5 + versions/v-/vtk.json | 5 + 12 files changed, 232 insertions(+), 40 deletions(-) create mode 100644 ports/vtk/no-libharu-for-ioexport.patch create mode 100644 ports/vtk/no-libproj-for-netcdf.patch diff --git a/ports/opencv3/vcpkg.json b/ports/opencv3/vcpkg.json index 64eb00a625ee2d..6e3ecb3ba62660 100644 --- a/ports/opencv3/vcpkg.json +++ b/ports/opencv3/vcpkg.json @@ -1,7 +1,7 @@ { "name": "opencv3", "version": "3.4.18", - "port-version": 15, + "port-version": 16, "description": "Open Source Computer Vision Library", "homepage": "https://github.com/opencv/opencv", "license": "BSD-3-Clause", @@ -300,7 +300,10 @@ "contrib" ] }, - "vtk" + { + "name": "vtk", + "default-features": false + } ] }, "webp": { diff --git a/ports/opencv4/vcpkg.json b/ports/opencv4/vcpkg.json index 2236adc1b1bef4..6e8623676f0972 100644 --- a/ports/opencv4/vcpkg.json +++ b/ports/opencv4/vcpkg.json @@ -1,7 +1,7 @@ { "name": "opencv4", "version": "4.8.0", - "port-version": 21, + "port-version": 22, "description": "computer vision library", "homepage": "https://github.com/opencv/opencv", "license": "Apache-2.0", @@ -372,7 +372,10 @@ "contrib" ] }, - "vtk" + { + "name": "vtk", + "default-features": false + } ] }, "vulkan": { diff --git a/ports/pcl/vcpkg.json b/ports/pcl/vcpkg.json index 9275983e61a1da..988a6fffef93cc 100644 --- a/ports/pcl/vcpkg.json +++ b/ports/pcl/vcpkg.json @@ -1,6 +1,7 @@ { "name": "pcl", "version": "1.14.1", + "port-version": 1, "description": "Point Cloud Library (PCL) is open source library for 2D/3D image and point cloud processing.", "homepage": "https://github.com/PointCloudLibrary/pcl", "license": "BSD-3-Clause", @@ -55,8 +56,7 @@ "description": "CUDA support for PCL", "supports": "x64", "dependencies": [ - "cuda", - "vtk" + "cuda" ] }, "examples": { @@ -115,6 +115,7 @@ "dependencies": [ { "name": "vtk", + "default-features": false, "features": [ "qt" ] @@ -152,6 +153,7 @@ "dependencies": [ { "name": "vtk", + "default-features": false, "features": [ "opengl" ] diff --git a/ports/vtk/no-libharu-for-ioexport.patch b/ports/vtk/no-libharu-for-ioexport.patch new file mode 100644 index 00000000000000..1a659d1004f00b --- /dev/null +++ b/ports/vtk/no-libharu-for-ioexport.patch @@ -0,0 +1,12 @@ +diff --git a/IO/Export/vtk.module b/IO/Export/vtk.module +index 01b18a48..dcac24c0 100644 +--- a/IO/Export/vtk.module ++++ b/IO/Export/vtk.module +@@ -36,7 +36,6 @@ PRIVATE_DEPENDS + VTK::IOGeometry + VTK::ImagingCore + VTK::nlohmannjson +- VTK::libharu + VTK::utf8 + TEST_DEPENDS + VTK::ChartsCore diff --git a/ports/vtk/no-libproj-for-netcdf.patch b/ports/vtk/no-libproj-for-netcdf.patch new file mode 100644 index 00000000000000..e7f1085b01cf3f --- /dev/null +++ b/ports/vtk/no-libproj-for-netcdf.patch @@ -0,0 +1,24 @@ +diff --git a/IO/NetCDF/vtk.module b/IO/NetCDF/vtk.module +index a0cc0741..07f3606b 100644 +--- a/IO/NetCDF/vtk.module ++++ b/IO/NetCDF/vtk.module +@@ -26,7 +26,6 @@ PRIVATE_DEPENDS + VTK::CommonDataModel + VTK::netcdf + VTK::vtksys +- VTK::libproj + TEST_DEPENDS + VTK::CommonExecutionModel + VTK::FiltersGeometry +diff --git a/IO/NetCDF/vtkNetCDFCFWriter.cxx b/IO/NetCDF/vtkNetCDFCFWriter.cxx +index 756ff87..d71de89 100644 +--- a/IO/NetCDF/vtkNetCDFCFWriter.cxx ++++ b/IO/NetCDF/vtkNetCDFCFWriter.cxx +@@ -33,7 +33,6 @@ + #include + #include + +-#include "vtk_libproj.h" + #include "vtk_netcdf.h" + + VTK_ABI_NAMESPACE_BEGIN diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index 81c9ee054d17e4..aa237e3489085b 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -37,6 +37,8 @@ vcpkg_from_github( remove-prefix-changes.patch hdf5helper.patch opencascade-7.8.0.patch + no-libharu-for-ioexport.patch + no-libproj-for-netcdf.patch ) # ============================================================================= @@ -120,6 +122,38 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS VTK_FEATURE_OPTIONS "gdal" VTK_MODULE_ENABLE_VTK_IOGDAL "geojson" VTK_MODULE_ENABLE_VTK_IOGeoJSON "ioocct" VTK_MODULE_ENABLE_VTK_IOOCCT + "libtheora" VTK_MODULE_ENABLE_VTK_IOOggTheora + "libharu" VTK_MODULE_ENABLE_VTK_IOExportPDF + "cgns" VTK_MODULE_ENABLE_VTK_IOCGNSReader + "seacas" VTK_MODULE_ENABLE_VTK_IOIOSS + "seacas" VTK_MODULE_ENABLE_VTK_IOExodus + "sql" VTK_MODULE_ENABLE_VTK_IOSQL + "proj" VTK_MODULE_ENABLE_VTK_IOCesium3DTiles + "proj" VTK_MODULE_ENABLE_VTK_GeovisCore + "netcdf" VTK_MODULE_ENABLE_VTK_IONetCDF + "netcdf" VTK_MODULE_ENABLE_VTK_IOMINC +) + +# Require port features to prevent accidental finding of transitive dependencies +vcpkg_check_features(OUT_FEATURE_OPTIONS PACKAGE_FEATURE_OPTIONS + FEATURES + "libtheora" CMAKE_REQUIRE_FIND_PACKAGE_THEORA + "libharu" CMAKE_REQUIRE_FIND_PACKAGE_LibHaru + "cgns" CMAKE_REQUIRE_FIND_PACKAGE_CGNS + "seacas" CMAKE_REQUIRE_FIND_PACKAGE_SEACASIoss + "seacas" CMAKE_REQUIRE_FIND_PACKAGE_SEACASExodus + "sql" CMAKE_REQUIRE_FIND_PACKAGE_SQLite3 + "proj" CMAKE_REQUIRE_FIND_PACKAGE_PROJ + "netcdf" CMAKE_REQUIRE_FIND_PACKAGE_NetCDF + INVERTED_FEATURES + "libtheora" CMAKE_DISABLE_FIND_PACKAGE_THEORA + "libharu" CMAKE_DISABLE_FIND_PACKAGE_LibHaru + "cgns" CMAKE_DISABLE_FIND_PACKAGE_CGNS + "seacas" CMAKE_DISABLE_FIND_PACKAGE_SEACASIoss + "seacas" CMAKE_DISABLE_FIND_PACKAGE_SEACASExodus + "sql" CMAKE_DISABLE_FIND_PACKAGE_SQLite3 + "proj" CMAKE_DISABLE_FIND_PACKAGE_PROJ + "netcdf" CMAKE_DISABLE_FIND_PACKAGE_NetCDF ) # Replace common value to vtk value @@ -227,6 +261,7 @@ vcpkg_cmake_configure( OPTIONS ${FEATURE_OPTIONS} ${VTK_FEATURE_OPTIONS} + ${PACKAGE_FEATURE_OPTIONS} -DBUILD_TESTING=OFF -DVTK_BUILD_TESTING=OFF -DVTK_BUILD_EXAMPLES=OFF @@ -254,6 +289,24 @@ vcpkg_cmake_configure( VTK_MODULE_ENABLE_VTK_GUISupportMFC # only windows VTK_QT_VERSION # Only with Qt CMAKE_INSTALL_QMLDIR + # When working properly these should be unused + CMAKE_DISABLE_FIND_PACKAGE_CGNS + CMAKE_DISABLE_FIND_PACKAGE_LibHaru + CMAKE_DISABLE_FIND_PACKAGE_NetCDF + CMAKE_DISABLE_FIND_PACKAGE_PROJ + CMAKE_DISABLE_FIND_PACKAGE_SEACASExodus + CMAKE_DISABLE_FIND_PACKAGE_SEACASIoss + CMAKE_DISABLE_FIND_PACKAGE_SQLite3 + CMAKE_DISABLE_FIND_PACKAGE_THEORA + CMAKE_REQUIRE_FIND_PACKAGE_CGNS + CMAKE_REQUIRE_FIND_PACKAGE_LibHaru + CMAKE_REQUIRE_FIND_PACKAGE_NetCDF + CMAKE_REQUIRE_FIND_PACKAGE_PROJ + CMAKE_REQUIRE_FIND_PACKAGE_SEACASExodus + CMAKE_REQUIRE_FIND_PACKAGE_SEACASIoss + CMAKE_REQUIRE_FIND_PACKAGE_SQLite3 + CMAKE_REQUIRE_FIND_PACKAGE_THEORA + ) vcpkg_cmake_install() diff --git a/ports/vtk/vcpkg.json b/ports/vtk/vcpkg.json index 2561b316ae19a7..2f33a51cc2e7ed 100644 --- a/ports/vtk/vcpkg.json +++ b/ports/vtk/vcpkg.json @@ -1,7 +1,7 @@ { "name": "vtk", "version-semver": "9.3.0-pv5.12.1", - "port-version": 3, + "port-version": 4, "description": "Software system for 3D computer graphics, image processing, and visualization", "homepage": "https://github.com/Kitware/VTK", "license": "BSD-3-Clause", @@ -28,15 +28,9 @@ ] }, "jsoncpp", - { - "name": "libharu", - "version>=": "2.4.3" - }, "libjpeg-turbo", "liblzma", - "libogg", "libpng", - "libtheora", { "name": "libxml2", "default-features": false, @@ -45,28 +39,9 @@ ] }, "lz4", - { - "name": "netcdf-c", - "default-features": false, - "features": [ - "hdf5" - ] - }, + "nlohmann-json", "pegtl", - { - "name": "proj", - "default-features": false - }, "pugixml", - { - "name": "seacas", - "default-features": false - }, - "sqlite3", - { - "name": "sqlite3", - "host": true - }, { "name": "tiff", "default-features": false @@ -83,6 +58,15 @@ "verdict", "zlib" ], + "default-features": [ + "cgns", + "libharu", + "libtheora", + "netcdf", + "proj", + "seacas", + "sql" + ], "features": { "all": { "description": "Build all vtk modules", @@ -93,11 +77,18 @@ "name": "vtk", "default-features": false, "features": [ + "cgns", "gdal", "geojson", + "libharu", + "libtheora", "mpi", + "netcdf", + "proj", "python", - "qt" + "qt", + "seacas", + "sql" ] }, { @@ -120,6 +111,15 @@ } ] }, + "cgns": { + "description": "CGNS functionality for VTK", + "dependencies": [ + { + "name": "cgns", + "default-features": false + } + ] + }, "cuda": { "description": "Support CUDA compilation", "dependencies": [ @@ -147,6 +147,21 @@ } ] }, + "libharu": { + "description": "PDF functionality for VTK", + "dependencies": [ + { + "name": "libharu", + "version>=": "2.4.3" + } + ] + }, + "libtheora": { + "description": "Compressed ogg functionality for VTK", + "dependencies": [ + "libtheora" + ] + }, "mpi": { "description": "MPI functionality for VTK", "dependencies": [ @@ -181,6 +196,18 @@ } ] }, + "netcdf": { + "description": "NetCDF functionality for VTK", + "dependencies": [ + { + "name": "netcdf-c", + "default-features": false, + "features": [ + "hdf5" + ] + } + ] + }, "opengl": { "description": "All opengl related modules", "dependencies": [ @@ -213,12 +240,30 @@ "name": "vtk", "default-features": false, "features": [ - "atlmfc" + "atlmfc", + "libtheora", + "seacas" ], "platform": "windows" } ] }, + "proj": { + "description": "Geographic projection functionality for VTK", + "dependencies": [ + { + "name": "proj", + "default-features": false + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "sql" + ] + } + ] + }, "python": { "description": "Python functionality for VTK", "dependencies": [ @@ -238,7 +283,37 @@ "widgets" ] }, - "qtdeclarative" + "qtdeclarative", + { + "name": "vtk", + "default-features": false, + "features": [ + "sql" + ] + } + ] + }, + "seacas": { + "description": "Exodus and IOSS functionality for VTK", + "dependencies": [ + { + "name": "seacas", + "default-features": false + }, + { + "name": "vtk", + "default-features": false, + "features": [ + "cgns", + "netcdf" + ] + } + ] + }, + "sql": { + "description": "SQL functionality for VTK", + "dependencies": [ + "sqlite3" ] }, "utf8": { diff --git a/versions/baseline.json b/versions/baseline.json index 13098749c37c00..3b612168c5aa46 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6534,11 +6534,11 @@ }, "opencv3": { "baseline": "3.4.18", - "port-version": 15 + "port-version": 16 }, "opencv4": { "baseline": "4.8.0", - "port-version": 21 + "port-version": 22 }, "opendnp3": { "baseline": "3.1.1", @@ -6806,7 +6806,7 @@ }, "pcl": { "baseline": "1.14.1", - "port-version": 0 + "port-version": 1 }, "pcre": { "baseline": "8.45", @@ -9350,7 +9350,7 @@ }, "vtk": { "baseline": "9.3.0-pv5.12.1", - "port-version": 3 + "port-version": 4 }, "vtk-dicom": { "baseline": "0.8.14", diff --git a/versions/o-/opencv3.json b/versions/o-/opencv3.json index faf381a4a8e219..df0ed7a783a23e 100644 --- a/versions/o-/opencv3.json +++ b/versions/o-/opencv3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "77a77ff352a1fa7d9271ea206e706929bfd2faff", + "version": "3.4.18", + "port-version": 16 + }, { "git-tree": "5d13125fc5a48e77592a3d66b8716012d79425ca", "version": "3.4.18", diff --git a/versions/o-/opencv4.json b/versions/o-/opencv4.json index 74228cc03dacea..919c43d623fb40 100644 --- a/versions/o-/opencv4.json +++ b/versions/o-/opencv4.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f1c14acfbb673af2479af39dd8424c8f151752ad", + "version": "4.8.0", + "port-version": 22 + }, { "git-tree": "946d30019e6bcb9e6043c4b18a9dbe1b719694af", "version": "4.8.0", diff --git a/versions/p-/pcl.json b/versions/p-/pcl.json index 3b728f577d10eb..cfae35ca899a96 100644 --- a/versions/p-/pcl.json +++ b/versions/p-/pcl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e55506ffdfffe9bc2104eadddea53dde27686a8d", + "version": "1.14.1", + "port-version": 1 + }, { "git-tree": "d21fc9ad60ee928ee8d65084b278b7254ea02cab", "version": "1.14.1", diff --git a/versions/v-/vtk.json b/versions/v-/vtk.json index c3f0dc1748e25c..0a815812baf87e 100644 --- a/versions/v-/vtk.json +++ b/versions/v-/vtk.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f66a99e8c041f8e084d2871c3cc1d48146ca90f0", + "version-semver": "9.3.0-pv5.12.1", + "port-version": 4 + }, { "git-tree": "dbdb5ecd3e43e28d167883d384b471f65eb59012", "version-semver": "9.3.0-pv5.12.1",