diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2010-04-02 03:22:16 +0400 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2010-04-02 03:22:16 +0400 |
commit | 8e9f2603c505fd6c5619700af98931ad6957c783 (patch) | |
tree | b357299466d8d8085c1da012e7c3c1a8d8bfc32e /macx | |
parent | 4441ccc25e18be02169c4c3e2f8b49cdcba28fcf (diff) |
Move overlay loader from our app bundle to the loader itself. Bump loader version.
Diffstat (limited to 'macx')
-rw-r--r-- | macx/osax/osax.m | 50 | ||||
-rw-r--r-- | macx/osax/osax.plist | 2 | ||||
-rwxr-xr-x | macx/scripts/osxdist.py | 19 |
3 files changed, 13 insertions, 58 deletions
diff --git a/macx/osax/osax.m b/macx/osax/osax.m index c694c09f2..c0ffa858d 100644 --- a/macx/osax/osax.m +++ b/macx/osax/osax.m @@ -40,51 +40,11 @@ OSErr MumbleOverlayEventHandler(const AppleEvent *ae, AppleEvent *reply, long re return; } - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + /* + * Load the overlay lib - hard coded because we're the only consumer, and because we + * can only live in /Library/ScriptingAdditions/ + */ + dlopen("/Library/ScriptingAdditions/MumbleOverlay.osax/Contents/MacOS/libmumbleoverlay.dylib", RTLD_LAZY); - /* Get a hold of our Mumble process, to find our overlay library. */ - NSArray *apps = [[NSWorkspace sharedWorkspace] launchedApplications]; - NSString *mumblePath = nil; - - for (NSDictionary *dict in apps) { - if ([[dict objectForKey:@"NSApplicationBundleIdentifier"] isEqualToString:@"net.sourceforge.mumble.Mumble"]) { - mumblePath = [dict objectForKey:@"NSApplicationPath"]; - break; - } - if ([[dict objectForKey:@"NSApplicationBundleIdentifier"] isEqualToString:@"net.sourceforge.mumble.Mumble11x"]) { - mumblePath = [dict objectForKey:@"NSApplicationPath"]; - break; - } - } - - if (! mumblePath) { - fprintf(stderr, "MumbleOverlayLoader: Cannot find open Mumble instance. Bailing.\n"); - goto out; - } - - NSBundle *appBundle = [NSBundle bundleWithPath: mumblePath]; - if (! appBundle) { - fprintf(stderr, "MumbleOverlayLoader: Cannot open Mumble app bundle.\n"); - goto out; - } - - NSString *overlayInBundle = [appBundle objectForInfoDictionaryKey:@"MumbleOverlayLibrary"]; - if (! overlayInBundle) { - fprintf(stderr, "MumbleOverlayLoader: No key 'MumbleOverlayLibrary' specified in Mumble's property list. Cannot find overlay library.\n"); - goto out; - } - - NSString *overlayPath = [NSString stringWithFormat:@"%@/%@", mumblePath, overlayInBundle]; - - if (! [[NSFileManager defaultManager] fileExistsAtPath:overlayPath]) { - fprintf(stderr, "MumbleOverlayLoader: Overlay library non-existant at MumbleOverlayLibrary-specified path.\n"); - goto out; - } - - /* Load the overlay library. */ - dlopen([overlayPath UTF8String ], RTLD_LAZY); - -out: - [pool release]; return noErr; } diff --git a/macx/osax/osax.plist b/macx/osax/osax.plist index c514e2e8f..25c078954 100644 --- a/macx/osax/osax.plist +++ b/macx/osax/osax.plist @@ -36,6 +36,6 @@ </dict> </dict> <key>MumbleOverlayLoaderVersion</key> - <integer>1</integer> + <integer>2</integer> </dict> </plist> diff --git a/macx/scripts/osxdist.py b/macx/scripts/osxdist.py index 1f2e1468d..9892c5505 100755 --- a/macx/scripts/osxdist.py +++ b/macx/scripts/osxdist.py @@ -31,8 +31,11 @@ def create_overlay_tarball(sign=None): print '* Creating overlay loader installation tarball' bundle = os.path.join('release', 'MumbleOverlay.osax') + overlaylib = os.path.join(bundle, 'Contents', 'MacOS', 'libmumbleoverlay.dylib') + shutil.copy('release/libmumbleoverlay.dylib', overlaylib) if sign: codesign(sign, bundle) + codesign(sign, overlaylib) contents = [] for e in os.walk(bundle): root, dirs, files = e @@ -229,6 +232,8 @@ class AppBundle(object): rsrcpath = os.path.join(self.bundle, 'Contents', 'Resources') if not os.path.exists(rsrcpath): os.mkdir(rsrcpath) + + # Copy resources already in the bundle for rsrc in rsrcs: b = os.path.basename(rsrc) if os.path.isdir(rsrc): @@ -236,17 +241,8 @@ class AppBundle(object): elif os.path.isfile(rsrc): shutil.copy(rsrc, os.path.join(rsrcpath, b)) - def copy_overlay(self): - ''' - Copy overlay resources. - ''' - print ' * Copying overlay resources into bundle.' - - dst = os.path.join(self.bundle, 'Contents', 'Overlay') - os.makedirs(dst) - shutil.copy('release/libmumbleoverlay.dylib', dst) - shutil.copy('release/mumble-overlay', dst) - shutil.copy('release/MumbleOverlay.tar.bz2', dst) + # Extras + shutil.copy('release/MumbleOverlay.tar.bz2', os.path.join(rsrcpath, 'MumbleOverlay.tar.bz2')) def copy_codecs(self): ''' @@ -468,7 +464,6 @@ if __name__ == '__main__': a.set_min_macosx_version('10.4.8') a.copy_murmur() a.copy_g15helper() - a.copy_overlay() a.copy_codecs() a.copy_plugins() a.copy_qt_plugins() |