summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2012-12-21 07:03:22 (GMT)
committerTony Theodore <tonyt@logyst.com>2012-12-21 07:03:22 (GMT)
commitead9e5ae69d6eccec5b71e5e81427b26395aab21 (patch)
tree49bf325619bffee21ad1e0f5f1bd208dd3d7b313
parent9dac98aa11a8c12f06b88b1bbed7446523bf8ecb (diff)
parent4f8f96ba2e092588c65aaad9cd49760458c041bc (diff)
downloadmxe-ead9e5ae69d6eccec5b71e5e81427b26395aab21.zip
mxe-ead9e5ae69d6eccec5b71e5e81427b26395aab21.tar.gz
mxe-ead9e5ae69d6eccec5b71e5e81427b26395aab21.tar.bz2
Merge pull request #102 from Beuc/master
New packages: SDL_gfx and libzip
-rw-r--r--index.html10
-rw-r--r--src/libzip-1-static_build.patch21
-rw-r--r--src/libzip-2-pkgconfig_private.patch16
-rw-r--r--src/libzip-test.c42
-rw-r--r--src/libzip.mk29
-rw-r--r--src/sdl_gfx-test.c25
-rw-r--r--src/sdl_gfx.mk31
7 files changed, 174 insertions, 0 deletions
diff --git a/index.html b/index.html
index ab17b47..691bbad 100644
--- a/index.html
+++ b/index.html
@@ -1597,6 +1597,11 @@ USE_OSGPLUGIN(&lt;plugin2&gt;)
<td id="libxslt-website"><a href="http://xmlsoft.org/XSLT/">libxslt</a></td>
</tr>
<tr>
+ <td id="libzip-package">libzip</td>
+ <td id="libzip-version">0.10.1</td>
+ <td id="libzip-website"><a href="http://www.nih.at/libzip/">libzip</a></td>
+ </tr>
+ <tr>
<td id="llvm-package">llvm</td>
<td id="llvm-version">3.1</td>
<td id="llvm-website"><a href="http://llvm.org/">llvm</a></td>
@@ -1967,6 +1972,11 @@ USE_OSGPLUGIN(&lt;plugin2&gt;)
<td id="sdl-website"><a href="http://www.libsdl.org/">SDL</a></td>
</tr>
<tr>
+ <td id="sdl_gfx-package">sdl_gfx</td>
+ <td id="sdl_gfx-version">2.0.24</td>
+ <td id="sdl_gfx-website"><a href="http://www.ferzkopp.net/joomla/content/view/19/14/">SDL_gfx</a></td>
+ </tr>
+ <tr>
<td id="sdl_image-package">sdl_image</td>
<td id="sdl_image-version">1.2.12</td>
<td id="sdl_image-website"><a href="http://www.libsdl.org/projects/SDL_image/">SDL_image</a></td>
diff --git a/src/libzip-1-static_build.patch b/src/libzip-1-static_build.patch
new file mode 100644
index 0000000..e314263
--- /dev/null
+++ b/src/libzip-1-static_build.patch
@@ -0,0 +1,21 @@
+This file is part of MXE.
+See index.html for further information.
+
+This is a quick&dirty fix.
+
+The bug is being discussed at
+http://www.nih.at/listarchive/libzip-discuss/msg00304.html
+
+--- a/lib/zip.h 2012-03-15 10:28:05.000000000 +0100
++++ b/lib/zip.h 2012-12-18 02:05:31.416621709 +0100
+@@ -37,8 +37,8 @@
+
+
+ #ifndef ZIP_EXTERN
+-#ifdef _WIN32
+-#define ZIP_EXTERN __declspec(dllimport)
++#ifdef _MSC_VER
++#define ZIP_EXTERN __declspec(dllexport)
+ #else
+ #define ZIP_EXTERN
+ #endif
diff --git a/src/libzip-2-pkgconfig_private.patch b/src/libzip-2-pkgconfig_private.patch
new file mode 100644
index 0000000..e253cf1
--- /dev/null
+++ b/src/libzip-2-pkgconfig_private.patch
@@ -0,0 +1,16 @@
+This file is part of MXE.
+See index.html for further information.
+
+Only advertise -lz for static builds.
+
+--- a/libzip.pc.in 2012-03-15 10:28:05.000000000 +0100
++++ b/libzip.pc.in 2012-12-18 22:48:27.807773881 +0100
+@@ -9,6 +9,7 @@
+ Name: libzip
+ Description: library for handling zip archives
+ Version: @VERSION@
+-Libs: -L${libdir} -lzip @LIBS@
++Libs: -L${libdir} -lzip
+ Cflags: -I${includedir} -I${libincludedir}
++Requires.private: zlib
+
diff --git a/src/libzip-test.c b/src/libzip-test.c
new file mode 100644
index 0000000..e23b325
--- /dev/null
+++ b/src/libzip-test.c
@@ -0,0 +1,42 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
+#include <zip.h>
+#include <stdlib.h>
+
+/* Adapted from freedink/src/SDL_rwops_libzip.c */
+int main(int argc, char* argv[])
+{
+ struct zip* zarchive;
+ int errorp = 0;
+
+ (void)argc;
+ (void)argv;
+
+ zarchive = zip_open("idontexist.zip", ZIP_CHECKCONS, &errorp);
+ if (errorp != 0)
+ {
+ char *errorbuf = NULL;
+ int len = 1;
+ errorbuf = malloc(len);
+ len = zip_error_to_str(errorbuf, len, errorp, errno);
+ errorbuf = realloc(errorbuf, len + 1);
+ len = zip_error_to_str(errorbuf, len, errorp, errno);
+ fprintf(stderr, "zip_open: %s\n", errorbuf);
+ free(errorbuf);
+ }
+ else
+ {
+ struct zip_file* zfile;
+ zfile = zip_fopen(zarchive, "fichier.txt", 0);
+ if (zfile == NULL)
+ {
+ fprintf(stderr, "zip_open: %s\n", zip_strerror(zarchive));
+ zip_close(zarchive);
+ }
+ }
+
+ return 0;
+}
diff --git a/src/libzip.mk b/src/libzip.mk
new file mode 100644
index 0000000..f963301
--- /dev/null
+++ b/src/libzip.mk
@@ -0,0 +1,29 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := libzip
+$(PKG)_IGNORE :=
+$(PKG)_CHECKSUM := 04be811a1919e1063a1f5210671181b7b5416d45
+$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
+$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
+$(PKG)_URL := http://www.nih.at/libzip/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc zlib
+
+define $(PKG)_UPDATE
+ wget -q -O- 'http://www.nih.at/libzip/' | \
+ $(SED) -n 's,.*libzip-\([0-9][^>]*\)\.tar.*,\1,p' | \
+ head -1
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && ./configure \
+ --host='$(TARGET)' \
+ --prefix='$(PREFIX)/$(TARGET)' \
+ --disable-shared
+ $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-libzip.exe' \
+ `'$(TARGET)-pkg-config' libzip --cflags --libs`
+endef
diff --git a/src/sdl_gfx-test.c b/src/sdl_gfx-test.c
new file mode 100644
index 0000000..3a092f0
--- /dev/null
+++ b/src/sdl_gfx-test.c
@@ -0,0 +1,25 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
+#include <SDL.h>
+#include "SDL_rotozoom.h"
+#include "SDL_framerate.h"
+
+int main(int argc, char* argv[])
+{
+ FPSmanager framerate_manager;
+
+ (void)argc;
+ (void)argv;
+
+ if (SDL_Init(SDL_INIT_EVERYTHING) < 0) return 1;
+
+ SDL_initFramerate(&framerate_manager);
+ SDL_setFramerate(&framerate_manager, 60);
+ SDL_framerateDelay(&framerate_manager);
+
+ SDL_Quit();
+ return 0;
+}
diff --git a/src/sdl_gfx.mk b/src/sdl_gfx.mk
new file mode 100644
index 0000000..e3ff8ff
--- /dev/null
+++ b/src/sdl_gfx.mk
@@ -0,0 +1,31 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := sdl_gfx
+$(PKG)_IGNORE :=
+$(PKG)_CHECKSUM := 34e8963188e4845557468a496066a8fa60d5f563
+$(PKG)_SUBDIR := SDL_gfx-$($(PKG)_VERSION)
+$(PKG)_FILE := SDL_gfx-$($(PKG)_VERSION).tar.gz
+$(PKG)_URL := http://www.ferzkopp.net/Software/SDL_gfx-2.0/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc sdl
+
+define $(PKG)_UPDATE
+# thanks debian/watch for the inspiration!
+ wget -q -O- 'http://www.ferzkopp.net/joomla/content/view/19/14/' | \
+ $(SED) -n 's,.*/joomla/\.\./Software/SDL_gfx\-2\.0/SDL_gfx-\([0-9][^"]*\)\.tar.*,\1,p'
+ head -1
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && ./configure \
+ --host='$(TARGET)' \
+ --disable-shared \
+ --prefix='$(PREFIX)/$(TARGET)' \
+ --with-sdl-prefix='$(PREFIX)/$(TARGET)'
+ $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-sdl_gfx.exe' \
+ `'$(TARGET)-pkg-config' SDL_gfx --cflags --libs`
+endef