From: Jan Engelhardt Date: Fri, 27 Oct 2023 09:01:47 +0200 Use system-provided zlib. Heed Heed https://en.opensuse.org/openSUSE:Bundled_software_policy https://docs.fedoraproject.org/en-US/fesco/Bundled_Software_policy/ (This reverts commit ba9ce0e83f6e25e3ddef5000bd51d53f2e3947a2.) --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 4 ++-- src/common/audio/music/i_music.cpp | 3 ++- src/common/engine/serializer.cpp | 3 ++- src/common/filesystem/source/files_decompress.cpp | 3 ++- src/common/filesystem/source/filesystem.cpp | 3 ++- src/common/filesystem/source/resourcefile.cpp | 3 ++- src/common/models/model.cpp | 9 +++++++-- src/common/platform/win32/i_crash.cpp | 3 ++- src/common/textures/m_png.cpp | 3 ++- src/common/thirdparty/m_crc32.h | 4 +++- src/g_pch.h | 3 ++- src/g_pch2.h | 3 ++- src/maploader/glnodes.cpp | 3 ++- src/serializer_doom.cpp | 3 ++- tools/zipdir/CMakeLists.txt | 4 ++-- tools/zipdir/zipdir.c | 3 ++- 17 files changed, 39 insertions(+), 20 deletions(-) Index: gzdoom-g4.12.2/CMakeLists.txt =================================================================== --- gzdoom-g4.12.2.orig/CMakeLists.txt +++ gzdoom-g4.12.2/CMakeLists.txt @@ -215,6 +215,7 @@ option( NO_OPENAL "Disable OpenAL sound find_package( BZip2 ) find_package( VPX ) +find_package( ZLIB ) include( TargetArch ) @@ -406,7 +407,6 @@ install(DIRECTORY docs/ option( DYN_OPENAL "Dynamically load OpenAL" ON ) add_subdirectory( libraries/lzma ) -add_subdirectory( libraries/miniz ) add_subdirectory( tools ) add_subdirectory( wadsrc ) add_subdirectory( wadsrc_bm ) Index: gzdoom-g4.12.2/src/CMakeLists.txt =================================================================== --- gzdoom-g4.12.2.orig/src/CMakeLists.txt +++ gzdoom-g4.12.2/src/CMakeLists.txt @@ -319,7 +319,7 @@ add_custom_target( revision_check ALL # required libraries -set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} miniz "${BZIP2_LIBRARIES}" "${CMAKE_DL_LIBS}" "${DRPC_LIBRARIES}") +set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${ZLIB_LIBRARIES}" "${BZIP2_LIBRARIES}" "${CMAKE_DL_LIBS}" "${DRPC_LIBRARIES}") if (HAVE_VULKAN) list( APPEND PROJECT_LIBRARIES "zvulkan" ) endif() @@ -383,7 +383,7 @@ else() message( SEND_ERROR "Could not find libvpx" ) endif() -include_directories( SYSTEM "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${DRPC_INCLUDE_DIR}") +include_directories( SYSTEM "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${DRPC_INCLUDE_DIR}") if( ${HAVE_VM_JIT} ) add_definitions( -DHAVE_VM_JIT ) Index: gzdoom-g4.12.2/src/common/audio/music/i_music.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/common/audio/music/i_music.cpp +++ gzdoom-g4.12.2/src/common/audio/music/i_music.cpp @@ -37,7 +37,8 @@ #include #endif -#include +#include +#include #include #include "filesystem.h" Index: gzdoom-g4.12.2/src/common/engine/serializer.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/common/engine/serializer.cpp +++ gzdoom-g4.12.2/src/common/engine/serializer.cpp @@ -37,7 +37,8 @@ #define RAPIDJSON_HAS_CXX11_RANGE_FOR 1 #define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag -#include +#include +#include #include "rapidjson/rapidjson.h" #include "rapidjson/writer.h" #include "rapidjson/prettywriter.h" Index: gzdoom-g4.12.2/src/common/filesystem/source/files_decompress.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/common/filesystem/source/files_decompress.cpp +++ gzdoom-g4.12.2/src/common/filesystem/source/files_decompress.cpp @@ -39,7 +39,8 @@ #include "Xz.h" // CRC table needs to be generated prior to reading XZ compressed files. #include "7zCrc.h" -#include +#include +#include #include #include #include Index: gzdoom-g4.12.2/src/common/filesystem/source/filesystem.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/common/filesystem/source/filesystem.cpp +++ gzdoom-g4.12.2/src/common/filesystem/source/filesystem.cpp @@ -36,7 +36,8 @@ // HEADER FILES ------------------------------------------------------------ -#include +#include +#include #include #include #include Index: gzdoom-g4.12.2/src/common/filesystem/source/resourcefile.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/common/filesystem/source/resourcefile.cpp +++ gzdoom-g4.12.2/src/common/filesystem/source/resourcefile.cpp @@ -35,7 +35,8 @@ */ #include -#include +#include +#include #include "resourcefile.h" #include "md5.hpp" #include "fs_stringpool.h" Index: gzdoom-g4.12.2/src/common/models/model.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/common/models/model.cpp +++ gzdoom-g4.12.2/src/common/models/model.cpp @@ -25,7 +25,6 @@ ** General model handling code ** **/ -#include // offsetof() macro. #include "filesystem.h" #include "cmdlib.h" @@ -132,7 +131,13 @@ FTextureID LoadSkin(const char * path, c int ModelFrameHash(FSpriteModelFrame * smf) { - return crc32(0, (const unsigned char *)(&smf->type), offsetof(FSpriteModelFrame, hashnext) - offsetof(FSpriteModelFrame, type)); + const uint32_t *table = GetCRCTable (); + uint32_t hash = 0xffffffff; + const char * s = (const char *)(&smf->type); // this uses type, sprite and frame for hashing + const char * se= (const char *)(&smf->hashnext); + for (; s -#include +#include +#include // MACROS ------------------------------------------------------------------ Index: gzdoom-g4.12.2/src/common/textures/m_png.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/common/textures/m_png.cpp +++ gzdoom-g4.12.2/src/common/textures/m_png.cpp @@ -36,7 +36,8 @@ #include #include -#include +#include +#include #include #ifdef _MSC_VER #include // for alloca() Index: gzdoom-g4.12.2/src/common/thirdparty/m_crc32.h =================================================================== --- gzdoom-g4.12.2.orig/src/common/thirdparty/m_crc32.h +++ gzdoom-g4.12.2/src/common/thirdparty/m_crc32.h @@ -32,11 +32,13 @@ ** */ #pragma once -#include +#include +#include #include // miniz includes some CRC32 stuff, so just use that +inline const uint32_t *GetCRCTable () { return (const uint32_t *)get_crc_table(); } inline uint32_t CalcCRC32 (const uint8_t *buf, unsigned int len) { return crc32 (0, buf, len); Index: gzdoom-g4.12.2/src/g_pch.h =================================================================== --- gzdoom-g4.12.2.orig/src/g_pch.h +++ gzdoom-g4.12.2/src/g_pch.h @@ -10,7 +10,8 @@ #include #include #include -#include +#include +#include #include #include #include Index: gzdoom-g4.12.2/src/g_pch2.h =================================================================== --- gzdoom-g4.12.2.orig/src/g_pch2.h +++ gzdoom-g4.12.2/src/g_pch2.h @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include #include Index: gzdoom-g4.12.2/src/maploader/glnodes.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/maploader/glnodes.cpp +++ gzdoom-g4.12.2/src/maploader/glnodes.cpp @@ -42,7 +42,8 @@ #endif -#include +#include +#include #include "m_argv.h" #include "c_dispatch.h" Index: gzdoom-g4.12.2/src/serializer_doom.cpp =================================================================== --- gzdoom-g4.12.2.orig/src/serializer_doom.cpp +++ gzdoom-g4.12.2/src/serializer_doom.cpp @@ -38,7 +38,8 @@ #define RAPIDJSON_HAS_CXX11_RANGE_FOR 1 #define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag -#include +#include +#include #include "rapidjson/rapidjson.h" #include "rapidjson/writer.h" #include "rapidjson/prettywriter.h" Index: gzdoom-g4.12.2/tools/zipdir/CMakeLists.txt =================================================================== --- gzdoom-g4.12.2.orig/tools/zipdir/CMakeLists.txt +++ gzdoom-g4.12.2/tools/zipdir/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required( VERSION 3.16 ) if( NOT CMAKE_CROSSCOMPILING ) - include_directories( SYSTEM "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" ) + include_directories( SYSTEM "${ZLIB_INCLUDE_DIR} ${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" ) add_executable( zipdir zipdir.c ) - target_link_libraries( zipdir miniz ${BZIP2_LIBRARIES} lzma ) + target_link_libraries( zipdir ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} lzma ) set( CROSS_EXPORTS ${CROSS_EXPORTS} zipdir PARENT_SCOPE ) endif() Index: gzdoom-g4.12.2/tools/zipdir/zipdir.c =================================================================== --- gzdoom-g4.12.2.orig/tools/zipdir/zipdir.c +++ gzdoom-g4.12.2/tools/zipdir/zipdir.c @@ -46,7 +46,8 @@ #include #include #include -#include +#include +#include #include "bzlib.h" #include "LzmaEnc.h" #include "7zVersion.h"