X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=scripts%2Fbuild%2Fmacosx_DeployApp.py;h=4ca72b49f65e823bf1fb98fc2313a0cbf724a536;hb=c8102e95706ac43e88364bb1fa3bef69e0145c84;hp=c1cddf55f63711beba078c453101365eba212be3;hpb=d6888a62baaa3cbb5fcf461aafa1fbf5197c4f49;p=quassel.git diff --git a/scripts/build/macosx_DeployApp.py b/scripts/build/macosx_DeployApp.py index c1cddf55..4ca72b49 100755 --- a/scripts/build/macosx_DeployApp.py +++ b/scripts/build/macosx_DeployApp.py @@ -32,10 +32,8 @@ QT_CONFIG_NOBUNDLE = """[Paths] """ - - class InstallQt(object): - def __init__(self, appdir, bundle = True, requestedPlugins=[]): + def __init__(self, appdir, bundle=True, requestedPlugins=[], skipInstallQtConf=False): self.appDir = appdir self.bundle = bundle self.frameworkDir = self.appDir + "/Frameworks" @@ -52,10 +50,10 @@ class InstallQt(object): for executable in executables: self.resolveDependancies(executable) - self.findPluginsPath() self.installPlugins(requestedPlugins) - self.installQtConf() + if not skipInstallQtConf: + self.installQtConf() def qtProperty(self, qtProperty): """ @@ -101,7 +99,6 @@ class InstallQt(object): raise OSError return result - def installPlugins(self, requestedPlugins): try: os.mkdir(self.pluginDir) @@ -145,7 +142,7 @@ class InstallQt(object): def resolveDependancies(self, obj): # obj must be either an application binary or a framework library - #print "resolving deps for:", obj + # print "resolving deps for:", obj for framework, lib in self.determineDependancies(obj): self.installFramework(framework) self.changeDylPath(obj, framework, lib) @@ -157,6 +154,12 @@ class InstallQt(object): self.installedFrameworks.add(framework) + # if the Framework-Folder is a Symlink we are in a Helper-Process ".app" (e.g. in QtWebEngine), + # in this case skip copying/installing on existing folders + skipExisting = False; + if os.path.islink(self.frameworkDir): + skipExisting = True; + # ensure that the framework directory exists try: os.mkdir(self.frameworkDir) @@ -166,12 +169,16 @@ class InstallQt(object): if not framework.startswith('/'): framework = "%s/%s" % (self.sourceFrameworkPath, framework) - # Copy Framework - os.system('cp -R "%s" "%s"' % (framework, self.frameworkDir)) - frameworkname = framework.split('/')[-1] localframework = self.frameworkDir + "/" + frameworkname + # Framework already installed in previous run ... see above + if skipExisting and os.path.isdir(localframework): + return + + # Copy Framework + os.system('cp -R "%s" "%s"' % (framework, self.frameworkDir)) + # De-Myllify os.system('find "%s" -name *debug* -exec rm -f {} \;' % localframework) os.system('find "%s" -name Headers -exec rm -rf {} \; 2>/dev/null' % localframework) @@ -185,14 +192,15 @@ class InstallQt(object): except: libname = '' otoolProcess.stdout.close() - if otoolProcess.wait() == 1: # we found some Resource dir or similar -> skip + if otoolProcess.wait() == 1: # we found some Resource dir or similar -> skip continue frameworkpath, libpath = libname.split(frameworkname) if self.bundle: newlibname = "@executable_path/../%s%s" % (frameworkname, libpath) else: newlibname = "@executable_path/%s%s" % (frameworkname, libpath) - #print 'install_name_tool -id "%s" "%s"' % (newlibname, lib) + # print 'install_name_tool -id "%s" "%s"' % (newlibname, lib) + os.system('chmod +w "%s"' % (lib)) os.system('install_name_tool -id "%s" "%s"' % (newlibname, lib)) self.resolveDependancies(lib) @@ -201,14 +209,11 @@ class InstallQt(object): otoolPipe = Popen('otool -L "%s"' % app, shell=True, stdout=PIPE).stdout otoolOutput = [line for line in otoolPipe] otoolPipe.close() - libs = [line.split()[0] for line in otoolOutput[1:] if ("Qt" in line - or "phonon" in line) - and not "@executable_path" in line] - frameworks = [lib[:lib.find(".framework")+len(".framework")] for lib in libs] - frameworks = [framework[framework.rfind('/')+1:] for framework in frameworks] + libs = [line.split()[0] for line in otoolOutput[1:] if ("Qt" in line or "phonon" in line) and "@executable_path" not in line] + frameworks = [lib[:lib.find(".framework") + len(".framework")] for lib in libs] + frameworks = [framework[framework.rfind('/') + 1:] for framework in frameworks] return zip(frameworks, libs) - def changeDylPath(self, obj, framework, lib): newlibname = framework + lib.split(framework)[1] if self.bundle: @@ -216,7 +221,9 @@ class InstallQt(object): else: newlibname = "@executable_path/Frameworks/%s" % newlibname - #print 'install_name_tool -change "%s" "%s" "%s"' % (lib, newlibname, obj) + # print 'install_name_tool -change "%s" "%s" "%s"' % (lib, newlibname, obj) + os.system('chmod +w "%s"' % (lib)) + os.system('chmod +w "%s"' % (obj)) os.system('install_name_tool -change "%s" "%s" "%s"' % (lib, newlibname, obj)) if __name__ == "__main__": @@ -242,3 +249,10 @@ if __name__ == "__main__": targetDir += "/Contents" InstallQt(targetDir, bundle, plugins) + + if bundle: + webenginetarget = targetDir + '/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents' + + if os.path.isdir(webenginetarget): + os.system('ln -s ../../../../../../ "%s"/Frameworks' % webenginetarget) + InstallQt(webenginetarget, bundle, [], True)