From b4dc0346f5c64ca402ec5b93e2c9f97e2af4d56d Mon Sep 17 00:00:00 2001 From: Sergey Date: Sun, 14 Dec 2014 02:15:04 +0300 Subject: minizip --- index.html | 4 +++ src/minizip-1-unzOpenBuffer.patch | 74 +++++++++++++++++++++++++++++++++++++++ src/minizip.mk | 31 ++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 src/minizip-1-unzOpenBuffer.patch create mode 100644 src/minizip.mk diff --git a/index.html b/index.html index f5d5431..01e53f8 100644 --- a/index.html +++ b/index.html @@ -1898,6 +1898,10 @@ local-pkg-list: $(LOCAL_PKG_LIST) mdbtools + minizip + minizip + + mingw-w64 MinGW-w64 Runtime diff --git a/src/minizip-1-unzOpenBuffer.patch b/src/minizip-1-unzOpenBuffer.patch new file mode 100644 index 0000000..45d38ec --- /dev/null +++ b/src/minizip-1-unzOpenBuffer.patch @@ -0,0 +1,74 @@ +This file is part of MXE. +See index.html for further information. + +This patch has been taken from: +https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-zlib + +From c162a3620a3d0d317f59af8ddc2d1605bf5ee4b3 Mon Sep 17 00:00:00 2001 +From: martell +Date: Sat, 11 Oct 2014 03:32:38 +0100 +Subject: [PATCH 1/3] unzip: add function unzOpenBuffer + +--- + Makefile.am | 1 + + unzip.c | 11 +++++++++++ + unzip.h | 2 ++ + 3 files changed, 14 insertions(+) + +diff --git a/Makefile.am b/Makefile.am +index d83fee7..e2958e6 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -19,6 +19,7 @@ libminizip_la_SOURCES = \ + ioapi.c \ + unzip.c \ + zip.c \ ++ ioapi_mem.c \ + ${iowin32_src} + + libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz +diff --git a/unzip.c b/unzip.c +index ce02265..bb72a66 100644 +--- a/unzip.c ++++ b/unzip.c +@@ -26,6 +26,7 @@ + + #include "zlib.h" + #include "unzip.h" ++#include "ioapi_mem.h" + + #ifdef STDC + # include +@@ -581,6 +582,16 @@ extern unzFile ZEXPORT unzOpen64(const void *path) + return unzOpenInternal(path, NULL, 1); + } + ++extern unzFile ZEXPORT unzOpenBuffer(const void* buffer, uLong size) ++{ ++ char path[48] = {0}; ++ ourmemory_t FileMemory; ++ zlib_filefunc64_32_def memory_file; ++ sprintf(path, "%llx %lx", (unsigned long long)buffer, (unsigned long)size); ++ fill_memory_filefunc(&memory_file, &FileMemory); ++ return unzOpenInternal(path, &memory_file, 0); ++} ++ + extern int ZEXPORT unzClose(unzFile file) + { + unz64_s* s; +diff --git a/unzip.h b/unzip.h +index 22c830f..28fedb9 100644 +--- a/unzip.h ++++ b/unzip.h +@@ -143,6 +143,8 @@ extern unzFile ZEXPORT unzOpen64 OF((const void *path)); + open64_file_func callback. Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path + is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* does not describe the reality */ + ++extern unzFile ZEXPORT unzOpenBuffer OF((const void* buffer, uLong size)); ++/* Open a Zip file, like unzOpen, but from a buffer */ + extern unzFile ZEXPORT unzOpen2 OF((const char *path, zlib_filefunc_def* pzlib_filefunc_def)); + /* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write operations */ + extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, zlib_filefunc64_def* pzlib_filefunc_def)); +-- +2.1.2 + diff --git a/src/minizip.mk b/src/minizip.mk new file mode 100644 index 0000000..9b59e50 --- /dev/null +++ b/src/minizip.mk @@ -0,0 +1,31 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := minizip +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.1 +$(PKG)_CHECKSUM := f0a47893d86e48c7336558aa7ec7b6742a1c102f +$(PKG)_COMMIT := 1f38dffc395c1e847eb26dbd921168e8cc2b6db2 +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_COMMIT) +$(PKG)_FILE := $(PKG)-$($(PKG)_COMMIT).zip +$(PKG)_URL := https://github.com/nmoinvaz/minizip/archive/$($(PKG)_COMMIT).zip +$(PKG)_DEPS := gcc zlib + +define $(PKG)_UPDATE + echo 'TODO: write update script for $(PKG).' >&2; + echo $($(PKG)_VERSION) +endef + +define $(PKG)_BUILD + cd '$(1)' && $(TARGET)-gcc -c -O '$(1)'/*.c + cd '$(1)' && $(TARGET)-ar cr libminizip.a *.o + $(TARGET)-ranlib '$(1)/libminizip.a' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' + $(INSTALL) -m644 '$(1)'/*.a '$(PREFIX)/$(TARGET)/lib/' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/include/minizip' + $(INSTALL) -m644 '$(1)'/ioapi.h '$(PREFIX)/$(TARGET)/include/minizip/' + $(INSTALL) -m644 '$(1)'/unzip.h '$(PREFIX)/$(TARGET)/include/minizip/' + $(INSTALL) -m644 '$(1)'/zip.h '$(PREFIX)/$(TARGET)/include/minizip/' +endef + +$(PKG)_BUILD_SHARED = -- cgit v0.12