After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341799 - patch to make gst-python work on OSes without dl.so
patch to make gst-python work on OSes without dl.so
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other FreeBSD
: Normal normal
: 0.10.5
Assigned To: GStreamer Maintainers
Johan (not receiving bugmail) Dahlin
Depends on:
Blocks:
 
 
Reported: 2006-05-15 05:02 UTC by Yuri Pankov
Modified: 2006-05-27 12:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
modified patch to include more OS (1.10 KB, patch)
2006-05-15 22:48 UTC, Yuri Pankov
none Details | Review

Description Yuri Pankov 2006-05-15 05:02:56 UTC
Patch to make gst-python work on OSes without dl.so (FreeBSD/amd64 for example). It's incomplete and may be not well written due to lack of python knowledge.

--- __init__.py.orig    Mon May 15 08:12:50 2006
+++ __init__.py Mon May 15 08:58:32 2006
@@ -83,17 +83,36 @@
    def __repr__(self):
       return '<gst.Fraction %d/%d>' % (self.num, self.denom)

-import DLFCN, sys
+import sys
 dlsave = sys.getdlopenflags()
-sys.setdlopenflags(DLFCN.RTLD_LAZY | DLFCN.RTLD_GLOBAL)
+try:
+    from DLFCN import RTLD_GLOBAL, RTLD_LAZY
+except ImportError:
+    RTLD_GLOBAL = -1
+    RTLD_LAZY = -1
+    import os
+    osname = os.uname()[0]
+    if osname == 'FreeBSD':
+        RTLD_GLOBAL = 0x100
+        RTLD_LAZY = 0x1
+    elif osname == 'Linux':
+        RTLD_GLOBAL = 0x0 # dunno
+        RTLD_LAZY = 0x0 # dunno
+    # and so on
+    del os
+except:
+    RTLD_GLOBAL = -1
+    RTLD_LAZY = -1

-from _gst import *
-import interfaces
+if RTLD_GLOBAL != -1 and RTLD_LAZY != -1:
+    sys.setdlopenflags(RTLD_LAZY | RTLD_GLOBAL)
+    from _gst import *
+    import interfaces

 version = get_gst_version

 sys.setdlopenflags(dlsave)
-del DLFCN, sys
+del sys

 # this restores previously installed importhooks, so we don't interfere
 # with other people's module importers
Comment 1 Yuri Pankov 2006-05-15 22:48:08 UTC
Created attachment 65554 [details] [review]
modified patch to include more OS
Comment 2 Edward Hervey 2006-05-27 12:19:18 UTC
2006-05-27  Yuri Pankov <yuri.pankov@gmail.com>

        reviewed by: Edward Hervey <edward@fluendo.com>

        * gst/__init__.py:
        Make gst-python work on OS without dl.so
        Fixes #341799