projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
bca7389
)
Partial reorganization of Mac OS bundeling script.
author
Marcus Eggenberger
<egs@quassel-irc.org>
Thu, 9 May 2013 10:32:55 +0000
(12:32 +0200)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Thu, 9 May 2013 10:54:51 +0000
(12:54 +0200)
scripts/build/macosx_DeployApp.py
patch
|
blob
|
history
diff --git
a/scripts/build/macosx_DeployApp.py
b/scripts/build/macosx_DeployApp.py
index
83ca5a0
..
a7aae57
100755
(executable)
--- a/
scripts/build/macosx_DeployApp.py
+++ b/
scripts/build/macosx_DeployApp.py
@@
-31,18
+31,13
@@
class InstallQt(object):
else:
self.frameworkDir = self.executableDir + "/Frameworks"
else:
self.frameworkDir = self.executableDir + "/Frameworks"
- self.
needFrameworks = []
+ self.
installedFrameworks = set()
self.findFrameworkPath()
executables = [self.executableDir + "/" + executable for executable in os.listdir(self.executableDir)]
self.findFrameworkPath()
executables = [self.executableDir + "/" + executable for executable in os.listdir(self.executableDir)]
-
for executable in executables:
for executable in executables:
- for framework,lib in self.determineDependancies(executable):
- if framework not in self.needFrameworks:
- self.needFrameworks.append(framework)
- self.installFramework(framework)
- self.changeDylPath(executable)
+ self.resolveDependancies(executable)
def findFrameworkPath(self):
qmakeProcess = Popen('qmake -query QT_INSTALL_LIBS', shell=True, stdout=PIPE, stderr=PIPE)
def findFrameworkPath(self):
qmakeProcess = Popen('qmake -query QT_INSTALL_LIBS', shell=True, stdout=PIPE, stderr=PIPE)
@@
-50,8
+45,20
@@
class InstallQt(object):
qmakeProcess.stdout.close()
qmakeProcess.wait()
qmakeProcess.stdout.close()
qmakeProcess.wait()
+ def resolveDependancies(self, obj):
+ # obj must be either an application binary or a framework library
+ for framework, lib in self.determineDependancies(obj):
+ self.installFramework(framework)
+ self.changeDylPath(obj, lib)
def installFramework(self, framework):
def installFramework(self, framework):
+ # skip if framework is already installed.
+ if framework in self.installedFrameworks:
+ return
+
+ self.installedFrameworks.add(framework)
+
+ # ensure that the framework directory exists
try:
os.mkdir(self.frameworkDir)
except:
try:
os.mkdir(self.frameworkDir)
except:
@@
-88,8
+95,9
@@
class InstallQt(object):
newlibname = "@executable_path/%s%s" % (frameworkname, libpath)
#print 'install_name_tool -id "%s" "%s"' % (newlibname, lib)
os.system('install_name_tool -id "%s" "%s"' % (newlibname, lib))
newlibname = "@executable_path/%s%s" % (frameworkname, libpath)
#print 'install_name_tool -id "%s" "%s"' % (newlibname, lib)
os.system('install_name_tool -id "%s" "%s"' % (newlibname, lib))
- self.changeDylPath(lib)
-
+
+ self.resolveDependancies(lib)
+
def determineDependancies(self, app):
otoolPipe = Popen('otool -L "%s"' % app, shell=True, stdout=PIPE).stdout
otoolOutput = [line for line in otoolPipe]
def determineDependancies(self, app):
otoolPipe = Popen('otool -L "%s"' % app, shell=True, stdout=PIPE).stdout
otoolOutput = [line for line in otoolPipe]
@@
-100,17
+108,15
@@
class InstallQt(object):
frameworks = [lib[:lib.find(".framework")+len(".framework")] for lib in libs]
return zip(frameworks, libs)
frameworks = [lib[:lib.find(".framework")+len(".framework")] for lib in libs]
return zip(frameworks, libs)
- def changeDylPath(self, obj):
- for framework, lib in self.determineDependancies(obj):
- frameworkname = framework.split('/')[-1]
- frameworkpath, libpath = lib.split(frameworkname)
- if self.bundle:
- newlibname = "@executable_path/../Frameworks/%s%s" % (frameworkname, libpath)
- else:
- newlibname = "@executable_path/Frameworks/%s%s" % (frameworkname, libpath)
- #print 'install_name_tool -change "%s" "%s" "%s"' % (lib, newlibname, obj)
- os.system('install_name_tool -change "%s" "%s" "%s"' % (lib, newlibname, obj))
+ def changeDylPath(self, obj, lib):
+ if self.bundle:
+ newlibname = "@executable_path/../Frameworks/%s" % lib
+ else:
+ newlibname = "@executable_path/Frameworks/%s" % lib
+
+ #print 'install_name_tool -change "%s" "%s" "%s"' % (lib, newlibname, obj)
+ os.system('install_name_tool -change "%s" "%s" "%s"' % (lib, newlibname, obj))
if __name__ == "__main__":
if len(sys.argv) < 2:
if __name__ == "__main__":
if len(sys.argv) < 2:
@@
-130,5
+136,3
@@
if __name__ == "__main__":
targetDir += "/Contents"
InstallQt(targetDir, bundle)
targetDir += "/Contents"
InstallQt(targetDir, bundle)
-
-