2022-10-26 01:24:48 +08:00
|
|
|
# When this port is updated, the minizip port should be updated at the same time
|
2022-05-10 07:12:37 +08:00
|
|
|
vcpkg_from_github(
|
2019-03-01 15:53:42 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2022-05-10 07:12:37 +08:00
|
|
|
REPO madler/zlib
|
2023-08-25 07:38:15 +08:00
|
|
|
REF v${VERSION}
|
|
|
|
SHA512 78eecf335b14af1f7188c039a4d5297b74464d61156e4f12a485c74beec7d62c4159584ad482a07ec57ae2616d58873e45b09cb8ea822bb5b17e43d163df84e9
|
2022-05-10 07:12:37 +08:00
|
|
|
HEAD_REF master
|
2017-09-24 15:03:34 +08:00
|
|
|
PATCHES
|
2022-05-10 07:12:37 +08:00
|
|
|
0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
|
2022-10-26 01:24:48 +08:00
|
|
|
0002-skip-building-examples.patch
|
|
|
|
0003-build-static-or-shared-not-both.patch
|
|
|
|
0004-android-and-mingw-fixes.patch
|
2017-09-24 15:03:34 +08:00
|
|
|
)
|
|
|
|
|
2018-03-02 03:39:37 +08:00
|
|
|
# This is generated during the cmake build
|
2022-05-10 07:12:37 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/zconf.h")
|
2018-03-02 03:39:37 +08:00
|
|
|
|
2022-05-10 07:12:37 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
|
|
|
-DSKIP_INSTALL_FILES=ON
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSKIP_INSTALL_HEADERS=ON
|
|
|
|
)
|
|
|
|
|
2022-05-10 07:12:37 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2020-07-17 04:53:55 +08:00
|
|
|
# Install the pkgconfig file
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2022-05-10 07:12:37 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc" "-lz" "-lzlib")
|
2020-07-17 04:53:55 +08:00
|
|
|
endif()
|
2022-05-10 07:12:37 +08:00
|
|
|
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
|
2020-07-17 04:53:55 +08:00
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2022-05-10 07:12:37 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc" "-lz" "-lzlibd")
|
2020-07-17 04:53:55 +08:00
|
|
|
endif()
|
2022-05-10 07:12:37 +08:00
|
|
|
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
|
2020-07-17 04:53:55 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2017-11-17 15:54:55 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-10-26 01:24:48 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zconf.h" "ifdef ZLIB_DLL" "if 0")
|
|
|
|
else()
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zconf.h" "ifdef ZLIB_DLL" "if 1")
|
|
|
|
endif()
|
|
|
|
|
2023-08-25 07:38:15 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zlib.h" "#define ZLIB_VERSION \"1.3\"" "#define ZLIB_VERSION \"1.3.0\"")
|
|
|
|
|
2022-05-10 07:12:37 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-10-26 01:24:48 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|