mirror of https://github.com/KLayout/klayout.git
Merge pull request #785 from Kazzz-S/0.26.12-mac1
Changes in the build system for Mac
This commit is contained in:
commit
e61253b312
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
Binary file not shown.
|
|
@ -34,7 +34,7 @@ def Get_Default_Config():
|
|||
Usage = "\n"
|
||||
Usage += "---------------------------------------------------------------------------------------------------------\n"
|
||||
Usage += "<< Usage of 'build4mac.py' >>\n"
|
||||
Usage += " for building KLayout 0.26.11 or later on different Apple Mac OSX platforms.\n"
|
||||
Usage += " for building KLayout 0.26.12 or later on different Apple Mac OSX / macOS platforms.\n"
|
||||
Usage += "\n"
|
||||
Usage += "$ [python] ./build4mac.py \n"
|
||||
Usage += " option & argument : descriptions (refer to 'macbuild/build4mac_env.py' for details)| default value\n"
|
||||
|
|
@ -55,11 +55,11 @@ def Get_Default_Config():
|
|||
Usage += " : Sys: use OS-bundled Python 2.7 [ElCapitan -- BigSur] | \n"
|
||||
Usage += " : MP38: use Python 3.8 from MacPorts | \n"
|
||||
Usage += " : HB38: use Python 3.8 from Homebrew | \n"
|
||||
Usage += " : Ana3: use Python 3.7 from Anaconda3 | \n"
|
||||
Usage += " : Ana3: use Python 3.8 from Anaconda3 | \n"
|
||||
Usage += " : HBAuto: use the latest Python 3.x auto-detected from Homebrew | \n"
|
||||
Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n"
|
||||
Usage += " [-u|--noqtuitools] : don't include uitools in Qt binding | disabled \n"
|
||||
Usage += " [-m|--make <option>] : option passed to 'make' | '-j4' \n"
|
||||
Usage += " [-m|--make <option>] : option passed to 'make' | '--jobs=4' \n"
|
||||
Usage += " [-d|--debug] : enable debug mode build | disabled \n"
|
||||
Usage += " [-c|--checkcom] : check command-line and exit without building | disabled \n"
|
||||
Usage += " [-y|--deploy] : deploy executables and dylibs including Qt's Frameworks | disabled \n"
|
||||
|
|
@ -107,10 +107,15 @@ def Get_Default_Config():
|
|||
sys.exit(1)
|
||||
|
||||
if not Machine == "x86_64":
|
||||
print("")
|
||||
print( "!!! Sorry. Only x86_64 architecture machine is supported but found <%s>" % Machine, file=sys.stderr )
|
||||
print(Usage)
|
||||
sys.exit(1)
|
||||
if Machine == "arm64" and Platform == "BigSur": # with an Apple Silicon Chip
|
||||
print("")
|
||||
print( "### Your Mac equips an Apple Silicon Chip ###" )
|
||||
print("")
|
||||
else:
|
||||
print("")
|
||||
print( "!!! Sorry. Only x86_64/arm64 architecture machine is supported but found <%s>" % Machine, file=sys.stderr )
|
||||
print(Usage)
|
||||
sys.exit(1)
|
||||
|
||||
# Set the default modules
|
||||
ModuleQt = "Qt5MacPorts"
|
||||
|
|
@ -139,7 +144,7 @@ def Get_Default_Config():
|
|||
NonOSStdLang = False
|
||||
NoQtBindings = False
|
||||
NoQtUiTools = False
|
||||
MakeOptions = "-j4"
|
||||
MakeOptions = "--jobs=4"
|
||||
DebugMode = False
|
||||
CheckComOnly = False
|
||||
DeploymentF = False
|
||||
|
|
@ -279,7 +284,7 @@ def Parse_CLI_Args(config):
|
|||
type_python = "sys",
|
||||
no_qt_binding = False,
|
||||
no_qt_uitools = False,
|
||||
make_option = "-j4",
|
||||
make_option = "--jobs=4",
|
||||
debug_build = False,
|
||||
check_command = False,
|
||||
deploy_full = False,
|
||||
|
|
|
|||
|
|
@ -12,14 +12,25 @@
|
|||
#===============================================================================
|
||||
import os
|
||||
import glob
|
||||
import platform
|
||||
|
||||
#-----------------------------------------------------
|
||||
#---------------------------------------------------------------------------------------------------
|
||||
# [0] Xcode's tools
|
||||
#-----------------------------------------------------
|
||||
# and
|
||||
# Default Homebrew root
|
||||
# Ref. https://github.com/Homebrew/brew/blob/master/docs/Installation.md#alternative-installs
|
||||
#---------------------------------------------------------------------------------------------------
|
||||
XcodeToolChain = { 'nameID': '/usr/bin/install_name_tool -id ',
|
||||
'nameCH': '/usr/bin/install_name_tool -change '
|
||||
}
|
||||
|
||||
(System, Node, Release, MacVersion, Machine, Processor) = platform.uname()
|
||||
if Machine == "arm64": # Apple Silicon!
|
||||
DefaultHomebrewRoot = '/opt/homebrew'
|
||||
else:
|
||||
DefaultHomebrewRoot = '/usr/local'
|
||||
del System, Node, Release, MacVersion, Machine, Processor
|
||||
|
||||
#-----------------------------------------------------
|
||||
# [1] Qt
|
||||
#-----------------------------------------------------
|
||||
|
|
@ -38,8 +49,8 @@ Qt5MacPorts = { 'qmake' : '/opt/local/libexec/qt5/bin/qmake',
|
|||
# Qt5 from Homebrew (https://brew.sh/)
|
||||
# install with 'brew install qt'
|
||||
# [Key Type Name] = 'Qt5Brew'
|
||||
Qt5Brew = { 'qmake' : '/usr/local/opt/qt/bin/qmake',
|
||||
'deploy': '/usr/local/opt/qt/bin/macdeployqt'
|
||||
Qt5Brew = { 'qmake' : '%s/opt/qt/bin/qmake' % DefaultHomebrewRoot,
|
||||
'deploy': '%s/opt/qt/bin/macdeployqt' %DefaultHomebrewRoot
|
||||
}
|
||||
|
||||
# Qt5 bundled with anaconda3 installed under /Applications/anaconda3/
|
||||
|
|
@ -145,7 +156,7 @@ Ruby27MacPorts = { 'exe': '/opt/local/bin/ruby2.7',
|
|||
# Ruby 2.7 from Homebrew *+*+*+ EXPERIMENTAL *+*+*+
|
||||
# install with 'brew install ruby'
|
||||
# [Key Type Name] = 'HB27'
|
||||
HBRuby27Path = '/usr/local/opt/ruby'
|
||||
HBRuby27Path = '%s/opt/ruby' % DefaultHomebrewRoot
|
||||
Ruby27Brew = { 'exe': '%s/bin/ruby' % HBRuby27Path,
|
||||
'inc': '%s/include/ruby-2.7.0' % HBRuby27Path,
|
||||
'lib': '%s/lib/libruby.2.7.dylib' % HBRuby27Path
|
||||
|
|
@ -247,7 +258,7 @@ Python38MacPorts= { 'exe': '/opt/local/Library/Frameworks/Python.framework/Versi
|
|||
# Python 3.8 from Homebrew *+*+*+ EXPERIMENTAL *+*+*+
|
||||
# install with 'brew install python'
|
||||
# [Key Type Name] = 'HB38'
|
||||
HBPython38FrameworkPath = '/usr/local/opt/python@3.8/Frameworks/Python.framework'
|
||||
HBPython38FrameworkPath = '%s/opt/python@3.8/Frameworks/Python.framework' % DefaultHomebrewRoot
|
||||
Python38Brew = { 'exe': '%s/Versions/3.8/bin/python3.8' % HBPython38FrameworkPath,
|
||||
'inc': '%s/Versions/3.8/include/python3.8' % HBPython38FrameworkPath,
|
||||
'lib': '%s/Versions/3.8/lib/libpython3.8.dylib' % HBPython38FrameworkPath
|
||||
|
|
@ -270,7 +281,7 @@ PythonAnaconda3 = { 'exe': '/Applications/anaconda3/bin/python3.8',
|
|||
HBPythonAutoFrameworkPath = ""
|
||||
HBPythonAutoVersion = ""
|
||||
try:
|
||||
HBPythonAutoFrameworkPath = glob.glob( "/usr/local/opt/python*/Frameworks/Python.framework" )[-1]
|
||||
HBPythonAutoFrameworkPath = glob.glob( "%s/opt/python*/Frameworks/Python.framework" % DefaultHomebrewRoot )[-1]
|
||||
# expand 3* into HBPythonAutoVersion, there should be only one, but I am taking no chances.
|
||||
HBAutoFrameworkVersionPath, HBPythonAutoVersion = os.path.split( glob.glob( "%s/Versions/3*" % HBPythonAutoFrameworkPath )[0] )
|
||||
PythonAutoBrew = { 'exe': '%s/%s/bin/python%s' % ( HBAutoFrameworkVersionPath, HBPythonAutoVersion, HBPythonAutoVersion ),
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ def SetGlobals():
|
|||
Usage = "\n"
|
||||
Usage += "--------------------------------------------------------------------------------------------------------\n"
|
||||
Usage += "<< Usage of 'makeDMG4mac.py' >>\n"
|
||||
Usage += " for making a DMG file of KLayout 0.26.1 or later on different Apple Mac OSX platforms.\n"
|
||||
Usage += " for making a DMG file of KLayout 0.26.12 or later on different Apple Mac OSX / macOS platforms.\n"
|
||||
Usage += "\n"
|
||||
Usage += "$ [python] ./makeDMG4mac.py \n"
|
||||
Usage += " option & argument : descriptions | default value\n"
|
||||
|
|
@ -89,8 +89,8 @@ def SetGlobals():
|
|||
Usage += " : <-c|--clean> and <-m|--make> are mutually exclusive | \n"
|
||||
Usage += " [-b|--bundle <name>] : forcibly use this bundle name in the DMG | '' \n"
|
||||
Usage += " [-s|--serial <num>] : DMG serial number | 1 \n"
|
||||
Usage += " <-u|--unsafe> : Ignores a few checks (use with caution) | disabled \n"
|
||||
Usage += " <-t|--targetdmg> : Specify output .dmg filename | chosen by script \n"
|
||||
Usage += " [-u|--unsafe] : Ignores a few checks (use with caution) | disabled \n"
|
||||
Usage += " [-t|--targetdmg] : Specify output .dmg filename | chosen by script \n"
|
||||
Usage += " [-?|--?] : print this usage and exit | disabled \n"
|
||||
Usage += "-------------------------------------------------------------------------------------+------------------\n"
|
||||
|
||||
|
|
@ -133,10 +133,15 @@ def SetGlobals():
|
|||
sys.exit(1)
|
||||
|
||||
if not Machine == "x86_64":
|
||||
print("")
|
||||
print( "!!! Sorry. Only x86_64 architecture machine is supported but found <%s>" % Machine, file=sys.stderr )
|
||||
print(Usage)
|
||||
sys.exit(1)
|
||||
if Machine == "arm64" and Platform == "BigSur": # with an Apple Silicon Chip
|
||||
print("")
|
||||
print( "### Your Mac equips an Apple Silicon Chip ###" )
|
||||
print("")
|
||||
else:
|
||||
print("")
|
||||
print( "!!! Sorry. Only x86_64/arm64 architecture machine is supported but found <%s>" % Machine, file=sys.stderr )
|
||||
print(Usage)
|
||||
sys.exit(1)
|
||||
|
||||
PkgDir = ""
|
||||
UnsafePkg = False
|
||||
|
|
@ -358,6 +363,7 @@ def ParseCommandLineArguments():
|
|||
global KLVersion
|
||||
global OccupiedDS
|
||||
global TargetDMG
|
||||
global Machine
|
||||
|
||||
p = optparse.OptionParser( usage=Usage )
|
||||
p.add_option( '-p', '--pkg',
|
||||
|
|
@ -448,6 +454,8 @@ def ParseCommandLineArguments():
|
|||
else:
|
||||
TargetDMG = "%s-klayout-%s-%s-%s-%d-%s-%s.dmg" \
|
||||
% (PackagePrefix, KLVersion, GenOSName, Platform, DMGSerialNum, QtIdentification, RubyPythonID)
|
||||
if Machine == "arm64": # with an Apple Silicon Chip
|
||||
TargetDMG = Machine + TargetDMG
|
||||
return
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ def Parse_CommandLine_Arguments():
|
|||
Usage += " (3) $ ./nightlyBuild.py --test | \n"
|
||||
Usage += " (4) $ ./nightlyBuild.py --check (confirm the QA Test results) | \n"
|
||||
Usage += " (5) $ ./nightlyBuild.py --makedmg 1 | \n"
|
||||
Usage += " (6) $ ./nightlyBuild.py --upload '0.26.10' | \n"
|
||||
Usage += " (6) $ ./nightlyBuild.py --upload '0.26.12' | \n"
|
||||
Usage += " (7) $ ./nightlyBuild.py --cleandmg 1 | \n"
|
||||
Usage += "---------------------------------------------------------------------------+----------------\n"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue