From c9140a3b500812ad3206317885860d9553b93f13 Mon Sep 17 00:00:00 2001 From: jim wang <122244446+jimwang118@users.noreply.github.com> Date: Fri, 12 Jan 2024 07:53:34 +0800 Subject: [PATCH] [ktx] Update to v4.3.0-beta1 and fix unix2dos command does not exist (#36007) * update to v4.3.0-beta1 * update version * delete msys * update version * modify patch * update version * add pathc * update version * delete patch * update version * fix download method * update version * portfile * update version * portfile * update version --- ports/ktx/0001-Use-vcpkg-zstd.patch | 51 ++++++++++++++--------------- ports/ktx/0004-quirks.patch | 18 +++++----- ports/ktx/portfile.cmake | 5 ++- ports/ktx/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/k-/ktx.json | 5 +++ 6 files changed, 45 insertions(+), 38 deletions(-) diff --git a/ports/ktx/0001-Use-vcpkg-zstd.patch b/ports/ktx/0001-Use-vcpkg-zstd.patch index f74fe7e245b192..71a587bd6ed5f7 100644 --- a/ports/ktx/0001-Use-vcpkg-zstd.patch +++ b/ports/ktx/0001-Use-vcpkg-zstd.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0653da5..1265f3d 100644 +index 9a56491..d7ca937 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -265,7 +265,6 @@ set(KTX_MAIN_SRC +@@ -345,7 +345,6 @@ set(KTX_MAIN_SRC lib/basisu/transcoder/basisu_transcoder.cpp lib/basisu/transcoder/basisu_transcoder.h lib/basisu/transcoder/basisu.h @@ -10,15 +10,15 @@ index 0653da5..1265f3d 100644 lib/checkheader.c lib/dfdutils/createdfd.c lib/dfdutils/colourspaces.c -@@ -448,7 +447,6 @@ macro(common_libktx_settings target enable_write library_type) +@@ -532,7 +531,6 @@ macro(common_libktx_settings target enable_write library_type) $ $ - $ - $ - $ -@@ -538,6 +536,11 @@ macro(common_libktx_settings target enable_write library_type) + $ + $ +@@ -627,6 +625,11 @@ macro(common_libktx_settings target enable_write library_type) target_compile_definitions(${target} PUBLIC KTX_FEATURE_KTX2) endif() @@ -46,19 +46,20 @@ index 6386ba2..537bf4f 100644 include("${CMAKE_CURRENT_LIST_DIR}/KtxTargets.cmake") diff --git a/lib/basisu/CMakeLists.txt b/lib/basisu/CMakeLists.txt -index 492233a..2663169 100644 +index 492233a..152ceb5 100644 --- a/lib/basisu/CMakeLists.txt +++ b/lib/basisu/CMakeLists.txt -@@ -146,7 +146,7 @@ set(BASISU_SRC_LIST ${COMMON_SRC_LIST} +@@ -145,9 +145,6 @@ set(BASISU_SRC_LIST ${COMMON_SRC_LIST} + transcoder/basisu_transcoder.cpp ) - if (ZSTD) +-if (ZSTD) - set(BASISU_SRC_LIST ${BASISU_SRC_LIST} zstd/zstd.c) -+ set(ZSTD_LIBRARIES "$,zstd::libzstd_shared,zstd::libzstd_static>") - endif() +-endif() if (APPLE) -@@ -165,6 +165,10 @@ else() + set(BIN_DIRECTORY "bin_osx") +@@ -165,6 +162,10 @@ else() target_compile_definitions(basisu PRIVATE BASISD_SUPPORT_KTX2_ZSTD=0) endif() @@ -70,54 +71,52 @@ index 492233a..2663169 100644 # For Non-Windows builds, let cmake try and find the system OpenCL headers/libs for us. if (OPENCL_FOUND) diff --git a/lib/basisu/webgl/encoder/CMakeLists.txt b/lib/basisu/webgl/encoder/CMakeLists.txt -index 588d91b..edd7457 100644 +index 588d91b..a337b13 100644 --- a/lib/basisu/webgl/encoder/CMakeLists.txt +++ b/lib/basisu/webgl/encoder/CMakeLists.txt -@@ -34,9 +34,7 @@ if (EMSCRIPTEN) +@@ -34,9 +34,6 @@ if (EMSCRIPTEN) ) if (KTX2_ZSTANDARD) - set(SRC_LIST ${SRC_LIST} - ../../zstd/zstd.c - ) -+ set(ZSTD_LIBRARIES "$,zstd::libzstd_shared,zstd::libzstd_static>") set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=1) else() set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=0) -@@ -56,6 +54,10 @@ if (EMSCRIPTEN) +@@ -55,6 +52,10 @@ if (EMSCRIPTEN) + target_compile_options(basis_encoder.js PRIVATE -fno-strict-aliasing -O3) target_include_directories(basis_encoder.js PRIVATE ../../transcoder) - ++ + if(ZSTD_LIBRARIES) + target_link_libraries(basis_encoder.js ${ZSTD_LIBRARIES}) + endif() -+ + set_target_properties(basis_encoder.js PROPERTIES OUTPUT_NAME "basis_encoder" - SUFFIX ".js" diff --git a/lib/basisu/webgl/transcoder/CMakeLists.txt b/lib/basisu/webgl/transcoder/CMakeLists.txt -index 372653d..3c9ed0c 100644 +index 372653d..5ebc3cf 100644 --- a/lib/basisu/webgl/transcoder/CMakeLists.txt +++ b/lib/basisu/webgl/transcoder/CMakeLists.txt -@@ -28,9 +28,7 @@ if (EMSCRIPTEN) +@@ -28,9 +28,6 @@ if (EMSCRIPTEN) endif() if (KTX2_ZSTANDARD) - set(SRC_LIST ${SRC_LIST} - ../../zstd/zstddeclib.c - ) -+ set(ZSTD_LIBRARIES "$,zstd::libzstd_shared,zstd::libzstd_static>") set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=1) else() set(ZSTD_DEFINITION BASISD_SUPPORT_KTX2_ZSTD=0) -@@ -45,6 +43,10 @@ if (EMSCRIPTEN) +@@ -44,6 +41,10 @@ if (EMSCRIPTEN) + target_compile_definitions(basis_transcoder.js PRIVATE NDEBUG BASISD_SUPPORT_UASTC=1 BASISD_SUPPORT_BC7=1 BASISD_SUPPORT_ATC=0 BASISD_SUPPORT_ASTC_HIGHER_OPAQUE_QUALITY=0 BASISD_SUPPORT_PVRTC2=0 BASISD_SUPPORT_FXT1=0 BASISD_SUPPORT_ETC2_EAC_RG11=0 BASISU_SUPPORT_ENCODING=0 ${KTX2_DEFINITION} ${ZSTD_DEFINITION} ) target_compile_options(basis_transcoder.js PRIVATE -O3 -fno-strict-aliasing) target_include_directories(basis_transcoder.js PRIVATE ../../transcoder) - ++ + if(ZSTD_LIBRARIES) + target_link_libraries(basis_transcoder.js ${ZSTD_LIBRARIES}) + endif() -+ + set_target_properties(basis_transcoder.js PROPERTIES OUTPUT_NAME "basis_transcoder" - SUFFIX ".js" diff --git a/ports/ktx/0004-quirks.patch b/ports/ktx/0004-quirks.patch index f0692f5c72879a..afc34236dd99f8 100644 --- a/ports/ktx/0004-quirks.patch +++ b/ports/ktx/0004-quirks.patch @@ -1,17 +1,17 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9775c89..a4dfc2a 100644 +index 1500844..810914e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -235,7 +235,7 @@ include(cmake/mkvk.cmake) - # Global compile & link options including optimization flags - if(MSVC) - add_compile_options( /W4;/WX ) +@@ -263,7 +263,7 @@ if(MSVC) + # ";" argument separator is problematic. Can't use a GenEx `$:/WX> ) - add_compile_options( $,/Gz,/O2> ) + add_compile_options( $,,/O2> ) - elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" - OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") - add_compile_options(-Wall -Wextra -Werror) -@@ -851,6 +851,7 @@ if(EMSCRIPTEN) + # Enable UTF-8 support + add_compile_options( $<$:/utf-8> ) + add_compile_options( $<$:/utf-8> ) +@@ -946,6 +946,7 @@ if(EMSCRIPTEN) endif() add_library( objUtil STATIC diff --git a/ports/ktx/portfile.cmake b/ports/ktx/portfile.cmake index 854fb4cfd2a935..7a6d8edb108ed1 100644 --- a/ports/ktx/portfile.cmake +++ b/ports/ktx/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KhronosGroup/KTX-Software REF "v${VERSION}" - SHA512 9ef0100a402321b00faa822eb2a50fd0d1e17fa703edacdbacf9231484d911cc254aed1fa517988537dc5b7059921a793edaeb92e8b2965d25672cd9a2589a0f + SHA512 5a89f8986464705ec36ac1becaddd0ff335e4c3c235468aaef0e963fcfeda4c0d669a086b91e61c16a3ae9e1fa5bf456dccf12cc65720e1a22e7cc0f30552541 HEAD_REF master PATCHES 0001-Use-vcpkg-zstd.patch @@ -21,6 +21,9 @@ if(VCPKG_TARGET_IS_WINDOWS) # Required for "getopt" "https://repo.msys2.org/msys/x86_64/util-linux-2.35.2-3-x86_64.pkg.tar.zst" da26540881cd5734072717133307e5d1a27a60468d3656885507833b80f24088c5382eaa0234b30bdd9e8484a6638b4514623f5327f10b19eed36f12158e8edb + # Required for "dos2unix" + "https://mirror.msys2.org/msys/x86_64/dos2unix-7.5.1-1-x86_64.pkg.tar.zst" + 83d85e6ccea746ef9e8153a0d605e774dbe7efc0ee952804acfee4ffd7e3b0386a353b45ff989dd99bc3ce75968209fea3d246ad2af88bbb5c4eca12fc5a8f92 ) vcpkg_add_to_path("${MSYS_ROOT}/usr/bin") vcpkg_list(APPEND OPTIONS "-DBASH_EXECUTABLE=${MSYS_ROOT}/usr/bin/bash.exe") diff --git a/ports/ktx/vcpkg.json b/ports/ktx/vcpkg.json index 36bfc6b05cc575..b71850ef9c2f6e 100644 --- a/ports/ktx/vcpkg.json +++ b/ports/ktx/vcpkg.json @@ -1,6 +1,6 @@ { "name": "ktx", - "version-semver": "4.3.0-alpha3", + "version-semver": "4.3.0-beta1", "description": [ "The Khronos KTX library and tools.", "Functions for writing and reading KTX files, and instantiating OpenGL®, OpenGL ES™️ and Vulkan® textures from them." diff --git a/versions/baseline.json b/versions/baseline.json index 782185f40e283a..403ffea52715f3 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3957,7 +3957,7 @@ "port-version": 0 }, "ktx": { - "baseline": "4.3.0-alpha3", + "baseline": "4.3.0-beta1", "port-version": 0 }, "kubazip": { diff --git a/versions/k-/ktx.json b/versions/k-/ktx.json index 7883f0191f9f10..8ed84c6a48231b 100644 --- a/versions/k-/ktx.json +++ b/versions/k-/ktx.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e5d9ea81aabca83f512d64a46fd545d353552034", + "version-semver": "4.3.0-beta1", + "port-version": 0 + }, { "git-tree": "47559725520a0015829f65dfda7f3b28a7a7d78f", "version-semver": "4.3.0-alpha3",