Skip to content

Commit

Permalink
Merge pull request #590 from newnon/master
Browse files Browse the repository at this point in the history
new packages minizip & tinyxml2, OpenAL updated
  • Loading branch information
TimothyGu committed Dec 17, 2014
2 parents 4f6fc9b + 2a172c1 commit d76d0af
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 19 deletions.
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,10 @@ <h2 id="packages">List of Packages</h2>
<td class="package">mdbtools</td>
<td class="website"><a href="http://sourceforge.net/projects/mdbtools/">mdbtools</a></td>
</tr>
<tr>
<td class="package">minizip</td>
<td class="website"><a href="http://www.winimage.com/zLibDll/minizip.html">minizip</a></td>
</tr>
<tr>
<td class="package">mingw-w64</td>
<td class="website"><a href="http://mingw-w64.sourceforge.net/">MinGW-w64 Runtime</a></td>
Expand Down Expand Up @@ -2413,6 +2417,10 @@ <h2 id="packages">List of Packages</h2>
<td class="package">tinyxml</td>
<td class="website"><a href="http://sourceforge.net/projects/tinyxml/">tinyxml</a></td>
</tr>
<tr>
<td class="package">tinyxml2</td>
<td class="website"><a href="http://grinninglizard.com/tinyxml2/index.html">tinyxml2</a></td>
</tr>
<tr>
<td class="package">tre</td>
<td class="website"><a href="http://laurikari.net/tre/">TRE</a></td>
Expand Down
74 changes: 74 additions & 0 deletions src/minizip-1-unzOpenBuffer.patch
Original file line number Diff line number Diff line change
@@ -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 <martellmalone@gmail.com>
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 <stddef.h>
@@ -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

31 changes: 31 additions & 0 deletions src/minizip.mk
Original file line number Diff line number Diff line change
@@ -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 =
58 changes: 42 additions & 16 deletions src/openal-1-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,53 @@ See index.html for further information.

Contains ad hoc patches for cross building.

From b5c7c4853307964f0b8e11e2c9edb5bf0f8511f7 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Tue, 3 Apr 2012 14:36:58 +0200
Subject: [PATCH] add static private dependencies to pkg-config for cmake

---
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef3d08d..88de1e5 100644
index 0087edb..6887339 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -603,6 +603,7 @@ IF(DSOUND)
SET(BACKENDS "${BACKENDS} DirectSound \(linked\),")
SET(EXTRA_LIBS dsound ${EXTRA_LIBS})
@@ -846,6 +846,7 @@ IF(HAVE_WINDOWS_H)
SET(BACKENDS "${BACKENDS} WinMM,")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/winmm.c)
SET(EXTRA_LIBS winmm ${EXTRA_LIBS})
+ SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lwinmm")
ENDIF()
ENDIF()
ENDIF()
@@ -862,6 +863,7 @@ IF(HAVE_WINDOWS_H)
IF(CMAKE_VERSION VERSION_LESS "2.8.8")
INCLUDE_DIRECTORIES(${DSOUND_INCLUDE_DIRS})
ENDIF()
+ SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -luuid -lole32")
ENDIF()
ENDIF()

@@ -873,6 +875,7 @@ IF(HAVE_WINDOWS_H)
SET(HAVE_MMDEVAPI 1)
SET(BACKENDS "${BACKENDS} MMDevApi,")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/mmdevapi.c)
+ SET(PKG_CONFIG_LIBS "${PKG_CONFIG_LIBS} -lole32")
ENDIF()
ENDIF()
ENDIF()
--
1.7.9.2

@@ -1027,10 +1030,10 @@ CONFIGURE_FILE(
@ONLY)

# Build a common library with reusable helpers
-ADD_LIBRARY(common STATIC ${COMMON_OBJS})
+#ADD_LIBRARY(common STATIC ${COMMON_OBJS})

