This (inline and attached) patch adds support for loading .dylib libraries on OS X after you use pyinstaller.py to create an application out of your pyglet project.
For example, if you decode a compressed audio/video file, then you need
pyglet to load libavbin.dylib. With pyinstaller, this means adding the
following item to your COLLECT() collection (since pyglet is so tricky
about loading avbin that pyinstaller doesn't auto-detect it):
[('libavbin.dylib','/usr/local/lib/libavbin.dylib','BIN')]
...and then the patch below handles the rest.
Will someone please commit this?
~ Nathan
# HG changeset patch
# User Nathan Stocks <[email protected]>
# Date 1349754330 21600
# Node ID b016e8b5a2062d778bb49957b77b918664bf80d2
# Parent f8102f9ee5b19c43c6129dac070bf393f82e3ef7
Added dynamic library loading support for pyinstaller's handling of dynamic
libraries on OS X.
diff -r f8102f9ee5b1 -r b016e8b5a206 pyglet/lib.py
--- a/pyglet/lib.py Wed Oct 03 22:56:46 2012 -0600
+++ b/pyglet/lib.py Mon Oct 08 21:45:30 2012 -0600
@@ -185,6 +185,12 @@
'Frameworks',
libname))
+ # pyinstaller.py sets sys.frozen to True, and puts dylibs in
Contents/MacOS, which path pyinstaller puts in sys._MEIPASS
+ if hasattr(sys, 'frozen') and hasattr(sys, '_MEIPASS') and
sys.frozen == True and sys.platform == 'darwin':
+ search_path.append(os.path.join(
+ sys._MEIPASS,
+ libname))
+
if '/' in path:
search_path.extend(
[os.path.join(p, libname) \
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en.
pyinstaller_dylib_support.diff
Description: Binary data
