From 9e240455e334364f5ee4484e5072f789275aea5e Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Fri, 31 Jan 2025 22:42:46 +1100 Subject: [PATCH] Update ktx overlay port to match cesium-native's. --- .../ports/ktx/0005-no-vendored-libs.patch | 6 ++-- .../ports/ktx/0006-fix-ios-install.patch | 22 ++++++++++++++ .../ktx/CESIUM-0002-not-a-framework.patch | 17 ----------- .../CESIUM-0003-ios-normal-header-path.patch | 30 ------------------- native~/vcpkg/ports/ktx/portfile.cmake | 15 ++++------ native~/vcpkg/ports/ktx/vcpkg.json | 5 ++-- 6 files changed, 33 insertions(+), 62 deletions(-) create mode 100644 native~/vcpkg/ports/ktx/0006-fix-ios-install.patch delete mode 100644 native~/vcpkg/ports/ktx/CESIUM-0002-not-a-framework.patch delete mode 100644 native~/vcpkg/ports/ktx/CESIUM-0003-ios-normal-header-path.patch diff --git a/native~/vcpkg/ports/ktx/0005-no-vendored-libs.patch b/native~/vcpkg/ports/ktx/0005-no-vendored-libs.patch index 77cdd851..4c900225 100644 --- a/native~/vcpkg/ports/ktx/0005-no-vendored-libs.patch +++ b/native~/vcpkg/ports/ktx/0005-no-vendored-libs.patch @@ -1,10 +1,10 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index d7ca937..ffcbe95 100644 +index e99fb143..0f69adf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1059,10 +1059,10 @@ endif() - # except for building the ktx library. +@@ -1071,10 +1071,10 @@ endif() if((KTX_FEATURE_TOOLS OR KTX_FEATURE_TESTS) AND NOT TARGET fmt::fmt) + set(FMT_INSTALL OFF) set(FMT_SYSTEM_HEADERS ON) - add_subdirectory(other_projects/fmt) + find_package(fmt CONFIG REQUIRED) diff --git a/native~/vcpkg/ports/ktx/0006-fix-ios-install.patch b/native~/vcpkg/ports/ktx/0006-fix-ios-install.patch new file mode 100644 index 00000000..0af3fea6 --- /dev/null +++ b/native~/vcpkg/ports/ktx/0006-fix-ios-install.patch @@ -0,0 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e99fb143..072ea889 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -489,7 +489,7 @@ macro(common_libktx_settings target enable_write library_type) + CXX_STANDARD_REQUIRED YES + + ) +- if(IOS) ++ if(0) + set_target_properties(${target} PROPERTIES + FRAMEWORK TRUE + ) +@@ -1145,7 +1145,7 @@ endif() + # Use of this to install KHR/khr_df.h is due to CMake's failure to + # preserve the include source folder hierarchy. + # See https://gitlab.kitware.com/cmake/cmake/-/issues/16739. +-if (IOS) ++if (0) + set_source_files_properties( + include/KHR/khr_df.h + PROPERTIES MACOSX_PACKAGE_LOCATION Headers/KHR diff --git a/native~/vcpkg/ports/ktx/CESIUM-0002-not-a-framework.patch b/native~/vcpkg/ports/ktx/CESIUM-0002-not-a-framework.patch deleted file mode 100644 index 4458110f..00000000 --- a/native~/vcpkg/ports/ktx/CESIUM-0002-not-a-framework.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7b13753..b62b849 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -474,9 +474,9 @@ macro(common_libktx_settings target enable_write library_type) - - ) - if(IOS) -- set_target_properties(${target} PROPERTIES -- FRAMEWORK TRUE -- ) -+# set_target_properties(${target} PROPERTIES -+# FRAMEWORK TRUE -+# ) - endif() - - if( NOT ${library_type} STREQUAL STATIC ) diff --git a/native~/vcpkg/ports/ktx/CESIUM-0003-ios-normal-header-path.patch b/native~/vcpkg/ports/ktx/CESIUM-0003-ios-normal-header-path.patch deleted file mode 100644 index 6ad9c977..00000000 --- a/native~/vcpkg/ports/ktx/CESIUM-0003-ios-normal-header-path.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b62b849..d8c4745 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1133,18 +1133,18 @@ endif() - # Use of this to install KHR/khr_df.h is due to CMake's failure to - # preserve the include source folder hierarchy. - # See https://gitlab.kitware.com/cmake/cmake/-/issues/16739. --if (IOS) -- set_source_files_properties( -- include/KHR/khr_df.h -- PROPERTIES MACOSX_PACKAGE_LOCATION Headers/KHR -- ) --else() -+# if (IOS) -+# set_source_files_properties( -+# include/KHR/khr_df.h -+# PROPERTIES MACOSX_PACKAGE_LOCATION Headers/KHR -+# ) -+# else() - include(GNUInstallDirs) - install(FILES include/KHR/khr_df.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/KHR - COMPONENT dev - ) --endif() -+# endif() - - install(EXPORT KTXTargets - FILE KtxTargets.cmake diff --git a/native~/vcpkg/ports/ktx/portfile.cmake b/native~/vcpkg/ports/ktx/portfile.cmake index 40c64bbf..887362c8 100644 --- a/native~/vcpkg/ports/ktx/portfile.cmake +++ b/native~/vcpkg/ports/ktx/portfile.cmake @@ -1,18 +1,17 @@ -vcpkg_from_github( +vcpkg_from_git( OUT_SOURCE_PATH SOURCE_PATH - REPO KhronosGroup/KTX-Software - REF "v${VERSION}" - SHA512 5a89f8986464705ec36ac1becaddd0ff335e4c3c235468aaef0e963fcfeda4c0d669a086b91e61c16a3ae9e1fa5bf456dccf12cc65720e1a22e7cc0f30552541 - HEAD_REF master + URL "https://github.com/KhronosGroup/KTX-Software.git" + REF 91ace88675ac59a97e55d0378a6602a9ae6b98bd + FETCH_REF "v${VERSION}" + HEAD_REF main PATCHES 0001-Use-vcpkg-zstd.patch 0002-Fix-versioning.patch 0003-mkversion.patch 0004-quirks.patch 0005-no-vendored-libs.patch + 0006-fix-ios-install.patch CESIUM-0001-do-not-define-_DEBUG.patch - CESIUM-0002-not-a-framework.patch - CESIUM-0003-ios-normal-header-path.patch ) file(REMOVE "${SOURCE_PATH}/other_include/zstd_errors.h") @@ -50,8 +49,6 @@ vcpkg_cmake_configure( -DKTX_FEATURE_STATIC_LIBRARY=${ENABLE_STATIC} ${FEATURE_OPTIONS} ${OPTIONS} - # Do not regenerate headers (needs more dependencies) - -DCMAKE_DISABLE_FIND_PACKAGE_Vulkan=1 DISABLE_PARALLEL_CONFIGURE ) diff --git a/native~/vcpkg/ports/ktx/vcpkg.json b/native~/vcpkg/ports/ktx/vcpkg.json index 102e2813..94eea841 100644 --- a/native~/vcpkg/ports/ktx/vcpkg.json +++ b/native~/vcpkg/ports/ktx/vcpkg.json @@ -1,7 +1,6 @@ { "name": "ktx", - "version-semver": "4.3.0-beta1", - "port-version": 1, + "version-semver": "4.3.2", "description": [ "The Khronos KTX library and tools.", "Functions for writing and reading KTX files, and instantiating OpenGL®, OpenGL ES™️ and Vulkan® textures from them." @@ -23,7 +22,7 @@ "features": { "tools": { "description": "Build tools", - "supports": "!android", + "supports": "!android & !uwp", "dependencies": [ "cxxopts", "fmt"