This is an automated email from the ASF dual-hosted git repository.

twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new ac66ad5a4 build: replace zlib with zlib-ng for rocksdb compression 
(#3003)
ac66ad5a4 is described below

commit ac66ad5a4b7c97c9fcf93889846a317588cf51f8
Author: Twice <[email protected]>
AuthorDate: Sun Jun 1 16:31:37 2025 +0800

    build: replace zlib with zlib-ng for rocksdb compression (#3003)
    
    Signed-off-by: PragmaTwice <[email protected]>
---
 NOTICE                                             |  2 +-
 cmake/modules/FindZLIB.cmake                       |  4 ++--
 cmake/zlib.cmake                                   | 12 +++++++++---
 licenses/{LICENSE-zlib.txt => LICENSE-zlib-ng.txt} | 14 ++++++++------
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/NOTICE b/NOTICE
index d87bf7922..6e5d60a73 100644
--- a/NOTICE
+++ b/NOTICE
@@ -88,7 +88,7 @@ zlib/libpng licenses
 The following components are provided under the zlib/libpng License. See 
project link for details.
 The text of each license is also included in licenses/LICENSE-[project].txt
 
-* zlib(https://github.com/madler/zlib)
+* zlib-ng(https://github.com/zlib-ng/zlib-ng)
 
 ================================================================
 Public Domain
diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake
index 1fa8982fa..53c2269be 100644
--- a/cmake/modules/FindZLIB.cmake
+++ b/cmake/modules/FindZLIB.cmake
@@ -22,7 +22,7 @@ if(zlib_SOURCE_DIR)
 
   add_library(zlib_with_headers INTERFACE) # rocksdb use it
   target_include_directories(zlib_with_headers INTERFACE 
$<BUILD_INTERFACE:${zlib_SOURCE_DIR}> $<BUILD_INTERFACE:${zlib_BINARY_DIR}>)
-  target_link_libraries(zlib_with_headers INTERFACE zlibstatic)
+  target_link_libraries(zlib_with_headers INTERFACE zlib)
   add_library(ZLIB::ZLIB ALIAS zlib_with_headers)
-  install(TARGETS zlibstatic zlib_with_headers EXPORT RocksDBTargets) # export 
for install(...)
+  install(TARGETS zlib zlib_with_headers EXPORT RocksDBTargets) # export for 
install(...)
 endif()
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
index e92cd543b..bc7ef713f 100644
--- a/cmake/zlib.cmake
+++ b/cmake/zlib.cmake
@@ -20,8 +20,14 @@ include_guard()
 include(cmake/utils.cmake)
 
 FetchContent_DeclareGitHubWithMirror(zlib
-  madler/zlib v1.3
-  MD5=2be1b77674e5aa3196330e58180e5a2c
+  zlib-ng/zlib-ng 2.2.4
+  MD5=9fbaac3919af8d5a0ad5726ef9c7c30b
 )
 
-FetchContent_MakeAvailableWithArgs(zlib)
+FetchContent_MakeAvailableWithArgs(zlib
+  WITH_GTEST=OFF
+  ZLIB_ENABLE_TESTS=OFF
+  ZLIBNG_ENABLE_TESTS=OFF
+  BUILD_SHARED_LIBS=OFF
+  ZLIB_COMPAT=ON
+)
diff --git a/licenses/LICENSE-zlib.txt b/licenses/LICENSE-zlib-ng.txt
similarity index 59%
rename from licenses/LICENSE-zlib.txt
rename to licenses/LICENSE-zlib-ng.txt
index 56fa36f24..e866d7ac1 100644
--- a/licenses/LICENSE-zlib.txt
+++ b/licenses/LICENSE-zlib-ng.txt
@@ -1,7 +1,7 @@
-(C) 1995-2022 Jean-loup Gailly and Mark Adler
+(C) 1995-2024 Jean-loup Gailly and Mark Adler
 
 This software is provided 'as-is', without any express or implied
-warranty.  In no event will the authors be held liable for any damages
+warranty. In no event will the authors be held liable for any damages
 arising from the use of this software.
 
 Permission is granted to anyone to use this software for any purpose,
@@ -9,9 +9,11 @@ including commercial applications, and to alter it and 
redistribute it
 freely, subject to the following restrictions:
 
 1. The origin of this software must not be misrepresented; you must not
-    claim that you wrote the original software. If you use this software
-    in a product, an acknowledgment in the product documentation would be
-    appreciated but is not required.
+   claim that you wrote the original software. If you use this software
+   in a product, an acknowledgment in the product documentation would be
+   appreciated but is not required.
+
 2. Altered source versions must be plainly marked as such, and must not be
-    misrepresented as being the original software.
+   misrepresented as being the original software.
+
 3. This notice may not be removed or altered from any source distribution.

Reply via email to