diff --git a/alpy/Makefile b/alpy/Makefile index d4e8b1c..c151e33 100644 --- a/alpy/Makefile +++ b/alpy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alpy PKG_VERSION:=0.1.5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=Alpy-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/project/pyallegro/alpy/alpy-$(PKG_VERSION) PKG_MD5SUM:=862925d97931fc81d1e4c3b9159fe2b1 @@ -24,7 +24,8 @@ define Package/alpy/Default CATEGORY:=Languages TITLE:=Alpy (Allegro bindings for Python) URL:=https://sourceforge.net/projects/forth-alpy/ - DEPENDS:=+python-mini +liballegro + DEPENDS:=+python-mini +liballegro +liballegro-png +liballegro-jpeg + endef define Package/alpy/Default/description @@ -43,7 +44,7 @@ endef define Package/alpy-examples $(call Package/alpy/Default) TITLE:=Alpy Example Python Scripts - DEPENDS:=+alpy +liballegro-demo + DEPENDS:=+alpy +liballegro-demo endef define Package/alpy-examples/description @@ -69,7 +70,15 @@ endef # $(PKG_BUILD_DIR)/setup.py build # endef -TARGET_LDFLAGS += -lm -lpthread -ldl -lrt -lalleg +# Note: this linking command will not work correctly when jpgalleg or loadpng +# are linked statically (Note how we patched allegro to make sure these are +# always compiled as dynamic libraries). The problem probably is, that +# Build/Compile adds these linking options to early in the command line, and +# static libraries won't resolve symbols of objects added later on. +# +# You won't even see a compiler error; the resulting _alpy.so would be going +# to segfault due to an unresolved (0-pointer) symbol. +TARGET_LDFLAGS += -ljpgalleg -lloadpng -lalleg -lpng -lz -lm -lpthread -ldl -lrt define Build/Install $(call Build/Compile/PyMod,, \ diff --git a/alpy/patches/030-png-jpeg-addons.patch b/alpy/patches/030-png-jpeg-addons.patch new file mode 100644 index 0000000..6362054 --- /dev/null +++ b/alpy/patches/030-png-jpeg-addons.patch @@ -0,0 +1,37 @@ +Index: Alpy-0.1.5/_alpymodule.c +=================================================================== +--- Alpy-0.1.5.orig/_alpymodule.c 2012-03-31 01:15:51.052570081 +0200 ++++ Alpy-0.1.5/_alpymodule.c 2012-03-31 01:20:50.874079951 +0200 +@@ -27,6 +27,8 @@ + + #include "Python.h" + #include "allegro.h" ++#include "loadpng.h" ++#include "jpgalleg.h" + #include + #include + #include +@@ -253,6 +255,10 @@ + } + + result = install_allegro(alpy_system, &errno, atexit); ++ if (result == 0) ++ result = loadpng_init(); ++ if (result == 0) ++ result = jpgalleg_init(); + + return PyInt_FromLong(result); + } +@@ -2599,6 +2605,12 @@ + else if(strcmp(type, "lbm")==0) { + bmp = Bitmap_Object_from_BITMAP(load_lbm(filename, PAL(pal))); + } ++ else if(strcmp(type, "png")==0) { ++ bmp = Bitmap_Object_from_BITMAP(load_png(filename, PAL(pal))); ++ } ++ else if(strcmp(type, "jpg")==0 || strcmp(type, "jpeg")==0) { ++ bmp = Bitmap_Object_from_BITMAP(load_jpg(filename, PAL(pal))); ++ } + else { + PyMem_Free(filename); + PyErr_SetString(AllegroError, "unknown image type");