[zlib] update to 1.3.1 (#36395)

* [zlib] update to version 1.3.1

* [zlib] adapt patches

* [zlib] regenerate version info

* [zlib] remove version workaround

* [zlib] regenerate version info

* CI
This commit is contained in:
Carsten Grimm 2024-01-30 21:58:10 +01:00 committed by GitHub
parent 81e65f7120
commit 7233110263
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 24 additions and 38 deletions

View File

@ -1,8 +1,7 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f46c8e6..6fa5575 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,9 +121,11 @@ set(ZLIB_SRCS
@@ -123,9 +123,11 @@ set(ZLIB_SRCS
)
if(NOT MINGW)
@ -14,7 +13,7 @@ index f46c8e6..6fa5575 100644
endif()
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
@@ -144,13 +146,16 @@ if(MINGW)
@@ -146,15 +148,17 @@ if(MINGW)
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
@ -24,8 +23,10 @@ index f46c8e6..6fa5575 100644
endif(MINGW)
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
-target_include_directories(zlibstatic PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+if (BUILD_SHARED_LIBS)
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)
@ -33,21 +34,21 @@ index f46c8e6..6fa5575 100644
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
@@ -165,7 +170,7 @@ endif()
@@ -169,7 +173,7 @@ endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
if(NOT APPLE)
if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
@@ -175,7 +180,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
@@ -179,7 +183,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32)
endif()
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
- install(TARGETS zlib zlibstatic
+ install(TARGETS zlib
+ install(TARGETS zlib
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" )

View File

@ -1,17 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b412dc7..f46c8e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,6 +194,7 @@ endif()
# Example binaries
#============================================================================
+if (0)
add_executable(example test/example.c)
target_link_libraries(example zlib)
add_test(example example)
@@ -211,3 +212,4 @@ if(HAVE_OFF64_T)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
+endif()

View File

@ -1,8 +1,7 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6fa5575..7c345db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,7 +56,7 @@ endif()
@@ -58,7 +58,7 @@ endif()
#
check_include_file(unistd.h Z_HAVE_UNISTD_H)
@ -11,7 +10,7 @@ index 6fa5575..7c345db 100644
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
@@ -133,7 +133,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
@@ -135,7 +135,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
@ -20,7 +19,7 @@ index 6fa5575..7c345db 100644
# This gets us DLL resource information when compiling on MinGW.
if(NOT CMAKE_RC_COMPILER)
set(CMAKE_RC_COMPILER windres.exe)
@@ -149,7 +149,7 @@ if(MINGW)
@@ -151,7 +151,7 @@ if(MINGW)
if(BUILD_SHARED_LIBS)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif()
@ -28,4 +27,4 @@ index 6fa5575..7c345db 100644
+endif(MINGW AND NOT ANDROID)
add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
if (BUILD_SHARED_LIBS)
target_include_directories(zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -3,13 +3,12 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO madler/zlib
REF v${VERSION}
SHA512 78eecf335b14af1f7188c039a4d5297b74464d61156e4f12a485c74beec7d62c4159584ad482a07ec57ae2616d58873e45b09cb8ea822bb5b17e43d163df84e9
SHA512 8c9642495bafd6fad4ab9fb67f09b268c69ff9af0f4f20cf15dfc18852ff1f312bd8ca41de761b3f8d8e90e77d79f2ccacd3d4c5b19e475ecf09d021fdfe9088
HEAD_REF master
PATCHES
0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
0002-skip-building-examples.patch
0003-build-static-or-shared-not-both.patch
0004-android-and-mingw-fixes.patch
0002-build-static-or-shared-not-both.patch
0003-android-and-mingw-fixes.patch
)
# This is generated during the cmake build
@ -19,6 +18,7 @@ vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DSKIP_INSTALL_FILES=ON
-DZLIB_BUILD_EXAMPLES=OFF
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
)
@ -49,7 +49,5 @@ else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zconf.h" "ifdef ZLIB_DLL" "if 1")
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zlib.h" "#define ZLIB_VERSION \"1.3\"" "#define ZLIB_VERSION \"1.3.0\"")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,6 +1,6 @@
{
"name": "zlib",
"version": "1.3",
"version": "1.3.1",
"description": "A compression library",
"homepage": "https://www.zlib.net/",
"license": "Zlib",

View File

@ -9473,7 +9473,7 @@
"port-version": 3
},
"zlib": {
"baseline": "1.3",
"baseline": "1.3.1",
"port-version": 0
},
"zlib-ng": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3f05e04b9aededb96786a911a16193cdb711f0c9",
"version": "1.3.1",
"port-version": 0
},
{
"git-tree": "5ac18c6e6e3e2bf5a9e3d0bc8a845f198e4c4e05",
"version": "1.3",