# Build main library
-ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
+ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS})
SET_PROPERTY(TARGET ${LIBNAME} APPEND PROPERTY COMPILE_DEFINITIONS AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES)
IF(WIN32 AND ALSOFT_NO_UID_DEFS)
SET_PROPERTY(TARGET ${LIBNAME} APPEND PROPERTY COMPILE_DEFINITIONS AL_NO_UID_DEFS)
@@ -1091,7 +1094,7 @@ IF(WIN32 AND NOT LIBTYPE STREQUAL "STATIC")
ENDIF()
ENDIF()

-TARGET_LINK_LIBRARIES(${LIBNAME} common ${EXTRA_LIBS})
+#TARGET_LINK_LIBRARIES(${LIBNAME} common ${EXTRA_LIBS})

# Add an install target here
INSTALL(TARGETS ${LIBNAME}
7 changes: 4 additions & 3 deletions src/openal.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

PKG := openal
$(PKG)_IGNORE :=
$(PKG)_VERSION := 1.15.1
$(PKG)_CHECKSUM := a0e73a46740c52ccbde38a3912c5b0fd72679ec8
$(PKG)_VERSION := 1.16.0
$(PKG)_CHECKSUM := f70892fc075ae726320478c0179f7011fea0d157
$(PKG)_SUBDIR := openal-soft-$($(PKG)_VERSION)
$(PKG)_FILE := openal-soft-$($(PKG)_VERSION).tar.bz2
$(PKG)_URL := http://kcat.strangesoft.net/openal-releases/$($(PKG)_FILE)
Expand All @@ -21,7 +21,8 @@ define $(PKG)_BUILD
cd '$(1)/build' && cmake .. \
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
-DLIBTYPE=$(if $(BUILD_SHARED),SHARED,STATIC) \
-DEXAMPLES=FALSE
-DEXAMPLES=FALSE \
-DALSOFT_UTILS=FALSE
$(MAKE) -C '$(1)/build' -j '$(JOBS)' install

'$(TARGET)-gcc' \
Expand Down
34 changes: 34 additions & 0 deletions src/tinyxml2-1-static.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91c61a4..1aeba57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,22 +50,22 @@ set(BUILD_STATIC_LIBS ON CACHE BOOL "Set to ON to build static libraries")
if(BUILD_STATIC_LIBS)
add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
-endif(BUILD_STATIC_LIBS)
+else(BUILD_STATIC_LIBS)
add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2 PROPERTIES
COMPILE_DEFINITIONS "TINYXML2_EXPORT"
VERSION "${GENERIC_LIB_VERSION}"
SOVERSION "${GENERIC_LIB_SOVERSION}")
+endif(BUILD_STATIC_LIBS)

-add_executable(test xmltest.cpp)
-add_dependencies(test tinyxml2)
-add_dependencies(test ${TARGET_DATA_COPY})
-target_link_libraries(test tinyxml2)
+#add_executable(test xmltest.cpp)
+#add_dependencies(test tinyxml2)
+#add_dependencies(test ${TARGET_DATA_COPY})
+#target_link_libraries(test tinyxml2)


if(BUILD_STATIC_LIBS)
- install(TARGETS tinyxml2 tinyxml2static
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ install(TARGETS tinyxml2static
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
else(BUILD_STATIC_LIBS)
27 changes: 27 additions & 0 deletions src/tinyxml2.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file is part of MXE.
# See index.html for further information.

PKG := tinyxml2
$(PKG)_IGNORE :=
$(PKG)_VERSION := 2.2.0
$(PKG)_CHECKSUM := 7869aa08241ce16f93ba3732c1cde155b1f2b6a0
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := https://github.com/leethomason/tinyxml2/archive/$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS := gcc

define $(PKG)_UPDATE
$(WGET) -q -O- 'https://github.com/leethomason/tinyxml2/releases' | \
$(SED) -n 's,.*/archive/\([0-9][^>]*\)\.tar.*,\1,p' | \
head -1
endef

define $(PKG)_BUILD
mkdir '$(1)/build'
cd '$(1)/build' && cmake .. \
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
$(if $(BUILD_STATIC), \
-DBUILD_STATIC_LIBS=ON)

$(MAKE) -C '$(1)/build' -j '$(JOBS)' install
endef

0 comments on commit d76d0af

Please sign in to comment.