Root/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+++ Alpy-0.1.5/alpy.py 2012-03-28 03:08:24.794378142 +0200
5@@ -32,18 +32,18 @@
6     if not _ALLEGRO_USE_MODULES:
7         return __import__('_alpy')
8     _major, _minor = sys.version_info[:2]
9- try: import dl
10+ try: import DLFCN
11     except ImportError:
12- 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"
13+ 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"
14         print >> sys.stderr, "Warning: %s\n" % msg
15         return __import__('_alpy')
16     if _major > 2 or (_major == 2 and _minor >= 2):
17- sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
18+ sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
19         return __import__('_alpy')
20     else:
21         file, path, desc = imp.find_module('_alpy')
22         try:
23- handle = dl.open(path, dl.RTLD_NOW|dl.RTLD_GLOBAL)
24+ handle = DLFCN.open(path, DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
25             m = __import__('_alpy')
26             handle.close()
27             return m
28Index: Alpy-0.1.5/_alpymodule.c
29===================================================================
30--- Alpy-0.1.5.orig/_alpymodule.c 2012-03-29 00:20:15.351117567 +0200
31+++ Alpy-0.1.5/_alpymodule.c 2012-03-29 00:27:10.017151329 +0200
32@@ -29,6 +29,7 @@
33 #include "allegro.h"
34 #include <stdlib.h>
35 #include <string.h>
36+#include <dlfcn.h>
37 
38 static const char *_utf8 = "utf8";
39 
40@@ -237,6 +238,13 @@
41 {
42     int result, alpy_system = SYSTEM_AUTODETECT;
43 
44+ /* this is an ugly hack added for OpenWRT: seems that recursive library
45+ dependencies won't get the treatment configured in alpy.py via
46+ sys.setdlopenflags(), so that aleg-fbcon.so references into liballegro
47+ are not referenced. Of course we could also go and fix liballegro to
48+ make all modules explicitely link to liballegro themselves. */
49+ dlopen("liballeg.so", RTLD_NOW|RTLD_GLOBAL);
50+
51     if (!alpy_allegro_installed) {
52         alpy_allegro_installed++;
53 
54

Archive Download this file



interactive