1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-16 23:53:08 +02:00
openwrt-packages/alpy/patches/005-dl.patch

54 lines
2.2 KiB
Diff

Index: Alpy-0.1.5/alpy.py
===================================================================
--- Alpy-0.1.5.orig/alpy.py 2012-03-28 03:07:42.682184386 +0200
+++ Alpy-0.1.5/alpy.py 2012-03-28 03:08:24.794378142 +0200
@@ -32,18 +32,18 @@
if not _ALLEGRO_USE_MODULES:
return __import__('_alpy')
_major, _minor = sys.version_info[:2]
- try: import dl
+ try: import DLFCN
except ImportError:
- 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"
+ 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"
print >> sys.stderr, "Warning: %s\n" % msg
return __import__('_alpy')
if _major > 2 or (_major == 2 and _minor >= 2):
- sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
+ sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
return __import__('_alpy')
else:
file, path, desc = imp.find_module('_alpy')
try:
- handle = dl.open(path, dl.RTLD_NOW|dl.RTLD_GLOBAL)
+ handle = DLFCN.open(path, DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
m = __import__('_alpy')
handle.close()
return m
Index: Alpy-0.1.5/_alpymodule.c
===================================================================
--- Alpy-0.1.5.orig/_alpymodule.c 2012-03-29 00:20:15.351117567 +0200
+++ Alpy-0.1.5/_alpymodule.c 2012-03-29 00:27:10.017151329 +0200
@@ -29,6 +29,7 @@
#include "allegro.h"
#include <stdlib.h>
#include <string.h>
+#include <dlfcn.h>
static const char *_utf8 = "utf8";
@@ -237,6 +238,13 @@
{
int result, alpy_system = SYSTEM_AUTODETECT;
+ /* this is an ugly hack added for OpenWRT: seems that recursive library
+ dependencies won't get the treatment configured in alpy.py via
+ sys.setdlopenflags(), so that aleg-fbcon.so references into liballegro
+ are not referenced. Of course we could also go and fix liballegro to
+ make all modules explicitely link to liballegro themselves. */
+ dlopen("liballeg.so", RTLD_NOW|RTLD_GLOBAL);
+
if (!alpy_allegro_installed) {
alpy_allegro_installed++;