zlib: update to 1.3.2

Release Notes:
https://github.com/madler/zlib/blob/v1.3.2/ChangeLog

We also switch package tarball source to GitHub repository releases
to avoid package hash mismatch after the zstd upgrade.

The 005-* patch was suppressed by the upstream commit 15ba5055a935
("CMake: Adapt pkgconfig-file to the GnuInstallDirs layout.")

This patch also adjust the zlib.pc file path as it was changed in
the latest release.

The mipsel_24kc 'zlib' package size will increase by about 1 kB.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21228
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Shiji Yang 2025-12-19 23:59:05 +08:00 committed by Hauke Mehrtens
parent 518d711461
commit 9413a3d96d
3 changed files with 32 additions and 52 deletions

View file

@ -8,13 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=zlib
PKG_VERSION:=1.3.1
PKG_VERSION:=1.3.2
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/madler/zlib
PKG_SOURCE_VERSION:=51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf
PKG_MIRROR_HASH:=6558577038f4839057fad93afb295bf32e84dc9bd2c33512d40a5eab6d4889ef
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/madler/zlib/releases/download/v$(PKG_VERSION)
PKG_HASH:=d7a0654783a4da529d1bb793b7ad9c3318020af77667bcae35f95d0e42a792f3
PKG_LICENSE:=Zlib
PKG_LICENSE_FILES:=LICENSE
@ -71,7 +70,7 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \
$(1)/usr/lib/
mkdir -p $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
$(1)/usr/lib/pkgconfig/
endef
@ -91,7 +90,7 @@ define Package/zlib-dev/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.a $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \
$(1)/usr/lib/pkgconfig/
endef

View file

@ -1,9 +1,9 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,34 +93,67 @@ set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
zlib.h
)
@@ -121,33 +121,64 @@ configure_file(${zlib_BINARY_DIR}/zconf.
set(ZLIB_PUBLIC_HDRS ${zlib_BINARY_DIR}/zconf.h zlib.h)
-set(ZLIB_PRIVATE_HDRS
- crc32.h
- deflate.h
@ -13,8 +13,20 @@
- inflate.h
- inftrees.h
- trees.h
- zutil.h
-)
- zutil.h)
+if(ARMv8)
+ set(ZLIB_PRIVATE_HDRS
+ crc32.h
+ deflate.h
+ gzguts.h
+ inffast.h
+ inffixed.h
+ inflate.h
+ inftrees.h
+ trees.h
+ zutil.h
+ contrib/arm/chunkcopy.h)
-set(ZLIB_SRCS
- adler32.c
- compress.c
@ -30,22 +42,7 @@
- inffast.c
- trees.c
- uncompr.c
- zutil.c
-)
+
+if(ARMv8)
+ set(ZLIB_PRIVATE_HDRS
+ crc32.h
+ deflate.h
+ gzguts.h
+ inffast.h
+ inffixed.h
+ inflate.h
+ inftrees.h
+ trees.h
+ zutil.h
+ contrib/arm/chunkcopy.h
+ )
- zutil.c)
+ set(ZLIB_SRCS
+ adler32.c
+ compress.c
@ -61,9 +58,8 @@
+ contrib/arm/inffast.c
+ trees.c
+ uncompr.c
+ zutil.c
+ )
+ else()
+ zutil.c)
+else()
+ set(ZLIB_PRIVATE_HDRS
+ crc32.h
+ deflate.h
@ -73,8 +69,8 @@
+ inflate.h
+ inftrees.h
+ trees.h
+ zutil.h
+ )
+ zutil.h)
+
+ set(ZLIB_SRCS
+ adler32.c
+ compress.c
@ -90,9 +86,8 @@
+ inffast.c
+ trees.c
+ uncompr.c
+ zutil.c
+ )
+ zutil.c)
+endif()
if(NOT MINGW)
set(ZLIB_DLL_SRCS
if(WIN32)
set(zlib_static_suffix "s")

View file

@ -1,14 +0,0 @@
--- a/zlib.pc.cmakein
+++ b/zlib.pc.cmakein
@@ -1,8 +1,8 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@INSTALL_LIB_DIR@
-sharedlibdir=@INSTALL_LIB_DIR@
-includedir=@INSTALL_INC_DIR@
+libdir=${exec_prefix}/lib
+sharedlibdir=${exec_prefix}/lib
+includedir=${prefix}/include
Name: zlib
Description: zlib compression library