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

Replace zlib by zlib-ng #2708

Merged
merged 6 commits into from
Sep 8, 2021
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
3 changes: 2 additions & 1 deletion Modules/ThirdParty/ZLIB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ if(ITK_USE_SYSTEM_ZLIB)
else()
set(ITKZLIB_INCLUDE_DIRS
${ITKZLIB_BINARY_DIR}/src
${ITKZLIB_BINARY_DIR}/src/itkzlib-ng
${ITKZLIB_SOURCE_DIR}/src
)
set(ITKZLIB_LIBRARIES itkzlib)
set(ITKZLIB_LIBRARIES zlib)
endif()

configure_file(src/itk_zlib.h.in src/itk_zlib.h)
Expand Down
64 changes: 24 additions & 40 deletions Modules/ThirdParty/ZLIB/UpdateFromUpstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,40 @@ set -e
set -x
shopt -s dotglob

readonly name="zlib"
readonly ownership="Zlib Upstream <[email protected]>"
readonly name="zlib-ng"
readonly ownership="Zlib-ng Upstream <[email protected]>"
readonly subtree="Modules/ThirdParty/ZLIB/src/itk$name"
readonly repo="https://gitlab.kitware.com/third-party/zlib.git"
readonly tag="for/itk-v1.2.11-2017-01-15-cacf7f1d"
readonly repo="https://github.com/dzenanz/zlib-ng.git"
readonly tag="develop"
readonly paths="
CMakeLists.txt

adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzlib.c
gzread.c
gzwrite.c
infback.c
inffast.c
inflate.c
inftrees.c
trees.c
uncompr.c
zutil.c

crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zlib.h
zutil.h

zconf.h.cmakein

cmake/*
arch/*
*.c
*.h

gzread.c.in
zconf.h.in
zlib.h.in
zlib_name_mangling.h.in
zlib_name_mangling.h.empty
zlib.pc.cmakein

zlib.map
win32/zlibcompat.def
win32/zlib1.rc
win32/DLL_FAQ.txt
win32/zlib.def

.gitattributes
ChangeLog
README
README.kitware.md
FAQ
INDEX
README.md
INDEX.md
"


extract_source () {
git_archive
pushd "${extractdir}/${name}-reduced"
popd
}

. "${BASH_SOURCE%/*}/../../../Utilities/Maintenance/update-third-party.bash"
5 changes: 3 additions & 2 deletions Modules/ThirdParty/ZLIB/itk-module.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(DOCUMENTATION "This module contains the third party <a
href=\"http://www.zlib.org/\">ZLIB</a> general purpose data compression
library.")
href=\"https://github.com/zlib-ng/zlib-ng\">zlib-ng</a>
general purpose data compression library,
designed as a drop-in replacement for ZLIB.")

itk_module(ITKZLIB
DESCRIPTION
Expand Down
15 changes: 9 additions & 6 deletions Modules/ThirdParty/ZLIB/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
set(ITK3P_INSTALL_EXPORT_NAME "${ITKZLIB-targets}")
set(ITK3P_INSTALL_INCLUDE_DIR "${ITKZLIB_INSTALL_INCLUDE_DIR}")
set(ITK3P_INSTALL_RUNTIME_DIR "${ITKZLIB_INSTALL_RUNTIME_DIR}")
set(ITK3P_INSTALL_LIBRARY_DIR "${ITKZLIB_INSTALL_LIBRARY_DIR}")
set(ITK3P_INSTALL_ARCHIVE_DIR "${ITKZLIB_INSTALL_ARCHIVE_DIR}")
add_subdirectory(itkzlib)
set(INC_INSTALL_DIR "${ITKZLIB_INSTALL_INCLUDE_DIR}/itkzlib-ng")
set(BIN_INSTALL_DIR "${ITKZLIB_INSTALL_RUNTIME_DIR}")
set(LIB_INSTALL_DIR "${ITKZLIB_INSTALL_LIBRARY_DIR}")
set(PKGCONFIG_INSTALL_DIR "${ITKZLIB_INSTALL_ARCHIVE_DIR}")
set(ZLIB_SYMBOL_PREFIX "itkzlib_")
set(ZLIB_COMPAT ON)
set(ZLIB_DUAL_LINK OFF)
set(ZLIB_ENABLE_TESTS OFF)
add_subdirectory(itkzlib-ng)
2 changes: 1 addition & 1 deletion Modules/ThirdParty/ZLIB/src/itk_zlib.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#ifdef ITK_USE_SYSTEM_ZLIB
# include <zlib.h>
#else
# include "itkzlib/zlib.h"
# include "itkzlib-ng/zlib.h"
#endif

#endif
4 changes: 4 additions & 0 deletions Modules/ThirdParty/ZLIB/src/itkzlib-ng/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto
*.c text
*.h text
Makefile text
Loading