We currently have 3 library loaders:
- LinuxLibraryLoader (Linux)
- MachOLibraryLoader (Mac)
- LibraryLoader (generic when Linux and Mac aren't detected)
For some reason the generic loader repeats some functionality that is better
implemented in the specific ones, but never mind (I've fixed a bug on that).
This patch will make pyglet to load libraries found in the same directory of
the running script or its 'lib' subdirectory, *before* trying the system
libraries using ctypes.util.find_library (if available).
This is useful to distribute libraries with any pyglet project.
The patch adds specific support for Linux and Mac (Windows loads any DLL from
current directory by default).
In Linux I've refactored the code to find libraries and now is used both for
looking for local libs and in the fallback mechanism when ctypes' find_library
doesn't work.
In Mac I just prepended the paths to the ld_library_path as if LD_LIBRARY_PATH
were used.
I've added a new option in pyglet.options to disable this using
"search_local_libs" to False (True by default).
Patch attached, please comment!
Original issue reported on code.google.com by useboxnet on 28 Sep 2013 at 7:37
Original issue reported on code.google.com by
useboxnet
on 28 Sep 2013 at 7:37Attachments: