mirror of https://github.com/KLayout/klayout.git
Updated the build system for Mac because Homebrew's latest python@3.9 (Python 3.9.17) depends on openssl@3 (previous version 3.9.16 depended on openssl@1.1).
This commit is contained in:
parent
2ed27ff937
commit
274a0311c9
|
|
@ -1241,6 +1241,7 @@ def Deploy_Binaries_For_Bundle(config, parameters):
|
||||||
MacBinDir = parameters['bin']
|
MacBinDir = parameters['bin']
|
||||||
MacBuildDir = parameters['build']
|
MacBuildDir = parameters['build']
|
||||||
MacBuildLog = parameters['logfile']
|
MacBuildLog = parameters['logfile']
|
||||||
|
Platform = parameters['Platform']
|
||||||
|
|
||||||
AbsMacPkgDir = "%s/%s" % (ProjectDir, MacPkgDir)
|
AbsMacPkgDir = "%s/%s" % (ProjectDir, MacPkgDir)
|
||||||
AbsMacBinDir = "%s/%s" % (ProjectDir, MacBinDir)
|
AbsMacBinDir = "%s/%s" % (ProjectDir, MacBinDir)
|
||||||
|
|
@ -1686,19 +1687,56 @@ def Deploy_Binaries_For_Bundle(config, parameters):
|
||||||
depdict = WalkFrameworkPaths( pythonFrameworkPath, search_path_filter=filterreg )
|
depdict = WalkFrameworkPaths( pythonFrameworkPath, search_path_filter=filterreg )
|
||||||
PerformChanges( depdict, replacePairs, bundleExecPathAbs )
|
PerformChanges( depdict, replacePairs, bundleExecPathAbs )
|
||||||
|
|
||||||
print( " [9.2.4] Patching openssl@1.1, gdbm, readline, sqlite, xz" )
|
#---------------------------------------------------------------------------------------------------
|
||||||
usrLocalPath = '%s/opt/' % DefaultHomebrewRoot
|
# As of 2023-07-09 (KLayout 0.28.10),
|
||||||
appUsrLocalPath = '@executable_path/../Frameworks/'
|
# python@3.9 (Python 3.9.17) in [ 'Ventura', 'Monterey', 'BigSur' ] depends on openssl@3
|
||||||
replacePairs = [ (usrLocalPath, appUsrLocalPath, True) ]
|
# % brew deps python@3.9
|
||||||
replacePairs.extend( [ (openssl_version, '@executable_path/../Frameworks/openssl@1.1', True)
|
# ca-certificates
|
||||||
for openssl_version in glob.glob( '%s/Cellar/openssl@1.1/*' % DefaultHomebrewRoot ) ] )
|
# gdbm
|
||||||
filterreg = r'\t+%s/(opt|Cellar)' % DefaultHomebrewRoot
|
# mpdecimal
|
||||||
depdict = WalkFrameworkPaths( [pythonFrameworkPath + '/../openssl@1.1',
|
# openssl@3 <===
|
||||||
pythonFrameworkPath + '/../gdbm',
|
# readline
|
||||||
pythonFrameworkPath + '/../readline',
|
# sqlite
|
||||||
pythonFrameworkPath + '/../sqlite',
|
# xz
|
||||||
pythonFrameworkPath + '/../xz'], search_path_filter=filterreg )
|
#
|
||||||
|
# python@3.9 (Python 3.9.16; already stopped upgrading) in ['Catalina'] depends on openssl@1.1
|
||||||
|
# ca-certificates
|
||||||
|
# gdbm
|
||||||
|
# gettext
|
||||||
|
# mpdecimal
|
||||||
|
# openssl@1.1 <===
|
||||||
|
# readline
|
||||||
|
# sqlite
|
||||||
|
# xz
|
||||||
|
#---------------------------------------------------------------------------------------------------
|
||||||
|
if Platform in ['Catalina']:
|
||||||
|
print( " [9.2.4] Patching openssl@1.1, gdbm, mpdecimal, readline, sqlite, xz" )
|
||||||
|
usrLocalPath = '%s/opt/' % DefaultHomebrewRoot
|
||||||
|
appUsrLocalPath = '@executable_path/../Frameworks/'
|
||||||
|
replacePairs = [ (usrLocalPath, appUsrLocalPath, True) ]
|
||||||
|
replacePairs.extend( [ (openssl_version, '@executable_path/../Frameworks/openssl@1.1', True)
|
||||||
|
for openssl_version in glob.glob( '%s/Cellar/openssl@1.1/*' % DefaultHomebrewRoot ) ] )
|
||||||
|
filterreg = r'\t+%s/(opt|Cellar)' % DefaultHomebrewRoot
|
||||||
|
depdict = WalkFrameworkPaths( [pythonFrameworkPath + '/../openssl@1.1',
|
||||||
|
pythonFrameworkPath + '/../gdbm',
|
||||||
|
pythonFrameworkPath + '/../mpdecimal',
|
||||||
|
pythonFrameworkPath + '/../readline',
|
||||||
|
pythonFrameworkPath + '/../sqlite',
|
||||||
|
pythonFrameworkPath + '/../xz'], search_path_filter=filterreg )
|
||||||
|
else: # [ 'Ventura', 'Monterey', 'BigSur' ]
|
||||||
|
print( " [9.2.4] Patching openssl@3, gdbm, mpdecimal, readline, sqlite, xz" )
|
||||||
|
usrLocalPath = '%s/opt/' % DefaultHomebrewRoot
|
||||||
|
appUsrLocalPath = '@executable_path/../Frameworks/'
|
||||||
|
replacePairs = [ (usrLocalPath, appUsrLocalPath, True) ]
|
||||||
|
replacePairs.extend( [ (openssl_version, '@executable_path/../Frameworks/openssl@3', True)
|
||||||
|
for openssl_version in glob.glob( '%s/Cellar/openssl@3/*' % DefaultHomebrewRoot ) ] )
|
||||||
|
filterreg = r'\t+%s/(opt|Cellar)' % DefaultHomebrewRoot
|
||||||
|
depdict = WalkFrameworkPaths( [pythonFrameworkPath + '/../openssl@3',
|
||||||
|
pythonFrameworkPath + '/../gdbm',
|
||||||
|
pythonFrameworkPath + '/../mpdecimal',
|
||||||
|
pythonFrameworkPath + '/../readline',
|
||||||
|
pythonFrameworkPath + '/../sqlite',
|
||||||
|
pythonFrameworkPath + '/../xz'], search_path_filter=filterreg )
|
||||||
PerformChanges( depdict, replacePairs, bundleExecPathAbs )
|
PerformChanges( depdict, replacePairs, bundleExecPathAbs )
|
||||||
|
|
||||||
print( " [9.3] Relinking dylib dependencies for klayout" )
|
print( " [9.3] Relinking dylib dependencies for klayout" )
|
||||||
|
|
|
||||||
|
|
@ -68,38 +68,50 @@ def Get_Build_Target_Dict():
|
||||||
## To get the build option dictionary
|
## To get the build option dictionary
|
||||||
#
|
#
|
||||||
# @param[in] targetDic build target dictionary
|
# @param[in] targetDic build target dictionary
|
||||||
|
# @param[in] platform platform name
|
||||||
#
|
#
|
||||||
# @return a dictionary; key=mnemonic, value=build option list
|
# @return (dictionary1, dictionary2)-tupple
|
||||||
|
# dictionary1: key=mnemonic, value=build option list
|
||||||
|
# dictionary2: key=mnemonic, value=log file name
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
def Get_Build_Options( targetDic ):
|
def Get_Build_Options( targetDic, platform ):
|
||||||
if QtType == 5:
|
if QtType == 5:
|
||||||
qtType = "Qt5"
|
qtType = "Qt5"
|
||||||
else:
|
else:
|
||||||
qtType = "Qt6"
|
qtType = "Qt6"
|
||||||
|
|
||||||
buildOp = dict()
|
buildOp = dict()
|
||||||
|
logfile = dict()
|
||||||
for key in targetDic.keys():
|
for key in targetDic.keys():
|
||||||
target = targetDic[key]
|
target = targetDic[key]
|
||||||
if target == "std": # use 'Qt5MacPorts' that provides Qt 5.15.2~ to run on "Big Sur", too
|
if target == "std": # use 'Qt5MacPorts' that provides Qt 5.15.2~ to run on "Big Sur", too
|
||||||
buildOp["std"] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'sys' ]
|
buildOp["std"] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'sys' ]
|
||||||
|
logfile["std"] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPsys")
|
||||||
elif target == "ports":
|
elif target == "ports":
|
||||||
buildOp["ports"] = [ '-q', '%sMacPorts' % qtType, '-r', 'MP32', '-p', 'MP39' ]
|
buildOp["ports"] = [ '-q', '%sMacPorts' % qtType, '-r', 'MP32', '-p', 'MP39' ]
|
||||||
|
logfile["ports"] = "%sMP.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rmp32Pmp39")
|
||||||
elif target == "brew":
|
elif target == "brew":
|
||||||
buildOp["brew"] = [ '-q', '%sBrew' % qtType, '-r', 'HB32', '-p', 'HB39' ]
|
buildOp["brew"] = [ '-q', '%sBrew' % qtType, '-r', 'HB32', '-p', 'HB39' ]
|
||||||
|
logfile["brew"] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb32Phb39")
|
||||||
elif target == "brewHW":
|
elif target == "brewHW":
|
||||||
buildOp["brewHW"] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HB39' ]
|
buildOp["brewHW"] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HB39' ]
|
||||||
|
logfile["brewHW"] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhb39")
|
||||||
elif target == "ana3":
|
elif target == "ana3":
|
||||||
buildOp["ana3"] = [ '-q', '%sAna3' % qtType, '-r', 'Ana3', '-p', 'Ana3' ]
|
buildOp["ana3"] = [ '-q', '%sAna3' % qtType, '-r', 'Ana3', '-p', 'Ana3' ]
|
||||||
|
logfile["ana3"] = "%sAna3.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rana3Pana3")
|
||||||
elif target == "brewA":
|
elif target == "brewA":
|
||||||
buildOp["brewA"] = [ '-q', '%sBrew' % qtType, '-r', 'HB32', '-p', 'HBAuto' ]
|
buildOp["brewA"] = [ '-q', '%sBrew' % qtType, '-r', 'HB32', '-p', 'HBAuto' ]
|
||||||
|
logfile["brewA"] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "Rhb32Phbauto")
|
||||||
elif target == "brewAHW":
|
elif target == "brewAHW":
|
||||||
buildOp["brewAHW"] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HBAuto' ]
|
buildOp["brewAHW"] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HBAuto' ]
|
||||||
|
logfile["brewAHW"] = "%sBrew.build.macos-%s-%s-%s.log" % (qtType.lower(), platform, "release", "RsysPhbauto")
|
||||||
|
|
||||||
if WithPymod:
|
if WithPymod:
|
||||||
buildOp["ports"] = buildOp["ports"] + ['--buildPymod']
|
buildOp["ports"] = buildOp["ports"] + ['--buildPymod']
|
||||||
buildOp["brew"] = buildOp["brew"] + ['--buildPymod']
|
buildOp["brew"] = buildOp["brew"] + ['--buildPymod']
|
||||||
buildOp["ana3"] = buildOp["ana3"] + ['--buildPymod']
|
buildOp["ana3"] = buildOp["ana3"] + ['--buildPymod']
|
||||||
return buildOp
|
|
||||||
|
return (buildOp, logfile)
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
## To get the ".macQAT" dictionary for QA Test
|
## To get the ".macQAT" dictionary for QA Test
|
||||||
|
|
@ -371,18 +383,33 @@ def Parse_CommandLine_Arguments():
|
||||||
## To build and deploy
|
## To build and deploy
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
def Build_Deploy():
|
def Build_Deploy():
|
||||||
pyBuilder = "./build4mac.py"
|
pyBuilder = "./build4mac.py"
|
||||||
buildOp = Get_Build_Options( Get_Build_Target_Dict() )
|
myPlatform = Test_My_Platform()
|
||||||
|
buildOp, logfile = Get_Build_Options( Get_Build_Target_Dict(), myPlatform )
|
||||||
|
|
||||||
for key in Target:
|
for key in Target:
|
||||||
if key == "ana3" and QtType == 6: # anaconda3 does not provide Qt6 so far
|
if key == "ana3" and QtType == 6: # anaconda3 does not provide Qt6 so far
|
||||||
continue
|
continue
|
||||||
|
deplog = logfile[key].replace( ".log", ".dep.log" )
|
||||||
|
|
||||||
command1 = [ pyBuilder ] + buildOp[key]
|
command1 = [ pyBuilder ] + buildOp[key]
|
||||||
|
|
||||||
if key in [ "std", "brewHW", "brewAHW" ] :
|
if key in [ "std", "brewHW", "brewAHW" ] :
|
||||||
command2 = [ pyBuilder ] + buildOp[key] + ['-y']
|
command2 = "time"
|
||||||
|
command2 += " \\\n %s" % pyBuilder
|
||||||
|
for option in buildOp[key]:
|
||||||
|
command2 += " \\\n %s" % option
|
||||||
|
command2 += " \\\n %s" % '-y'
|
||||||
|
command2 += " 2>&1 | tee %s; \\\n" % deplog
|
||||||
|
command2 += "test ${PIPESTATUS[0]} -eq 0" # tee always exits with 0
|
||||||
else:
|
else:
|
||||||
command2 = [ pyBuilder ] + buildOp[key] + ['-Y']
|
command2 = "time"
|
||||||
|
command2 += " \\\n %s" % pyBuilder
|
||||||
|
for option in buildOp[key]:
|
||||||
|
command2 += " \\\n %s" % option
|
||||||
|
command2 += " \\\n %s" % '-Y'
|
||||||
|
command2 += " 2>&1 | tee %s; \\\n" % deplog
|
||||||
|
command2 += "test ${PIPESTATUS[0]} -eq 0" # tee always exits with 0
|
||||||
|
|
||||||
if DryRun:
|
if DryRun:
|
||||||
print( "### Target = <%s> ###" % key )
|
print( "### Target = <%s> ###" % key )
|
||||||
|
|
@ -405,7 +432,7 @@ def Build_Deploy():
|
||||||
print( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", file=sys.stderr )
|
print( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", file=sys.stderr )
|
||||||
print( "", file=sys.stderr )
|
print( "", file=sys.stderr )
|
||||||
|
|
||||||
if subprocess.call( command2, shell=False ) != 0:
|
if subprocess.call( command2, shell=True ) != 0:
|
||||||
print( "", file=sys.stderr )
|
print( "", file=sys.stderr )
|
||||||
print( "-----------------------------------------------------------------", file=sys.stderr )
|
print( "-----------------------------------------------------------------", file=sys.stderr )
|
||||||
print( "!!! <%s>: failed to deploy KLayout" % pyBuilder, file=sys.stderr )
|
print( "!!! <%s>: failed to deploy KLayout" % pyBuilder, file=sys.stderr )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue