Date:2012-03-28 03:22:54 (12 years 21 hours ago)
Author:David Kühling
Commit:b2d16d9654e071417e838174431fcb1fe60ae3a5
Message:new package: alpy: python bindings for allegro game library (currently crashes on allegro_init(), dlopen unresolved symbol issue?)

Files: alpy/Makefile (1 diff)
alpy/patches/005-dl.patch (1 diff)

Change Details

alpy/Makefile
1#
2# Copyright (C) 2012 David Kuehling <dvdkhlng TA gmx TOD de>
3#
4# License GPLv2 or later. NO WARRANTY.
5#
6# OpenWRT package for Alpy: Allegro Game Library bindings for Python
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=alpy
11PKG_VERSION:=0.1.5
12PKG_RELEASE:=1
13PKG_SOURCE:=Alpy-$(PKG_VERSION).tar.gz
14PKG_SOURCE_URL:=@SF/project/pyallegro/alpy/alpy-$(PKG_VERSION)
15PKG_MD5SUM:=862925d97931fc81d1e4c3b9159fe2b1
16PKG_BUILD_DIR:=$(BUILD_DIR)/Alpy-$(PKG_VERSION)
17PKG_INSTALL:=1
18
19include $(INCLUDE_DIR)/package.mk
20$(call include_mk, python-package.mk)
21
22define Package/alpy/Default
23  SECTION:=libs
24  CATEGORY:=Languages
25  TITLE:=Alpy (Allegro bindings for Python)
26  URL:=https://sourceforge.net/projects/forth-alpy/
27  DEPENDS:=+python-mini +liballegro
28endef
29
30define Package/alpy/Default/description
31Python bindings for the Allegro Game and Graphics Library
32endef
33
34define Package/alpy
35$(call Package/alpy/Default)
36endef
37
38define Package/alpy/description
39$(call Package/alpy/Default/description)
40endef
41
42CONFIGURE_ARGS +=
43
44define Build/Compile
45    $(call Build/Compile/PyMod,,build)
46endef
47# --prefix="$(PKG_INSTALL_DIR)/usr" , \
48# LOCALBASE="$(STAGING_DIR)/usr" \
49# NO_SCRAP=1 \
50# )
51
52# define Build/Configure
53# # $(call Build/Configure/Default)
54# endef
55
56# define Build/Compile
57# CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CFLAGS) $(TARGET_LDFLAGS)" \
58# $(PKG_BUILD_DIR)/setup.py build
59# endef
60
61TARGET_LDFLAGS += -lalleg -lm -lpthread
62
63define Build/Install
64    $(call Build/Compile/PyMod,, \
65        install --root $(PKG_INSTALL_DIR) --prefix=/usr)
66endef
67
68# define Package/alpy/install
69# $(INSTALL_DIR) $(1)/usr
70# $(CP) $(PKG_INSTALL_DIR)/usr/* $(1)/usr/
71# endef
72
73define PyPackage/alpy/filespec
74+|$(PYTHON_PKG_DIR)/alpy.py
75+|$(PYTHON_PKG_DIR)/_alpy.so
76endef
77
78$(eval $(call PyPackage,alpy))
79$(eval $(call BuildPackage,alpy))
80
81# The following comments configure the Emacs editor. Just ignore them.
82# Local Variables:
83# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/alpy/compile -j2 V=99"
84# End:
alpy/patches/005-dl.patch
1Index: Alpy-0.1.5/alpy.py
2===================================================================
3--- Alpy-0.1.5.orig/alpy.py 2012-03-28 03:07:42.682184386 +0200
4@@ -32,18 +32,18 @@
5     if not _ALLEGRO_USE_MODULES:
6         return __import__('_alpy')
7     _major, _minor = sys.version_info[:2]
8- try: import dl
9+ try: import DLFCN
10     except ImportError:
11- msg = "Sorry, to be able to use Allegro loadable modules you need to install the 'dl' module: you can still use Alpy, but some features will not be available"
12+ msg = "Sorry, to be able to use Allegro loadable modules you need to install the 'DLFCN' module: you can still use Alpy, but some features will not be available"
13         print >> sys.stderr, "Warning: %s\n" % msg
14         return __import__('_alpy')
15     if _major > 2 or (_major == 2 and _minor >= 2):
16- sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
17+ sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
18         return __import__('_alpy')
19     else:
20         file, path, desc = imp.find_module('_alpy')
21         try:
22- handle = dl.open(path, dl.RTLD_NOW|dl.RTLD_GLOBAL)
23+ handle = DLFCN.open(path, DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
24             m = __import__('_alpy')
25             handle.close()
26             return m

Archive Download the corresponding diff file



interactive