On 01/10/13 10:23, Paul Colomiets wrote:
> Hi Juan,
>
> On Mon, Sep 30, 2013 at 7:50 PM, "Juan J. Martínez" <[email protected]> wrote:
>> Try it and let me know if it works in Mac:
>>
>
> Here is what search paths I get:
>
> SEARCH PATH ['/usr/local/lib/libavbin.dylib',
> '/Users/pc/lib/libavbin.dylib', '/usr/local/lib/libavbin.dylib',
> '/usr/lib/libavbin.dylib']
> SEARCH PATH
> ['/Users/pc/dev/skyward/build/Skyward_LM.app/Contents/MacOS/avbin',
> '/Users/pc/dev/skyward/build/Skyward_LM.app/Contents/MacOS/lib/avbin',
> 'avbin', '/Users/pc/lib/avbin', '/usr/local/lib/avbin',
> '/usr/lib/avbin']
>
> The bug is that paths starting with slash are searched in
> "DYLD_LIBRARY_PATH" and relative paths are searched in
> "LD_LIBRARY_PATH". Not sure what specific fix to apply.
Uff, I'm not sure how it works. I added it to LD_LIBRARY_PATH because I
thought that was the right place. I'll check the code this evening, may
be I missed something.
See the patch:
http://code.google.com/p/pyglet/source/detail?r=da26d7e1c3e71dfcc415e3cdec85a4f9a3add387
Should we add the same in DYLD_LIBRARY_PATH part?
Try the attached patch (you may need to change it, it was a quick shot
in the dark!).
> Also is it intended that bare name, without lib*.dylib is searched
> for? I believe it's same crappy problem of using same function call
> for name and libname.dylib that is wrong. In fact there are dynamic
> libraries in OS X without extension but they are loaded with
> load_framework.
ctypes uses the bare name (you just look for "avbin").
I've seen the load_framework part but I don't really know how it works.
I'm going to need your help here because I'm changing thing blindly. The
Linux part it's OK, Windows still OK, only Mac needs tweaking.
Regards,
Juan
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.
diff -r f697f60235f3 pyglet/lib.py
--- a/pyglet/lib.py Mon Sep 30 17:43:56 2013 +0100
+++ b/pyglet/lib.py Tue Oct 01 10:36:17 2013 +0100
@@ -157,16 +157,20 @@
else:
self.ld_library_path = []
- if _local_lib_paths:
- # search first for local libs
- self.ld_library_path = _local_lib_paths + self.ld_library_path
- os.environ['LD_LIBRARY_PATH'] = ':'.join(self.ld_library_path)
-
if 'DYLD_LIBRARY_PATH' in os.environ:
self.dyld_library_path = os.environ['DYLD_LIBRARY_PATH'].split(':')
else:
self.dyld_library_path = []
+ if _local_lib_paths:
+ # search first for local libs
+ absolute_paths = [path for path in _local_lib_paths if os.path.isabs(path)]
+ relative_paths = [path for path in _local_lib_paths if not os.path.isabs(path)]
+ self.ld_library_path = relative_paths + self.ld_library_path
+ os.environ['LD_LIBRARY_PATH'] = ':'.join(self.ld_library_path)
+ self.dyld_library_path = absolute_paths + self.dyld_library_path
+ os.environ['DYLD_LIBRARY_PATH'] = ':'.join(self.dyld_library_path)
+
if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ:
self.dyld_fallback_library_path = \
os.environ['DYLD_FALLBACK_LIBRARY_PATH'].split(':')