Merge pull request #4926 from Memphiz/osxfixpython
authorMemphiz <memphis@machzwo.de>
Sun, 22 Jun 2014 20:09:06 +0000 (22:09 +0200)
committerTrent Nelson <trent.nelson@pivosgroup.com>
Tue, 8 Jul 2014 07:26:52 +0000 (15:26 +0800)
[osx/depends] - add a fake Info.plist to target python26 for allowing codesign...

tools/darwin/Support/copyframeworks-osx.command
xbmc/osx/DarwinUtils.mm

index 1635c56..234b116 100755 (executable)
@@ -54,15 +54,15 @@ TARGET_NAME=$PRODUCT_NAME
 TARGET_CONTENTS=$TARGET_BUILD_DIR/$TARGET_NAME/Contents
 
 TARGET_BINARY=$TARGET_CONTENTS/MacOS/XBMC
-TARGET_FRAMEWORKS=$TARGET_CONTENTS/Frameworks
-DYLIB_NAMEPATH=@executable_path/../Frameworks
+TARGET_FRAMEWORKS=$TARGET_CONTENTS/Libraries
+DYLIB_NAMEPATH=@executable_path/../Libraries
 XBMC_HOME=$TARGET_CONTENTS/Resources/XBMC
 
 mkdir -p "$TARGET_CONTENTS/MacOS"
 mkdir -p "$TARGET_CONTENTS/Resources"
 # start clean so we don't keep old dylibs
-rm -rf "$TARGET_CONTENTS/Frameworks"
-mkdir -p "$TARGET_CONTENTS/Frameworks"
+rm -rf "$TARGET_CONTENTS/Libraries"
+mkdir -p "$TARGET_CONTENTS/Libraries"
 
 echo "Package $TARGET_BUILD_DIR/XBMC"
 cp -f "$TARGET_BUILD_DIR/XBMC" "$TARGET_BINARY"
@@ -82,7 +82,7 @@ for a in $(otool -L "$TARGET_BINARY"  | grep "$EXTERNAL_LIBS" | awk ' { print $1
 done
 
 echo "Package $EXTERNAL_LIBS/lib/python2.6"
-mkdir -p "$TARGET_CONTENTS/Frameworks/lib"
+mkdir -p "$TARGET_CONTENTS/Libraries/lib"
 PYTHONSYNC="rsync -aq --exclude .DS_Store --exclude *.a --exclude *.exe --exclude test --exclude tests"
 ${PYTHONSYNC} "$EXTERNAL_LIBS/lib/python2.6" "$TARGET_FRAMEWORKS/lib/"
 rm -rf "$TARGET_FRAMEWORKS/lib/python2.6/config"
index 6a7c659..f7ce3da 100644 (file)
@@ -273,11 +273,21 @@ int  GetDarwinFrameworkPath(bool forPython, char* path, uint32_t *pathsize)
   }
 
   // d) XBMC application running under OSX
-  pathname = [[NSBundle mainBundle] privateFrameworksPath];
+  pathname = [[NSBundle mainBundle] executablePath];
   if (pathname && strstr([pathname UTF8String], "Contents"))
   {
-    // check for 'Contents' if we are running as real xbmc.app
     strcpy(path, [pathname UTF8String]);
+    // ExectuablePath is <product>.app/Contents/MacOS/<executable>
+    char *lastSlash = strrchr(path, '/');
+    if (lastSlash)
+    {
+      *lastSlash = '\0';//remove /<executable>  
+      lastSlash = strrchr(path, '/');
+      if (lastSlash)
+        *lastSlash = '\0';//remove /MacOS
+    }
+    strcat(path, "/Libraries");//add /Libraries
+    //we should have <product>.app/Contents/Libraries now
     *pathsize = strlen(path);
     //CLog::Log(LOGDEBUG, "DarwinFrameworkPath(d) -> %s", path);
     return 0;