Removed obsolete code and used Qt to codesign #4397
This commit is contained in:
parent
3b44f9d6c5
commit
f5cac2846e
|
@ -795,8 +795,6 @@ class InternalCommands:
|
|||
for target in targets:
|
||||
self.macPostMake(target)
|
||||
|
||||
self.fixQtFrameworksLayout()
|
||||
|
||||
def symlink(self, source, target):
|
||||
if not os.path.exists(target):
|
||||
os.symlink(source, target)
|
||||
|
@ -805,39 +803,6 @@ class InternalCommands:
|
|||
if os.path.exists(source):
|
||||
shutil.move(source, target)
|
||||
|
||||
def fixQtFrameworksLayout(self):
|
||||
# reorganize Qt frameworks layout on Mac 10.9.5 or later
|
||||
# http://goo.gl/BFnQ8l
|
||||
# QtCore example:
|
||||
# QtCore.framework/
|
||||
# QtCore -> Versions/Current/QtCore
|
||||
# Resources -> Versions/Current/Resources
|
||||
# Versions/
|
||||
# Current -> 5
|
||||
# 5/
|
||||
# QtCore
|
||||
# Resources/
|
||||
# Info.plist
|
||||
dir = self.getGenerator().binDir
|
||||
target = dir + "/Synergy.app/Contents/Frameworks"
|
||||
(major, minor) = self.getMacVersion()
|
||||
if major == 10:
|
||||
if minor >= 9:
|
||||
for root, dirs, files in os.walk(target):
|
||||
for dir in dirs:
|
||||
if dir.startswith("Qt"):
|
||||
self.try_chdir(target + "/" + dir +"/Versions")
|
||||
self.symlink("5", "Current")
|
||||
self.move("../Resources", "5")
|
||||
self.restore_chdir()
|
||||
|
||||
self.try_chdir(target + "/" + dir)
|
||||
dot = dir.find('.')
|
||||
frameworkName = dir[:dot]
|
||||
self.symlink("Versions/Current/" + frameworkName, frameworkName)
|
||||
self.symlink("Versions/Current/Resources", "Resources")
|
||||
self.restore_chdir()
|
||||
|
||||
def macPostMake(self, target):
|
||||
|
||||
dir = self.getGenerator().binDir
|
||||
|
@ -859,46 +824,24 @@ class InternalCommands:
|
|||
shutil.copy(targetDir + "/synmacph", launchServicesDir)
|
||||
|
||||
if self.enableMakeGui:
|
||||
|
||||
self.loadConfig()
|
||||
if not self.macIdentity:
|
||||
raise Exception("run config with --mac-identity")
|
||||
|
||||
# use qt to copy libs to bundle so no dependencies are needed. do not create a
|
||||
# dmg at this point, since we need to sign it first, and then create our own
|
||||
# after signing (so that qt does not affect the signed app bundle).
|
||||
bin = "macdeployqt Synergy.app -verbose=2"
|
||||
bin = "macdeployqt Synergy.app -verbose=2 -codesign='" + self.macIdentity + "'"
|
||||
self.try_chdir(dir)
|
||||
err = os.system(bin)
|
||||
self.restore_chdir()
|
||||
|
||||
if err != 0:
|
||||
raise Exception(bin + " failed with error: " + str(err))
|
||||
|
||||
(qMajor, qMinor, qRev) = self.getQmakeVersion()
|
||||
if qMajor <= 4:
|
||||
frameworkRootDir = "/Library/Frameworks"
|
||||
else:
|
||||
# TODO: auto-detect, qt can now be installed anywhere.
|
||||
frameworkRootDir = "/Developer/Qt5.2.1/5.2.1/clang_64/lib"
|
||||
|
||||
target = dir + "/Synergy.app/Contents/Frameworks"
|
||||
|
||||
# copy the missing Info.plist files for the frameworks.
|
||||
for root, dirs, files in os.walk(target):
|
||||
for dir in dirs:
|
||||
if dir.startswith("Qt"):
|
||||
shutil.copy(
|
||||
frameworkRootDir + "/" + dir + "/Contents/Info.plist",
|
||||
target + "/" + dir + "/Resources/")
|
||||
|
||||
def signmac(self):
|
||||
self.loadConfig()
|
||||
if not self.macIdentity:
|
||||
raise Exception("run config with --mac-identity")
|
||||
|
||||
self.try_chdir("bin")
|
||||
err = os.system(
|
||||
'codesign --deep -fs "' + self.macIdentity + '" Synergy.app')
|
||||
self.restore_chdir()
|
||||
|
||||
if err != 0:
|
||||
raise Exception("codesign failed with error: " + str(err))
|
||||
print "signmac is now obsolete"
|
||||
|
||||
def signwin(self, pfx, pwdFile, dist):
|
||||
generator = self.getGeneratorFromConfig().cmakeName
|
||||
|
|
Loading…
Reference in New Issue