To add one option to trace deployment process of `macdeployqt` tool.

This refs #4 and #19.
This commit is contained in:
Kazunari Sekigawa 2018-01-04 19:55:11 +09:00
parent 91bf2a1eb0
commit ecade95463
1 changed files with 43 additions and 23 deletions

View File

@ -40,6 +40,7 @@ def SetGlobals():
global DebugMode # True if debug mode build global DebugMode # True if debug mode build
global CheckComOnly # True if only for checking the command line parameters to "build.sh" global CheckComOnly # True if only for checking the command line parameters to "build.sh"
global Deployment # True if deploying the binaries for a package global Deployment # True if deploying the binaries for a package
global DeployVerbose # -verbose=<0-3> level passed to 'macdeployqt' tool
global Version # KLayout's version global Version # KLayout's version
# auxiliary variables on platform # auxiliary variables on platform
global System # 6-tuple from platform.uname() global System # 6-tuple from platform.uname()
@ -73,7 +74,11 @@ def SetGlobals():
Usage += " : ! After confirmation of successful build of | \n" Usage += " : ! After confirmation of successful build of | \n"
Usage += " : KLayout, rerun this script with BOTH: | \n" Usage += " : KLayout, rerun this script with BOTH: | \n"
Usage += " : 1) the same options used for building AND | \n" Usage += " : 1) the same options used for building AND | \n"
Usage += " : 2) [-y|--deploy] | \n" Usage += " : 2) <-y|--deploy> | \n"
Usage += " : optionally with [-v|--verbose <0-3>] | \n"
Usage += " [-v|--verbose <0-3>] : verbose level of `macdeployqt' | 1 \n"
Usage += " : 0 = no output, 1 = error/warning (default), | \n"
Usage += " : 2 = normal, 3 = debug | \n"
Usage += " [-?|--?] : print this usage and exit | disabled \n" Usage += " [-?|--?] : print this usage and exit | disabled \n"
Usage += "---------------------------------------------------------------------------------------------\n" Usage += "---------------------------------------------------------------------------------------------\n"
@ -127,12 +132,13 @@ def SetGlobals():
ModuleRuby = "nil" ModuleRuby = "nil"
ModulePython = "nil" ModulePython = "nil"
NoQtBindings = False NoQtBindings = False
MakeOptions = "-j4" MakeOptions = "-j4"
DebugMode = False DebugMode = False
CheckComOnly = False CheckComOnly = False
Deployment = False Deployment = False
Version = GetKLayoutVersionFrom( "./version.sh" ) DeployVerbose = 1
Version = GetKLayoutVersionFrom( "./version.sh" )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
## To get command line parameters ## To get command line parameters
@ -148,6 +154,7 @@ def ParseCommandLineArguments():
global DebugMode global DebugMode
global CheckComOnly global CheckComOnly
global Deployment global Deployment
global DeployVerbose
p = optparse.OptionParser( usage=Usage ) p = optparse.OptionParser( usage=Usage )
p.add_option( '-q', '--qt', p.add_option( '-q', '--qt',
@ -190,21 +197,26 @@ def ParseCommandLineArguments():
default=False, default=False,
help="deploy built binaries" ) help="deploy built binaries" )
p.add_option( '-v', '--verbose',
dest='deploy_verbose',
help="verbose level of `macdeployqt` tool" )
p.add_option( '-?', '--??', p.add_option( '-?', '--??',
action='store_true', action='store_true',
dest='checkusage', dest='checkusage',
default=False, default=False,
help='check usage' ) help='check usage' )
p.set_defaults( type_qt = "qt5macports", p.set_defaults( type_qt = "qt5macports",
type_ruby = "sys", type_ruby = "sys",
type_python = "sys", type_python = "sys",
no_qt_binding = False, no_qt_binding = False,
make_option = "-j4", make_option = "-j4",
debug_build = False, debug_build = False,
check_command = False, check_command = False,
deploy_bins = False, deploy_bins = False,
checkusage = False ) deploy_verbose = "1",
checkusage = False )
opt, args = p.parse_args() opt, args = p.parse_args()
if (opt.checkusage): if (opt.checkusage):
@ -299,11 +311,17 @@ def ParseCommandLineArguments():
print(Usage) print(Usage)
quit() quit()
NoQtBindings = opt.no_qt_binding NoQtBindings = opt.no_qt_binding
MakeOptions = opt.make_option MakeOptions = opt.make_option
DebugMode = opt.debug_build DebugMode = opt.debug_build
CheckComOnly = opt.check_command CheckComOnly = opt.check_command
Deployment = opt.deploy_bins Deployment = opt.deploy_bins
DeployVerbose = int(opt.deploy_verbose)
if not DeployVerbose in [0, 1, 2, 3]:
print("")
print( "!!! Unsupported verbose level passed to `macdeployqt` tool", file=sys.stderr )
print(Usage)
quit()
if not Deployment: if not Deployment:
target = "%s %s %s" % (Platform, Release, Machine) target = "%s %s %s" % (Platform, Release, Machine)
@ -459,6 +477,7 @@ def DeployBinariesForBundle():
global AbsMacBuildDir global AbsMacBuildDir
global AbsMacBuildLog global AbsMacBuildLog
global Version global Version
global DeployVerbose
print("") print("")
print( "##### Started deploying libraries and executables for <klayout.app> #####" ) print( "##### Started deploying libraries and executables for <klayout.app> #####" )
@ -662,14 +681,15 @@ def DeployBinariesForBundle():
#------------------------------------------------------------- #-------------------------------------------------------------
# [8] Deploy Qt frameworks # [8] Deploy Qt frameworks
#------------------------------------------------------------- #-------------------------------------------------------------
verbose = " -verbose=%d" % DeployVerbose
if ModuleQt == 'Qt4MacPorts': if ModuleQt == 'Qt4MacPorts':
deploytool = Qt4MacPorts['deploy'] deploytool = Qt4MacPorts['deploy']
app_bundle = "klayout.app" app_bundle = "klayout.app"
options = macdepQtOpt options = macdepQtOpt + verbose
elif ModuleQt == 'Qt5MacPorts': elif ModuleQt == 'Qt5MacPorts':
deploytool = Qt5MacPorts['deploy'] deploytool = Qt5MacPorts['deploy']
app_bundle = "klayout.app" app_bundle = "klayout.app"
options = macdepQtOpt options = macdepQtOpt + verbose
os.chdir(ProjectDir) os.chdir(ProjectDir)
os.chdir(MacPkgDir) os.chdir(MacPkgDir)