X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=scripts%2Fbuild%2Fmacosx_DeployApp.py;h=edcb13c6af6d62f3db67c770b6c94b66f2ad0380;hp=e6cfc1d189ac29f4acc49fbf8133789fb40c81b2;hb=28eb43dd1ccd882b2975c346297842c1dc074469;hpb=465e723c31d36f28eff7665ca2a8e0fb34427c29 diff --git a/scripts/build/macosx_DeployApp.py b/scripts/build/macosx_DeployApp.py index e6cfc1d1..edcb13c6 100755 --- a/scripts/build/macosx_DeployApp.py +++ b/scripts/build/macosx_DeployApp.py @@ -19,6 +19,9 @@ import os.path from subprocess import Popen, PIPE +# Handling Qt properties +import macosx_qt + # ============================== # Constants # ============================== @@ -33,7 +36,7 @@ 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,42 +55,14 @@ class InstallQt(object): self.findPluginsPath() self.installPlugins(requestedPlugins) - self.installQtConf() - - def qtProperty(self, qtProperty): - """ - Query persistent property of Qt via qmake - """ - VALID_PROPERTIES = ['QT_INSTALL_PREFIX', - 'QT_INSTALL_DATA', - 'QT_INSTALL_DOCS', - 'QT_INSTALL_HEADERS', - 'QT_INSTALL_LIBS', - 'QT_INSTALL_BINS', - 'QT_INSTALL_PLUGINS', - 'QT_INSTALL_IMPORTS', - 'QT_INSTALL_TRANSLATIONS', - 'QT_INSTALL_CONFIGURATION', - 'QT_INSTALL_EXAMPLES', - 'QT_INSTALL_DEMOS', - 'QMAKE_MKSPECS', - 'QMAKE_VERSION', - 'QT_VERSION' - ] - if qtProperty not in VALID_PROPERTIES: - return None - - qmakeProcess = Popen('qmake -query %s' % qtProperty, shell=True, stdout=PIPE, stderr=PIPE) - result = qmakeProcess.stdout.read().strip() - qmakeProcess.stdout.close() - qmakeProcess.wait() - return result + if not skipInstallQtConf: + self.installQtConf() def findFrameworkPath(self): - self.sourceFrameworkPath = self.qtProperty('QT_INSTALL_LIBS') + self.sourceFrameworkPath = macosx_qt.qtProperty('QT_INSTALL_LIBS') def findPluginsPath(self): - self.sourcePluginsPath = self.qtProperty('QT_INSTALL_PLUGINS') + self.sourcePluginsPath = macosx_qt.qtProperty('QT_INSTALL_PLUGINS') def findPlugin(self, pluginname): qmakeProcess = Popen('find %s -name %s' % (self.sourcePluginsPath, pluginname), shell=True, stdout=PIPE, stderr=PIPE) @@ -153,6 +128,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) @@ -162,12 +143,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) @@ -189,6 +174,7 @@ class InstallQt(object): else: newlibname = "@executable_path/%s%s" % (frameworkname, libpath) # 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) @@ -210,6 +196,8 @@ class InstallQt(object): newlibname = "@executable_path/Frameworks/%s" % newlibname # 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__": @@ -235,3 +223,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)