Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zlib] update to 1.3.1 #36395

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand All @@ -24,30 +23,32 @@ 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)
+endif()

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}" )
17 changes: 0 additions & 17 deletions ports/zlib/0002-skip-building-examples.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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})

Expand All @@ -20,12 +19,12 @@ 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()
-endif(MINGW)
+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})
10 changes: 4 additions & 6 deletions ports/zlib/portfile.cmake
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove line 52 (ZLIB_VERSION is already 1.3.1 not 1.3):
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zlib.h" "#define ZLIB_VERSION \"1.3\"" "#define ZLIB_VERSION \"1.3.0\"")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this. I have removed the workaround.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion ports/zlib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zlib",
"version": "1.3",
"version": "1.3.1",
"description": "A compression library",
"homepage": "https://www.zlib.net/",
"license": "Zlib",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9473,7 +9473,7 @@
"port-version": 3
},
"zlib": {
"baseline": "1.3",
"baseline": "1.3.1",
"port-version": 0
},
"zlib-ng": {
Expand Down
5 changes: 5 additions & 0 deletions versions/z-/zlib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3f05e04b9aededb96786a911a16193cdb711f0c9",
"version": "1.3.1",
"port-version": 0
},
{
"git-tree": "5ac18c6e6e3e2bf5a9e3d0bc8a845f198e4c4e05",
"version": "1.3",
Expand Down
Loading