diff --git a/ports/zlib-ng/portfile.cmake b/ports/zlib-ng/portfile.cmake index 62dfbcb823..3b0fc717b9 100644 --- a/ports/zlib-ng/portfile.cmake +++ b/ports/zlib-ng/portfile.cmake @@ -17,6 +17,34 @@ vcpkg_cmake_configure( ) vcpkg_cmake_install() vcpkg_copy_pdbs() + +# Condition in `WIN32`, from https://github.com/zlib-ng/zlib-ng/blob/2.1.5/CMakeLists.txt#L1081-L1100 +# (dynamic) for `zlib` or (static `MSVC) for `zlibstatic` or default `z` +# i.e. (windows) and not (static mingw) https://learn.microsoft.com/en-us/vcpkg/maintainers/variables#vcpkg_target_is_system +if(VCPKG_TARGET_IS_WINDOWS AND (NOT (VCPKG_LIBRARY_LINKAGE STREQUAL static AND VCPKG_TARGET_IS_MINGW))) + set(_port_suffix) + if(ZLIB_COMPAT) + set(_port_suffix "") + else() + set(_port_suffix "-ng") + endif() + + set(_port_output_name) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + set(_port_output_name "zlib${_port_suffix}") + else() + set(_port_output_name "zlibstatic${_port_suffix}") + endif() + + # CMAKE_DEBUG_POSTFIX from https://github.com/zlib-ng/zlib-ng/blob/2.1.5/CMakeLists.txt#L494 + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/zlib${_port_suffix}.pc" " -lz${_port_suffix}" " -l${_port_output_name}") + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/zlib${_port_suffix}.pc" " -lz${_port_suffix}" " -l${_port_output_name}d") + endif() +endif() + vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" diff --git a/ports/zlib-ng/vcpkg.json b/ports/zlib-ng/vcpkg.json index 3305006132..c1cebd7350 100644 --- a/ports/zlib-ng/vcpkg.json +++ b/ports/zlib-ng/vcpkg.json @@ -1,6 +1,7 @@ { "name": "zlib-ng", "version": "2.1.5", + "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 904fa5270a..e78598b8c5 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -9686,7 +9686,7 @@ }, "zlib-ng": { "baseline": "2.1.5", - "port-version": 0 + "port-version": 1 }, "zlmediakit": { "baseline": "2024-03-30", diff --git a/versions/z-/zlib-ng.json b/versions/z-/zlib-ng.json index f1c5cef7b4..3679e6d34c 100644 --- a/versions/z-/zlib-ng.json +++ b/versions/z-/zlib-ng.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3f7c39c070cb4f55a281ebe3a178b4f7e896dea8", + "version": "2.1.5", + "port-version": 1 + }, { "git-tree": "e612211a2cf602a9a95796202f9cba452c6f5ebc", "version": "2.1.5",