diff --git a/index.html b/index.html index ab17b47e..691bbad3 100644 --- a/index.html +++ b/index.html @@ -1596,6 +1596,11 @@ USE_OSGPLUGIN(<plugin2>) 1.1.28 libxslt + + libzip + 0.10.1 + libzip + llvm 3.1 @@ -1966,6 +1971,11 @@ USE_OSGPLUGIN(<plugin2>) 1.2.15 SDL + + sdl_gfx + 2.0.24 + SDL_gfx + sdl_image 1.2.12 diff --git a/src/libzip-1-static_build.patch b/src/libzip-1-static_build.patch new file mode 100644 index 00000000..e3142633 --- /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 00000000..e253cf1a --- /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 00000000..e23b3255 --- /dev/null +++ b/src/libzip-test.c @@ -0,0 +1,42 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include + +/* 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 00000000..f9633011 --- /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 00000000..3a092f0d --- /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 +#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 00000000..e3ff8ff7 --- /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