From da86e89b6198a45c8a8f45b3c812511a704991c8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:31:25 +0800 Subject: [PATCH] Update dependency zlib to v1.3.1 (#233) * Update dependency zlib to v1.3.1 * fix zlib * fix sha * fix * Update zlib.patch * Update zlib.patch --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: anakinxc <103552181+anakinxc@users.noreply.github.com> --- bazel/patches/zlib.patch | 89 +++++++++------------------------------- bazel/repositories.bzl | 6 +-- 2 files changed, 22 insertions(+), 73 deletions(-) diff --git a/bazel/patches/zlib.patch b/bazel/patches/zlib.patch index 0c5314b5..efeaed42 100644 --- a/bazel/patches/zlib.patch +++ b/bazel/patches/zlib.patch @@ -1,68 +1,16 @@ -diff --git a/gzlib.c b/gzlib.c -index 29fc448..9bbf509 100644 ---- a/gzlib.c -+++ b/gzlib.c -@@ -579,4 +579,9 @@ unsigned ZLIB_INTERNAL gz_intmax(void) { - } while (p > q); - return q >> 1; - } -+#else -+unsigned ZLIB_INTERNAL gz_intmax() -+{ -+ return INT_MAX; -+} - #endif diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7f1b69f..7bd357b 100644 +index 15ceebe..1d19c83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -15,7 +15,6 @@ include(CheckTypeSize) +@@ -17,7 +17,6 @@ include(CheckTypeSize) include(CheckFunctionExists) include(CheckIncludeFile) include(CheckCSourceCompiles) -enable_testing() - + check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(stdint.h HAVE_STDINT_H) -@@ -147,35 +146,15 @@ if(MINGW) - set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) - 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}) --set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) --set_target_properties(zlib PROPERTIES SOVERSION 1) -- --if(NOT CYGWIN) -- # This property causes shared libraries on Linux to have the full version -- # encoded into their final filename. We disable this on Cygwin because -- # it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll -- # seems to be the default. -- # -- # This has no effect with MSVC, on that platform the version info for -- # the DLL comes from the resource file win32/zlib1.rc -- set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION}) --endif() - - if(UNIX) - # On unix-like platforms the library is almost always called libz -- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) -- if(NOT APPLE) -- set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") -- endif() --elseif(BUILD_SHARED_LIBS AND WIN32) -- # Creates zlib1.dll when building shared library version -- set_target_properties(zlib PROPERTIES SUFFIX "1.dll") -+ set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME z) - endif() - - if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) -- install(TARGETS zlib zlibstatic -+ install(TARGETS zlibstatic - RUNTIME DESTINATION "${INSTALL_BIN_DIR}" - ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) -@@ -189,25 +168,3 @@ endif() +@@ -193,26 +192,3 @@ endif() if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) install(FILES ${ZLIB_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") endif() @@ -70,21 +18,22 @@ index 7f1b69f..7bd357b 100644 -#============================================================================ -# Example binaries -#============================================================================ +-if(ZLIB_BUILD_EXAMPLES) +- add_executable(example test/example.c) +- target_link_libraries(example zlib) +- add_test(example example) - --add_executable(example test/example.c) --target_link_libraries(example zlib) --add_test(example example) -- --add_executable(minigzip test/minigzip.c) --target_link_libraries(minigzip zlib) +- add_executable(minigzip test/minigzip.c) +- target_link_libraries(minigzip zlib) - --if(HAVE_OFF64_T) -- add_executable(example64 test/example.c) -- target_link_libraries(example64 zlib) -- set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") -- add_test(example64 example64) +- if(HAVE_OFF64_T) +- add_executable(example64 test/example.c) +- target_link_libraries(example64 zlib) +- set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") +- add_test(example64 example64) - -- add_executable(minigzip64 test/minigzip.c) -- target_link_libraries(minigzip64 zlib) -- set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") +- add_executable(minigzip64 test/minigzip.c) +- target_link_libraries(minigzip64 zlib) +- set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") +- endif() -endif() diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index d9b2532c..6ac18844 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -128,13 +128,13 @@ def _com_github_madler_zlib(): http_archive, name = "zlib", build_file = "@yacl//bazel:zlib.BUILD", - strip_prefix = "zlib-1.3", - sha256 = "b5b06d60ce49c8ba700e0ba517fa07de80b5d4628a037f4be8ad16955be7a7c0", + strip_prefix = "zlib-1.3.1", + sha256 = "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c", type = ".tar.gz", patch_args = ["-p1"], patches = ["@yacl//bazel:patches/zlib.patch"], urls = [ - "https://github.com/madler/zlib/archive/refs/tags/v1.3.tar.gz", + "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz", ], )