Browse Source

contrib: zlib: update to 1.3.2

Version 1.3.2 has these key changes:

- Address the findings of the just-completed 7ASecurity audit
- Completely rewrite the cmake support (thanks to @Vollstrecker)
- Support non-blocking devices with the gz* functions
- Many other enhancements, fixes, and portability improvements

https://github.com/madler/zlib/releases/tag/v1.3.2
pull/200/head
Steve Lhomme 1 month ago
parent
commit
4d18efb430
  1. 42
      contrib/src/zlib/0001-CMakeList.txt-force-static-library-name-to-z.patch
  2. 2
      contrib/src/zlib/SHA512SUMS
  3. 10
      contrib/src/zlib/rules.mak

42
contrib/src/zlib/0001-CMakeList.txt-force-static-library-name-to-z.patch

@ -1,34 +1,32 @@
From 32e97d1efafa48d81c3d019d7d5fe7083a812768 Mon Sep 17 00:00:00 2001
From 2a425593750d2056fb45ee452835cbebb0c060a9 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 12 Feb 2024 20:39:05 +0100
Subject: [PATCH] CMakeList.txt: force static library name to `z`
They build code in a UNIX like environment but CMake doesn't set UNIX
for it.
In contribs, we can always enforce this value.
Co-authored-by: Alexandre Janniaux <ajanni@videolabs.io>
Otherwise it doesn't match the name in the pkg-config file.
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
CMakeLists.txt | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15ceebe..c952cde 100644
index e103c40..438ec64 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,9 +167,9 @@ if(NOT CYGWIN)
set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
endif()
@@ -149,10 +149,10 @@ set(ZLIB_SRCS
uncompr.c
zutil.c)
-if(WIN32)
- set(zlib_static_suffix "s")
- set(CMAKE_DEBUG_POSTFIX "d")
-endif(WIN32)
+# if(WIN32)
+# set(zlib_static_suffix "s")
+# set(CMAKE_DEBUG_POSTFIX "d")
+# endif(WIN32)
+# On unix-like platforms the library is almost always called libz
+set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z)
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 AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))
set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"")
endif()
if(ZLIB_BUILD_SHARED)
add_library(
--
2.43.0
2.52.0.windows.1

2
contrib/src/zlib/SHA512SUMS

@ -1 +1 @@
1e8e70b362d64a233591906a1f50b59001db04ca14aaffad522198b04680be501736e7d536b4191e2f99767e7001ca486cd802362cca2be05d5d409b83ea732d zlib-1.3.1.tar.xz
cf3d49fbabddc57cca99858feeca8f910e9de42a16014cddd406814d2d24ee33fee2af3805d7efbb1b04b05f55818092b000daf82502b675df65f2512c353f73 zlib-1.3.2.tar.xz

10
contrib/src/zlib/rules.mak

@ -1,5 +1,5 @@
# ZLIB
ZLIB_VERSION := 1.3.1
ZLIB_VERSION := 1.3.2
ZLIB_URL := $(GITHUB)/madler/zlib/releases/download/v$(ZLIB_VERSION)/zlib-$(ZLIB_VERSION).tar.xz
PKGS += zlib
@ -15,15 +15,9 @@ $(TARBALLS)/zlib-$(ZLIB_VERSION).tar.xz:
zlib: zlib-$(ZLIB_VERSION).tar.xz .sum-zlib
$(UNPACK)
$(APPLY) $(SRC)/zlib/0001-CMakeList.txt-force-static-library-name-to-z.patch
# disable the installation of the dynamic library since there's no option
sed -e 's,install(TARGETS zlib zlibstatic,install(TARGETS zlibstatic,' -i.orig $(UNPACK_DIR)/CMakeLists.txt
# only use the proper libz name for the static library
sed -e 's,set_target_properties(zlib zlibstatic ,set_target_properties(zlibstatic ,' -i.orig $(UNPACK_DIR)/CMakeLists.txt
# don't use --version-script on static libraries
sed -e 's,if(NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX)),if(BUILD_SHARED_LIBS AND (NOT APPLE AND NOT(CMAKE_SYSTEM_NAME STREQUAL AIX))),' -i.orig $(UNPACK_DIR)/CMakeLists.txt
$(MOVE)
ZLIB_CONF = -DINSTALL_PKGCONFIG_DIR:STRING=$(PREFIX)/lib/pkgconfig -DZLIB_BUILD_EXAMPLES=OFF
ZLIB_CONF = -DZLIB_BUILD_SHARED=OFF -DZLIB_BUILD_EXAMPLES=OFF -DZLIB_BUILD_TESTING=OFF
.zlib: zlib toolchain.cmake
$(CMAKECLEAN)

Loading…
Cancel
Save