From 3a7ee5613c81f5a49316948eeb0e304a14dfb50a Mon Sep 17 00:00:00 2001 From: Don Olmstead Date: Thu, 9 Jan 2025 15:51:44 -0800 Subject: [PATCH] [zlib-ng] Support zlib compatibility mode (#43147) Co-authored-by: Kai Pastor --- ports/zlib-ng/portfile.cmake | 14 +++++++++++++- ports/zlib-ng/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/z-/zlib-ng.json | 5 +++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ports/zlib-ng/portfile.cmake b/ports/zlib-ng/portfile.cmake index 0cf0cab291540e..aa31597c45792f 100644 --- a/ports/zlib-ng/portfile.cmake +++ b/ports/zlib-ng/portfile.cmake @@ -6,12 +6,18 @@ vcpkg_from_github( HEAD_REF develop ) +# Set ZLIB_COMPAT in the triplet file to turn on +if(NOT DEFINED ZLIB_COMPAT) + set(ZLIB_COMPAT OFF) +endif() + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS "-DZLIB_FULL_VERSION=${ZLIB_FULL_VERSION}" -DZLIB_ENABLE_TESTS=OFF -DWITH_NEW_STRATEGIES=ON + -DZLIB_COMPAT=${ZLIB_COMPAT} OPTIONS_RELEASE -DWITH_OPTIM=ON ) @@ -46,7 +52,13 @@ if(VCPKG_TARGET_IS_WINDOWS AND (NOT (VCPKG_LIBRARY_LINKAGE STREQUAL static AND V endif() vcpkg_fixup_pkgconfig() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zlib-ng) + +if(ZLIB_COMPAT) + set(_cmake_dir "ZLIB") +else() + set(_cmake_dir "zlib-ng") +endif() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${_cmake_dir}) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include" diff --git a/ports/zlib-ng/vcpkg.json b/ports/zlib-ng/vcpkg.json index e2060ba992e1eb..7a3eac2fca0aed 100644 --- a/ports/zlib-ng/vcpkg.json +++ b/ports/zlib-ng/vcpkg.json @@ -1,6 +1,7 @@ { "name": "zlib-ng", "version": "2.2.3", + "port-version": 1, "description": "zlib replacement with optimizations for 'next generation' systems", "homepage": "https://github.com/zlib-ng/zlib-ng", "license": "Zlib", diff --git a/versions/baseline.json b/versions/baseline.json index 57ab932fd9e356..b528e477b63a91 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -10014,7 +10014,7 @@ }, "zlib-ng": { "baseline": "2.2.3", - "port-version": 0 + "port-version": 1 }, "zlmediakit": { "baseline": "2024-09-29", diff --git a/versions/z-/zlib-ng.json b/versions/z-/zlib-ng.json index 4666b0260cc498..2a823f8d0c2aac 100644 --- a/versions/z-/zlib-ng.json +++ b/versions/z-/zlib-ng.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8282d357a50be706405e9aed44a79a333a8e8af1", + "version": "2.2.3", + "port-version": 1 + }, { "git-tree": "ed44efd13b274af9870aaf05424d1f1b9558b230", "version": "2.2.3",