From 0451e18bd524753d08e202bc9ac6ae44e9c806b9 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 28 May 2020 13:58:26 +0200 Subject: [PATCH] update minizip --- src/minizip-1-fixes.patch | 91 +++++++++++++++++++++++++++++++++++++++ src/minizip.mk | 9 ++-- 2 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 src/minizip-1-fixes.patch diff --git a/src/minizip-1-fixes.patch b/src/minizip-1-fixes.patch new file mode 100644 index 00000000..f96176e2 --- /dev/null +++ b/src/minizip-1-fixes.patch @@ -0,0 +1,91 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Thu, 28 May 2020 13:42:05 +0200 +Subject: [PATCH 1/4] fix format string + + +diff --git a/minizip.c b/minizip.c +index 1111111..2222222 100644 +--- a/minizip.c ++++ b/minizip.c +@@ -237,7 +237,7 @@ int32_t minizip_add_progress_cb(void *handle, void *userdata, mz_zip_file *file_ + + /* Print the progress of the current compress operation */ + if (options->verbose) +- printf("%s - %" PRId64 " / %" PRId64 " (%.02f%%)\n", file_info->filename, position, ++ printf("%s - %" PRId64 " / %" PRId64 " (%0.2f%%)\n", file_info->filename, position, + file_info->uncompressed_size, progress); + return MZ_OK; + } +@@ -363,7 +363,7 @@ int32_t minizip_extract_progress_cb(void *handle, void *userdata, mz_zip_file *f + + /* Print the progress of the current extraction */ + if (options->verbose) +- printf("%s - %" PRId64 " / %" PRId64 " (%.02f%%)\n", file_info->filename, position, ++ printf("%s - %" PRId64 " / %" PRId64 " (%0.2f%%)\n", file_info->filename, position, + file_info->uncompressed_size, progress); + + return MZ_OK; + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Thu, 28 May 2020 14:33:19 +0200 +Subject: [PATCH 2/4] fix bzip2 library name + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1111111..2222222 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -134,7 +134,7 @@ if(MZ_BZIP2) + message(STATUS "Using BZIP2 ${BZIP2_VERSION_STRING}") + list(APPEND MINIZIP_INC ${BZIP2_INCLUDE_DIRS}) + list(APPEND MINIZIP_DEF -DHAVE_BZIP2) +- set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lbzip2") ++ set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lbz2") + endif() + endif() + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Thu, 28 May 2020 14:52:00 +0200 +Subject: [PATCH 3/4] fix output library name + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1111111..2222222 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -652,7 +652,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES + + if(WIN32) + # VS debugger has problems when executable and static library are named the same +- set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME lib${PROJECT_NAME}) ++ set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) + endif() + if(NOT RISCOS) + set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE 1) + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Thu, 28 May 2020 15:04:20 +0200 +Subject: [PATCH 4/4] add missing private libcrypt32 + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1111111..2222222 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -257,6 +257,7 @@ if(WIN32) + if (MZ_PKCRYPT OR MZ_WZAES) + if (NOT MZ_OPENSSL AND NOT OPENSSL_FOUND AND NOT MZ_BRG) + list(APPEND MINIZIP_SRC "mz_crypt_win32.c") ++ set(PC_PRIVATE_LIBS "${PC_PRIVATE_LIBS} -lcrypt32") + endif() + endif() + endif() diff --git a/src/minizip.mk b/src/minizip.mk index 5790bd31..26ef10a9 100644 --- a/src/minizip.mk +++ b/src/minizip.mk @@ -3,10 +3,10 @@ PKG := minizip $(PKG)_WEBSITE := https://www.winimage.com/zLibDll/minizip.html $(PKG)_IGNORE := -$(PKG)_VERSION := 68a48aa -$(PKG)_CHECKSUM := 3fca5754b6e9f96fc907bb6755a1daef72f869cee172a4e687611c47ee693ada +$(PKG)_VERSION := 2aa369c +$(PKG)_CHECKSUM := 165afc71c29863f41c4d1cf9d3a2b1333b863e3d66e5e05b9e1e41c5af8b8a44 $(PKG)_GH_CONF := nmoinvaz/minizip/branches/master -$(PKG)_DEPS := cc zlib +$(PKG)_DEPS := cc bzip2 zlib define $(PKG)_BUILD # build and install the library @@ -19,6 +19,7 @@ define $(PKG)_BUILD # compile test '$(TARGET)-gcc' \ -W -Wall -Werror \ - '$(SOURCE_DIR)/src/minizip.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ + -DHAVE_STDINT_H -DHAVE_INTTYPES_H \ + '$(SOURCE_DIR)/minizip.c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \ `'$(TARGET)-pkg-config' $(PKG) --libs-only-l` endef