self.needFrameworks = []
+ self.findFrameworkPath()
+
executables = [self.executableDir + "/" + executable for executable in os.listdir(self.executableDir)]
for executable in executables:
self.installFramework(framework)
self.changeDylPath(executable)
+ def findFrameworkPath(self):
+ qmakeProcess = Popen('qmake -query QT_INSTALL_LIBS', shell=True, stdout=PIPE, stderr=PIPE)
+ self.sourceFrameworkPath = qmakeProcess.stdout.read().strip()
+ qmakeProcess.stdout.close()
+ qmakeProcess.wait()
+
+
def installFramework(self, framework):
try:
os.mkdir(self.frameworkDir)
except:
pass
+ if not framework.startswith('/'):
+ framework = "%s/%s" % (self.sourceFrameworkPath, framework)
+
# Copy Framework
os.system('cp -R "%s" "%s"' % (framework, self.frameworkDir))
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 and not "@executable_path" in line]
+ 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]
return zip(frameworks, libs)