From 1420fe276fe8f6450565e6239a675271c0869359 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 9 Jan 2025 16:08:50 +0100 Subject: [PATCH] [vtk,vtk-dicom,paraview] Fix/simplify python setup (#42717) --- ports/paraview/portfile.cmake | 10 ++++------ ports/paraview/vcpkg.json | 2 +- ports/vtk-dicom/portfile.cmake | 9 +++------ ports/vtk-dicom/vcpkg.json | 2 +- ports/vtk/portfile.cmake | 25 ++++++++++++------------- ports/vtk/vcpkg.json | 4 ++-- versions/baseline.json | 6 +++--- versions/p-/paraview.json | 5 +++++ versions/v-/vtk-dicom.json | 5 +++++ versions/v-/vtk.json | 5 +++++ 10 files changed, 41 insertions(+), 32 deletions(-) diff --git a/ports/paraview/portfile.cmake b/ports/paraview/portfile.cmake index 8456baa943dbb5..6651b251c4101b 100644 --- a/ports/paraview/portfile.cmake +++ b/ports/paraview/portfile.cmake @@ -103,17 +103,15 @@ file(COPY "${QTTESTING_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/ThirdParty/QtT file(COPY "${ICET_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/ThirdParty/IceT/vtkicet") if("python" IN_LIST FEATURES) + # This sections relies on target package python3. set(python_ver "") if(NOT VCPKG_TARGET_IS_WINDOWS) - file(GLOB _py3_include_path "${CURRENT_INSTALLED_DIR}/include/python3*") - string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path}) - set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}") - set(python_ver "3.${PYTHON_VERSION_MINOR}") + set(python_ver "3") endif() list(APPEND ADDITIONAL_OPTIONS -DPython3_FIND_REGISTRY=NEVER - "-DPython3_EXECUTABLE:PATH=${CURRENT_INSTALLED_DIR}/tools/python3/python${python_ver}${VCPKG_EXECUTABLE_SUFFIX}" - -DPARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX=${PYTHON3_SITE} + "-DPython3_EXECUTABLE:PATH=${CURRENT_INSTALLED_DIR}/tools/python3/python${python_ver}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" + "-DPARAVIEW_PYTHON_SITE_PACKAGES_SUFFIX=${PYTHON3_SITE}" # from vcpkg-port-config.cmake -DVTK_MODULE_ENABLE_ParaView_PythonCatalyst:STRING=YES ) endif() diff --git a/ports/paraview/vcpkg.json b/ports/paraview/vcpkg.json index 610ba1e5adb664..d443489d88e6f7 100644 --- a/ports/paraview/vcpkg.json +++ b/ports/paraview/vcpkg.json @@ -1,7 +1,7 @@ { "name": "paraview", "version": "5.12.1", - "port-version": 2, + "port-version": 3, "description": "VTK-based Data Analysis and Visualization Application", "homepage": "https://www.paraview.org/", "license": "BSD-3-Clause", diff --git a/ports/vtk-dicom/portfile.cmake b/ports/vtk-dicom/portfile.cmake index 9236d9cb626201..f6df5d1a244ab2 100644 --- a/ports/vtk-dicom/portfile.cmake +++ b/ports/vtk-dicom/portfile.cmake @@ -1,7 +1,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO dgobbi/vtk-dicom - REF cfeceadfa68d2cc3172632bd1fd3ea8a38b6c609 # v0.8.16 + REF cfeceadfa68d2cc3172632bd1fd3ea8a38b6c609 # v0.8.16 SHA512 0715ef91a1c585c9c819efd2bd6e2b73d3bff73a626b89f4877812fa6587e8379fb55ad99a376fb4d8dfa46c438e7a7052ba02ae61feb950cafb00c95df09b3f HEAD_REF master ) @@ -21,10 +21,7 @@ endif() set(python_ver "") if(NOT VCPKG_TARGET_IS_WINDOWS) - file(GLOB _py3_include_path "${CURRENT_HOST_INSTALLED_DIR}/include/python3*") - string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path}) - set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}") - set(python_ver "3.${PYTHON_VERSION_MINOR}") + set(python_ver "3") endif() vcpkg_cmake_configure( @@ -32,7 +29,7 @@ vcpkg_cmake_configure( OPTIONS -DBUILD_PROGRAMS=OFF -DBUILD_EXAMPLES=OFF - "-DPython3_EXECUTABLE:PATH=${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python${python_ver}${VCPKG_EXECUTABLE_SUFFIX}" + "-DPython3_EXECUTABLE:PATH=${CURRENT_HOST_INSTALLED_DIR}/tools/python3/python${python_ver}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" ${ADDITIONAL_OPTIONS} ) diff --git a/ports/vtk-dicom/vcpkg.json b/ports/vtk-dicom/vcpkg.json index dbdf91ec4ba190..0e6cf5485babd5 100644 --- a/ports/vtk-dicom/vcpkg.json +++ b/ports/vtk-dicom/vcpkg.json @@ -1,7 +1,7 @@ { "name": "vtk-dicom", "version": "0.8.16", - "port-version": 1, + "port-version": 2, "description": "DICOM for VTK", "homepage": "https://github.com/dgobbi/vtk-dicom", "license": "BSD-3-Clause", diff --git a/ports/vtk/portfile.cmake b/ports/vtk/portfile.cmake index aa237e3489085b..53956373855bc3 100644 --- a/ports/vtk/portfile.cmake +++ b/ports/vtk/portfile.cmake @@ -172,21 +172,19 @@ if("qt" IN_LIST FEATURES) endif() if("python" IN_LIST FEATURES) + # This sections relies on target package python3. set(python_ver "") if(NOT VCPKG_TARGET_IS_WINDOWS) - file(GLOB _py3_include_path "${CURRENT_INSTALLED_DIR}/include/python3*") - string(REGEX MATCH "python3\\.([0-9]+)" _python_version_tmp ${_py3_include_path}) - set(PYTHON_VERSION_MINOR "${CMAKE_MATCH_1}") - set(python_ver "3.${PYTHON_VERSION_MINOR}") + set(python_ver "3") endif() list(APPEND ADDITIONAL_OPTIONS -DVTK_WRAP_PYTHON=ON -DPython3_FIND_REGISTRY=NEVER - "-DPython3_EXECUTABLE:PATH=${CURRENT_INSTALLED_DIR}/tools/python3/python${python_ver}${VCPKG_EXECUTABLE_SUFFIX}" + "-DPython3_EXECUTABLE:PATH=${CURRENT_INSTALLED_DIR}/tools/python3/python${python_ver}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" -DVTK_MODULE_ENABLE_VTK_Python=YES -DVTK_MODULE_ENABLE_VTK_PythonContext2D=YES # TODO: recheck -DVTK_MODULE_ENABLE_VTK_PythonInterpreter=YES - -DVTK_PYTHON_SITE_PACKAGES_SUFFIX=${PYTHON3_SITE} + "-DVTK_PYTHON_SITE_PACKAGES_SUFFIX=${PYTHON3_SITE}" # from vcpkg-port-config.cmake ) #VTK_PYTHON_SITE_PACKAGES_SUFFIX should be set to the install dir of the site-packages endif() @@ -418,15 +416,16 @@ endforeach() # Use vcpkg provided find method file(REMOVE "${CURRENT_PACKAGES_DIR}/share/${PORT}/FindEXPAT.cmake") -file(RENAME "${CURRENT_PACKAGES_DIR}/share/licenses" "${CURRENT_PACKAGES_DIR}/share/${PORT}/licenses") - if(EXISTS "${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}/vtkChemistryConfigure.h") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/vtk-${VTK_SHORT_VERSION}/vtkChemistryConfigure.h" "${SOURCE_PATH}" "not/existing" IGNORE_UNCHANGED) endif() -# ============================================================================= -# Usage -configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) -# Handle copyright -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Copyright.txt") vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/vtk/VTK-vtk-module-properties.cmake" "_vtk_module_import_prefix}/lib/vtk-9.3/hierarchy" "_vtk_module_import_prefix}$<$:/debug>/lib/vtk-9.3/hierarchy") + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +file(RENAME "${CURRENT_PACKAGES_DIR}/share/licenses" "${CURRENT_PACKAGES_DIR}/share/${PORT}/licenses") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Copyright.txt" COMMENT [[ +This file presents the top-level Copyright.txt. +Additional licenses and notes are located in the licenses directory. +]]) diff --git a/ports/vtk/vcpkg.json b/ports/vtk/vcpkg.json index a60514f34176b2..903f95f30ffe68 100644 --- a/ports/vtk/vcpkg.json +++ b/ports/vtk/vcpkg.json @@ -1,10 +1,10 @@ { "name": "vtk", "version-semver": "9.3.0-pv5.12.1", - "port-version": 5, + "port-version": 6, "description": "Software system for 3D computer graphics, image processing, and visualization", "homepage": "https://github.com/Kitware/VTK", - "license": "BSD-3-Clause", + "license": null, "dependencies": [ "double-conversion", "eigen3", diff --git a/versions/baseline.json b/versions/baseline.json index 3a6de2bffbd620..57ab932fd9e356 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6910,7 +6910,7 @@ }, "paraview": { "baseline": "5.12.1", - "port-version": 2 + "port-version": 3 }, "parmetis": { "baseline": "2022-07-27", @@ -9538,11 +9538,11 @@ }, "vtk": { "baseline": "9.3.0-pv5.12.1", - "port-version": 5 + "port-version": 6 }, "vtk-dicom": { "baseline": "0.8.16", - "port-version": 1 + "port-version": 2 }, "vtk-m": { "baseline": "2.1.0", diff --git a/versions/p-/paraview.json b/versions/p-/paraview.json index cbcc7a8a4cf39a..8dc2d9dbc0e170 100644 --- a/versions/p-/paraview.json +++ b/versions/p-/paraview.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3938963da98238ff1f7d2054bfb8e7fae41fc55b", + "version": "5.12.1", + "port-version": 3 + }, { "git-tree": "44f6c15c7d9d433dd86de5546560c598e7922ec8", "version": "5.12.1", diff --git a/versions/v-/vtk-dicom.json b/versions/v-/vtk-dicom.json index 68884281b01545..65d7e8b9116055 100644 --- a/versions/v-/vtk-dicom.json +++ b/versions/v-/vtk-dicom.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e53703532b0212513a8604e7d613665841c307b5", + "version": "0.8.16", + "port-version": 2 + }, { "git-tree": "73df27ee23b96ebb4d9caad96c39f567f99ceb6f", "version": "0.8.16", diff --git a/versions/v-/vtk.json b/versions/v-/vtk.json index b7aa8d5110cb4b..148a4f66209421 100644 --- a/versions/v-/vtk.json +++ b/versions/v-/vtk.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5727b06657959909b4ffe7608c3d849acb38f286", + "version-semver": "9.3.0-pv5.12.1", + "port-version": 6 + }, { "git-tree": "99581eb538d39550007d25865540db2a368e3edb", "version-semver": "9.3.0-pv5.12.1",