build: allow correct tools to be used for dmg creation.

These come from the enironment, which will be properly setup by Make with
the paths gleaned from configure.
Also don't crash if plugins are static.
This commit is contained in:
Cory Fields 2013-12-06 18:08:53 -05:00
parent 1699e3a868
commit 275d6a3115

View file

@ -196,7 +196,8 @@ class DeploymentInfo(object):
def getFrameworks(binaryPath, verbose): def getFrameworks(binaryPath, verbose):
if verbose >= 3: if verbose >= 3:
print "Inspecting with otool: " + binaryPath print "Inspecting with otool: " + binaryPath
otool = subprocess.Popen(["otool", "-L", binaryPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE) otoolbin=os.getenv("OTOOL", "otool")
otool = subprocess.Popen([otoolbin, "-L", binaryPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
o_stdout, o_stderr = otool.communicate() o_stdout, o_stderr = otool.communicate()
if otool.returncode != 0: if otool.returncode != 0:
if verbose >= 1: if verbose >= 1:
@ -221,7 +222,8 @@ def getFrameworks(binaryPath, verbose):
return libraries return libraries
def runInstallNameTool(action, *args): def runInstallNameTool(action, *args):
subprocess.check_call(["install_name_tool", "-"+action] + list(args)) installnametoolbin=os.getenv("INSTALLNAMETOOL", "install_name_tool")
subprocess.check_call([installnametoolbin, "-"+action] + list(args))
def changeInstallName(oldName, newName, binaryPath, verbose): def changeInstallName(oldName, newName, binaryPath, verbose):
if verbose >= 3: if verbose >= 3:
@ -239,10 +241,11 @@ def changeIdentification(id, binaryPath, verbose):
runInstallNameTool("id", id, binaryPath) runInstallNameTool("id", id, binaryPath)
def runStrip(binaryPath, verbose): def runStrip(binaryPath, verbose):
stripbin=os.getenv("STRIP", "strip")
if verbose >= 3: if verbose >= 3:
print "Using strip:" print "Using strip:"
print " stripped", binaryPath print " stripped", binaryPath
subprocess.check_call(["strip", "-x", binaryPath]) subprocess.check_call([stripbin, "-x", binaryPath])
def copyFramework(framework, path, verbose): def copyFramework(framework, path, verbose):
if framework.sourceFilePath.startswith("Qt"): if framework.sourceFilePath.startswith("Qt"):
@ -347,6 +350,8 @@ def deployFrameworksForAppBundle(applicationBundle, strip, verbose):
def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose): def deployPlugins(appBundleInfo, deploymentInfo, strip, verbose):
# Lookup available plugins, exclude unneeded # Lookup available plugins, exclude unneeded
plugins = [] plugins = []
if deploymentInfo.pluginPath is None:
return
for dirpath, dirnames, filenames in os.walk(deploymentInfo.pluginPath): for dirpath, dirnames, filenames in os.walk(deploymentInfo.pluginPath):
pluginDirectory = os.path.relpath(dirpath, deploymentInfo.pluginPath) pluginDirectory = os.path.relpath(dirpath, deploymentInfo.pluginPath)
if pluginDirectory == "designer": if pluginDirectory == "designer":