mirror of https://github.com/KLayout/klayout.git
commit
f5d72654fd
|
|
@ -0,0 +1,72 @@
|
||||||
|
<< Draft Version 0.003>> Relevant KLayout version: 0.25.1
|
||||||
|
|
||||||
|
# 1. Introduction
|
||||||
|
This directory "macbuild" contains different files required for building KLayout (http://www.klayout.de/) version 0.25 or later for different Mac OSXs including:
|
||||||
|
* Yosemite (10.10)
|
||||||
|
* El Capitan (10.11)
|
||||||
|
* Sierra (10.12)
|
||||||
|
* High Sierra (10.13)
|
||||||
|
|
||||||
|
By default, Qt framework is "Qt5" from Mac Ports (https://www.macports.org/) which is usually located under:
|
||||||
|
```
|
||||||
|
/opt/local/libexec/qt5/
|
||||||
|
```
|
||||||
|
|
||||||
|
### IMPORTANT
|
||||||
|
```
|
||||||
|
* Please DO NOT USE "Qt 5.10.0" which is problematic in showing your design in the main canvas.
|
||||||
|
* Please USE "Qt 5.9.x" instead.
|
||||||
|
* Building with Qt4 will lead to some compile errors.
|
||||||
|
```
|
||||||
|
Also by default, supported script languages, i.e, Ruby and Python, are those standard ones bundled with the OS.
|
||||||
|
|
||||||
|
# 2. Non-OS-standard script language support
|
||||||
|
You may want to use a non-OS-standard script language such as Python 3.6 from Anaconda2 (https://www.anaconda.com/download/#macos) in combination with KLayout.
|
||||||
|
|
||||||
|
Since Anaconda2 is a popular Python development environment, this is worth trying.
|
||||||
|
Unfortunately, however, some dynamic linkage problems are observed as of today.
|
||||||
|
On the other hand, Python 3.6 provided by Mac Ports is usable.
|
||||||
|
Please try this (refer to 3B below) if you feel it's useful.
|
||||||
|
|
||||||
|
# 3. Use-cases
|
||||||
|
### 3A. Debug build using the OS-standard script languages
|
||||||
|
1. Make a symbolic link from the parent directory (where 'build.sh' exists) to
|
||||||
|
'build4mac.py', that is,
|
||||||
|
```
|
||||||
|
build4mac.py -> macbuild/build4mac.py
|
||||||
|
```
|
||||||
|
2. Invoke 'build4mac.py' with appropriate options ("-d" for debug build):
|
||||||
|
```
|
||||||
|
$ cd /where/'build.sh'/exists
|
||||||
|
$ ./build4mac.py -d
|
||||||
|
```
|
||||||
|
3. Confirm successful build.
|
||||||
|
4. Run 'build4mac.py' again with the same options used in 2. PLUS "-y" to deploy executables and libraries (including Qt's frameworks) under "klayout.app" bundle.
|
||||||
|
```
|
||||||
|
$ ./build4mac.py -d -y
|
||||||
|
```
|
||||||
|
5. Copy/move generated bundles ("klayout.app" and "klayout.scripts/") to your "/Applications" directory for installation.
|
||||||
|
|
||||||
|
### 3B. Release build using the non-OS-standard Ruby 2.4 and Python 3.6 both from MacPorts
|
||||||
|
1. Make a symbolic link from the parent directory (where 'build.sh' exists) to 'build4mac.py', that is,
|
||||||
|
```
|
||||||
|
build4mac.py -> macbuild/build4mac.py
|
||||||
|
```
|
||||||
|
2. Invoke 'build4mac.py' with appropriate options:
|
||||||
|
```
|
||||||
|
$ cd /where/'build.sh'/exists
|
||||||
|
$ ./build4mac.py -r mp24 -p mp36
|
||||||
|
```
|
||||||
|
3. Confirm successful build.
|
||||||
|
4. Run 'build4mac.py' again with the same options used in 2. PLUS "-Y" to deploy executables and libraries under "klayout.app" bundle.
|
||||||
|
```
|
||||||
|
$ ./build4mac.py -r mp24 -p mp36 -Y
|
||||||
|
```
|
||||||
|
* [-Y|--DEPOLY] option deploys KLayout's dylibs and executables only.
|
||||||
|
That is, paths to other modules (Ruby, Python, and Qt5 Frameworks) remain unchanged (absolute paths in your development environment).
|
||||||
|
|
||||||
|
5. Copy/move generated bundles ("klayout.app" and "klayout.scripts/") to your "/Applications" directory for installation.
|
||||||
|
|
||||||
|
By: Kazzz (January 08, 2018)
|
||||||
|
|
||||||
|
[End of File]
|
||||||
|
|
@ -1,39 +1,69 @@
|
||||||
<< Draft Version 0.002>>
|
<< Draft Version 0.003>>
|
||||||
|
Relevant KLayout version: 0.25.1
|
||||||
|
|
||||||
1. Introduction:
|
1. Introduction:
|
||||||
This directory "macbuild" contains different files required for building KLayout
|
This directory "macbuild" contains different files required for building KLayout (http://www.klayout.de/)
|
||||||
version 0.25 or later for different Max OSX including:
|
version 0.25 or later for different Mac OSXs including:
|
||||||
* Yosemite (10.10)
|
* Yosemite (10.10)
|
||||||
* El Capitan (10.11)
|
* El Capitan (10.11)
|
||||||
* Sierra (10.12)
|
* Sierra (10.12)
|
||||||
* High Sierra (10.13)
|
* High Sierra (10.13)
|
||||||
|
|
||||||
By default, Qt framework is Qt5 from Mac Ports (https://www.macports.org/) which
|
By default, Qt framework is "Qt5" from Mac Ports (https://www.macports.org/) which is
|
||||||
is usually located under:
|
usually located under:
|
||||||
/opt/local/libexec/qt5/
|
/opt/local/libexec/qt5/
|
||||||
|
|
||||||
|
<IMPORTANT>:
|
||||||
|
* Please DO NOT USE "5.10.0" which is problematic in showing your design in the main canvas.
|
||||||
|
* Please USE "5.9.x" instead.
|
||||||
|
* Building with Qt4 will lead to some compile errors.
|
||||||
|
|
||||||
Also by default, supported script languages, i.e, Ruby and Python, are those
|
Also by default, supported script languages, i.e, Ruby and Python, are those
|
||||||
standard ones bundled with the OS.
|
standard ones bundled with the OS.
|
||||||
However, you are able to choose other options like Python from Anaconda.
|
|
||||||
:
|
|
||||||
: (to be updated)
|
|
||||||
:
|
|
||||||
:
|
|
||||||
|
|
||||||
|
|
||||||
2. How to use:
|
2. Non-OS-standard script language support:
|
||||||
|
You may want to use a non-OS-standard script language such as Python 3.6 from
|
||||||
|
Anaconda2 (https://www.anaconda.com/download/#macos) in combination with KLayout.
|
||||||
|
Since Anaconda2 is a popular Python development environment, this is worth trying.
|
||||||
|
Unfortunately, however, some dynamic linkage problems are observed as of today.
|
||||||
|
|
||||||
|
On the other hand, Python 3.6 provided by Mac Ports is usable.
|
||||||
|
Please try this (refer to 3B below) if you feel it's useful.
|
||||||
|
|
||||||
|
3. Use-cases:
|
||||||
|
3A. Debug build using the OS-standard script languages:
|
||||||
(1) Make a symbolic link from the parent directory (where 'build.sh' exists) to
|
(1) Make a symbolic link from the parent directory (where 'build.sh' exists) to
|
||||||
'build4mac.py', that is,
|
'build4mac.py', that is,
|
||||||
build4mac.py -> macbuild/build4mac.py
|
build4mac.py -> macbuild/build4mac.py
|
||||||
|
(2) Invoke 'build4mac.py' with appropriate options ("-d" for debug build):
|
||||||
(2) Invoke 'build4mac.py' with appropriate options, for example, for debug-build:
|
|
||||||
$ cd /where/'build.sh'/exists
|
$ cd /where/'build.sh'/exists
|
||||||
$ ./build4mac.py -d
|
$ ./build4mac.py -d
|
||||||
|
|
||||||
(3) Confirm successful build.
|
(3) Confirm successful build.
|
||||||
|
|
||||||
(4) Run 'build4mac.py' again with the same options used in (2) PLUS "-y"
|
(4) Run 'build4mac.py' again with the same options used in (2) PLUS "-y"
|
||||||
to deploy executables and libraries under "klayout.app" bundle.
|
to deploy executables and libraries (including Qt's frameworks) under "klayout.app" bundle.
|
||||||
$ ./build4mac.py -d -y
|
$ ./build4mac.py -d -y
|
||||||
|
(5) Copy/move generated bundles ("klayout.app" and "klayout.scripts/") to your
|
||||||
|
"/Applications" directory for installation.
|
||||||
|
|
||||||
|
|
||||||
|
3B. Release build using the non-OS-standard Ruby 2.4 and Python 3.6 both from MacPorts:
|
||||||
|
(1) Make a symbolic link from the parent directory (where 'build.sh' exists) to
|
||||||
|
'build4mac.py', that is,
|
||||||
|
build4mac.py -> macbuild/build4mac.py
|
||||||
|
(2) Invoke 'build4mac.py' with appropriate options:
|
||||||
|
$ cd /where/'build.sh'/exists
|
||||||
|
$ ./build4mac.py -r mp24 -p mp36
|
||||||
|
(3) Confirm successful build.
|
||||||
|
(4) Run 'build4mac.py' again with the same options used in (2) PLUS "-Y"
|
||||||
|
to deploy executables and libraries under "klayout.app" bundle.
|
||||||
|
$ ./build4mac.py -r mp24 -p mp36 -Y
|
||||||
|
* [-Y|--DEPOLY] option deploys KLayout's dylibs and executables only.
|
||||||
|
That is, paths to other modules (Ruby, Python, and Qt5 Frameworks)
|
||||||
|
remain unchanged (absolute paths in your development environment).
|
||||||
|
(5) Copy/move generated bundles ("klayout.app" and "klayout.scripts/") to your
|
||||||
|
"/Applications" directory for installation.
|
||||||
|
|
||||||
|
By: Kazzz (January 08, 2018)
|
||||||
|
|
||||||
[End of File]
|
[End of File]
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import optparse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
## To import global dictionaries of different modules
|
## To import global dictionaries of different modules and utility functions
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
mydir = os.path.dirname(os.path.abspath(__file__))
|
mydir = os.path.dirname(os.path.abspath(__file__))
|
||||||
sys.path.append( mydir + "/macbuild" )
|
sys.path.append( mydir + "/macbuild" )
|
||||||
|
|
@ -35,11 +35,13 @@ def SetGlobals():
|
||||||
global ModuleQt # Qt module to be used
|
global ModuleQt # Qt module to be used
|
||||||
global ModuleRuby # Ruby module to be used
|
global ModuleRuby # Ruby module to be used
|
||||||
global ModulePython # Python module to be used
|
global ModulePython # Python module to be used
|
||||||
|
global NonOSStdLang # True if non-OS-standard language is chosen
|
||||||
global NoQtBindings # True if not creating Qt bindings for Ruby scripts
|
global NoQtBindings # True if not creating Qt bindings for Ruby scripts
|
||||||
global MakeOptions # options passed to `make`
|
global MakeOptions # options passed to `make`
|
||||||
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 DeploymentF # True if fully (including Qt's Frameworks) deploy the binaries for bundles
|
||||||
|
global DeploymentP # True if partially deploy the binaries excluding Qt's Frameworks
|
||||||
global DeployVerbose # -verbose=<0-3> level passed to 'macdeployqt' tool
|
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
|
||||||
|
|
@ -52,35 +54,37 @@ def SetGlobals():
|
||||||
global Bit # machine bit-size
|
global Bit # machine bit-size
|
||||||
|
|
||||||
Usage = "\n"
|
Usage = "\n"
|
||||||
Usage += "---------------------------------------------------------------------------------------------\n"
|
Usage += "--------------------------------------------------------------------------------------------------------\n"
|
||||||
Usage += "<< Usage of 'build4mac.py' >>\n"
|
Usage += "<< Usage of 'build4mac.py' >>\n"
|
||||||
Usage += " for building KLayout 0.25 or later on different Apple Mac OSX platforms.\n"
|
Usage += " for building KLayout 0.25 or later on different Apple Mac OSX platforms.\n"
|
||||||
Usage += "\n"
|
Usage += "\n"
|
||||||
Usage += "$ [python] build4mac.py \n"
|
Usage += "$ [python] ./build4mac.py \n"
|
||||||
Usage += " option & argument : comment on option if any | default value\n"
|
Usage += " option & argument : descriptions | default value\n"
|
||||||
Usage += " -----------------------------------------------------------------------+---------------\n"
|
Usage += " ----------------------------------------------------------------------------------+---------------\n"
|
||||||
Usage += " : * key type names below are case insensitive * | \n"
|
Usage += " : * key type names below are case insensitive * | \n"
|
||||||
Usage += " : 'nil' = not to support the script language | \n"
|
Usage += " : 'nil' = not to support the script language | \n"
|
||||||
Usage += " : 'Sys' = using the OS standard script language | \n"
|
Usage += " : 'Sys' = using the OS standard script language | \n"
|
||||||
Usage += " : Refer to 'macbuild/build4mac_env.py' for details| \n"
|
Usage += " : Refer to 'macbuild/build4mac_env.py' for details | \n"
|
||||||
Usage += " [-q|--qt <type>] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n"
|
Usage += " [-q|--qt <type>] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n"
|
||||||
Usage += " [-r|--ruby <type>] : type=['nil', 'Sys', 'Src24', 'MP24'] | sys \n"
|
Usage += " [-r|--ruby <type>] : type=['nil', 'Sys', 'Src24', 'MP24'] | sys \n"
|
||||||
Usage += " [-p|--python <type>] : type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36'] | sys \n"
|
Usage += " [-p|--python <type>] : type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36'] | sys \n"
|
||||||
Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n"
|
Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n"
|
||||||
Usage += " [-m|--make <option>] : option passed to 'make' | -j4 \n"
|
Usage += " [-m|--make <option>] : option passed to 'make' | -j4 \n"
|
||||||
Usage += " [-d|--debug] : enable debug mode build | disabled \n"
|
Usage += " [-d|--debug] : enable debug mode build | disabled \n"
|
||||||
Usage += " [-c|--checkcom] : check command line and exit without building | disabled \n"
|
Usage += " [-c|--checkcom] : check command line and exit without building | disabled \n"
|
||||||
Usage += " [-y|--deploy] : deploy built binaries with depending libraries | disabled \n"
|
Usage += " [-y|--deploy] : deploy executables and dylibs including Qt's Frameworks | disabled \n"
|
||||||
Usage += " : ! After confirmation of successful build of | \n"
|
Usage += " [-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled \n"
|
||||||
Usage += " : KLayout, rerun this script with BOTH: | \n"
|
Usage += " : from the source code and use the tools in the same machine | \n"
|
||||||
Usage += " : 1) the same options used for building AND | \n"
|
Usage += " : ! After confirmation of successful build of | \n"
|
||||||
Usage += " : 2) <-y|--deploy> | \n"
|
Usage += " : KLayout, rerun this script with BOTH: | \n"
|
||||||
Usage += " : optionally with [-v|--verbose <0-3>] | \n"
|
Usage += " : 1) the same options used for building AND | \n"
|
||||||
Usage += " [-v|--verbose <0-3>] : verbose level of `macdeployqt' | 1 \n"
|
Usage += " : 2) <-y|--deploy> OR <-Y|--DEPLOY> | \n"
|
||||||
Usage += " : 0 = no output, 1 = error/warning (default), | \n"
|
Usage += " : optionally with [-v|--verbose <0-3>] | \n"
|
||||||
Usage += " : 2 = normal, 3 = debug | \n"
|
Usage += " [-v|--verbose <0-3>] : verbose level of `macdeployqt' (effective with -y only) | 1 \n"
|
||||||
Usage += " [-?|--?] : print this usage and exit | disabled \n"
|
Usage += " : 0 = no output, 1 = error/warning (default), | \n"
|
||||||
Usage += "---------------------------------------------------------------------------------------------\n"
|
Usage += " : 2 = normal, 3 = debug | \n"
|
||||||
|
Usage += " [-?|--?] : print this usage and exit | disabled \n"
|
||||||
|
Usage += "--------------------------------------------------------------------------------------------------------\n"
|
||||||
|
|
||||||
ProjectDir = os.getcwd()
|
ProjectDir = os.getcwd()
|
||||||
BuildBash = "./build.sh"
|
BuildBash = "./build.sh"
|
||||||
|
|
@ -132,11 +136,13 @@ def SetGlobals():
|
||||||
ModuleRuby = "nil"
|
ModuleRuby = "nil"
|
||||||
ModulePython = "nil"
|
ModulePython = "nil"
|
||||||
|
|
||||||
|
NonOSStdLang = False
|
||||||
NoQtBindings = False
|
NoQtBindings = False
|
||||||
MakeOptions = "-j4"
|
MakeOptions = "-j4"
|
||||||
DebugMode = False
|
DebugMode = False
|
||||||
CheckComOnly = False
|
CheckComOnly = False
|
||||||
Deployment = False
|
DeploymentF = False
|
||||||
|
DeploymentP = False
|
||||||
DeployVerbose = 1
|
DeployVerbose = 1
|
||||||
Version = GetKLayoutVersionFrom( "./version.sh" )
|
Version = GetKLayoutVersionFrom( "./version.sh" )
|
||||||
|
|
||||||
|
|
@ -149,11 +155,13 @@ def ParseCommandLineArguments():
|
||||||
global ModuleQt
|
global ModuleQt
|
||||||
global ModuleRuby
|
global ModuleRuby
|
||||||
global ModulePython
|
global ModulePython
|
||||||
|
global NonOSStdLang
|
||||||
global NoQtBindings
|
global NoQtBindings
|
||||||
global MakeOptions
|
global MakeOptions
|
||||||
global DebugMode
|
global DebugMode
|
||||||
global CheckComOnly
|
global CheckComOnly
|
||||||
global Deployment
|
global DeploymentF
|
||||||
|
global DeploymentP
|
||||||
global DeployVerbose
|
global DeployVerbose
|
||||||
|
|
||||||
p = optparse.OptionParser( usage=Usage )
|
p = optparse.OptionParser( usage=Usage )
|
||||||
|
|
@ -193,9 +201,15 @@ def ParseCommandLineArguments():
|
||||||
|
|
||||||
p.add_option( '-y', '--deploy',
|
p.add_option( '-y', '--deploy',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
dest='deploy_bins',
|
dest='deploy_full',
|
||||||
default=False,
|
default=False,
|
||||||
help="deploy built binaries" )
|
help="fully deploy built binaries" )
|
||||||
|
|
||||||
|
p.add_option( '-Y', '--DEPLOY',
|
||||||
|
action='store_true',
|
||||||
|
dest='deploy_partial',
|
||||||
|
default=False,
|
||||||
|
help="deploy built binaries when non-OS-standard script language is chosen" )
|
||||||
|
|
||||||
p.add_option( '-v', '--verbose',
|
p.add_option( '-v', '--verbose',
|
||||||
dest='deploy_verbose',
|
dest='deploy_verbose',
|
||||||
|
|
@ -214,7 +228,8 @@ def ParseCommandLineArguments():
|
||||||
make_option = "-j4",
|
make_option = "-j4",
|
||||||
debug_build = False,
|
debug_build = False,
|
||||||
check_command = False,
|
check_command = False,
|
||||||
deploy_bins = False,
|
deploy_full = False,
|
||||||
|
deploy_partial = False,
|
||||||
deploy_verbose = "1",
|
deploy_verbose = "1",
|
||||||
checkusage = False )
|
checkusage = False )
|
||||||
|
|
||||||
|
|
@ -243,6 +258,9 @@ def ParseCommandLineArguments():
|
||||||
print(Usage)
|
print(Usage)
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
|
# By default, OS-standard script languages (Ruby and Python) are used
|
||||||
|
NonOSStdLang = False
|
||||||
|
|
||||||
# Determine Ruby type
|
# Determine Ruby type
|
||||||
candidates = [ i.upper() for i in ['nil', 'Sys', 'Src24', 'MP24'] ]
|
candidates = [ i.upper() for i in ['nil', 'Sys', 'Src24', 'MP24'] ]
|
||||||
ModuleRuby = ""
|
ModuleRuby = ""
|
||||||
|
|
@ -265,9 +283,11 @@ def ParseCommandLineArguments():
|
||||||
ModuleRuby = ''
|
ModuleRuby = ''
|
||||||
break
|
break
|
||||||
elif index == 2:
|
elif index == 2:
|
||||||
ModuleRuby = 'Ruby24SrcBuild'
|
ModuleRuby = 'Ruby24SrcBuild'
|
||||||
|
NonOSStdLang = True
|
||||||
elif index == 3:
|
elif index == 3:
|
||||||
ModuleRuby = 'Ruby24MacPorts'
|
ModuleRuby = 'Ruby24MacPorts'
|
||||||
|
NonOSStdLang = True
|
||||||
else:
|
else:
|
||||||
index += 1
|
index += 1
|
||||||
if ModuleRuby == "":
|
if ModuleRuby == "":
|
||||||
|
|
@ -299,10 +319,13 @@ def ParseCommandLineArguments():
|
||||||
break
|
break
|
||||||
elif index == 2:
|
elif index == 2:
|
||||||
ModulePython = 'Anaconda27'
|
ModulePython = 'Anaconda27'
|
||||||
|
NonOSStdLang = True
|
||||||
elif index == 3:
|
elif index == 3:
|
||||||
ModulePython = 'Anaconda36'
|
ModulePython = 'Anaconda36'
|
||||||
|
NonOSStdLang = True
|
||||||
elif index == 4:
|
elif index == 4:
|
||||||
ModulePython = 'Python36MacPorts'
|
ModulePython = 'Python36MacPorts'
|
||||||
|
NonOSStdLang = True
|
||||||
else:
|
else:
|
||||||
index += 1
|
index += 1
|
||||||
if ModulePython == "":
|
if ModulePython == "":
|
||||||
|
|
@ -315,7 +338,15 @@ def ParseCommandLineArguments():
|
||||||
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
|
DeploymentF = opt.deploy_full
|
||||||
|
DeploymentP = opt.deploy_partial
|
||||||
|
|
||||||
|
if DeploymentF and DeploymentP:
|
||||||
|
print("")
|
||||||
|
print( "!!! Choose either [-y|--deploy] or [-Y|--DEPLOY]", file=sys.stderr )
|
||||||
|
print(Usage)
|
||||||
|
quit()
|
||||||
|
|
||||||
DeployVerbose = int(opt.deploy_verbose)
|
DeployVerbose = int(opt.deploy_verbose)
|
||||||
if not DeployVerbose in [0, 1, 2, 3]:
|
if not DeployVerbose in [0, 1, 2, 3]:
|
||||||
print("")
|
print("")
|
||||||
|
|
@ -323,7 +354,7 @@ def ParseCommandLineArguments():
|
||||||
print(Usage)
|
print(Usage)
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
if not Deployment:
|
if not DeploymentF and not DeploymentP:
|
||||||
target = "%s %s %s" % (Platform, Release, Machine)
|
target = "%s %s %s" % (Platform, Release, Machine)
|
||||||
modules = "Qt=%s, Ruby=%s, Python=%s" % (ModuleQt, ModuleRuby, ModulePython)
|
modules = "Qt=%s, Ruby=%s, Python=%s" % (ModuleQt, ModuleRuby, ModulePython)
|
||||||
message = "### You are going to build KLayout\n for <%s>\n with <%s>...\n"
|
message = "### You are going to build KLayout\n for <%s>\n with <%s>...\n"
|
||||||
|
|
@ -346,7 +377,7 @@ def RunMainBuildBash():
|
||||||
global MakeOptions
|
global MakeOptions
|
||||||
global DebugMode
|
global DebugMode
|
||||||
global CheckComOnly
|
global CheckComOnly
|
||||||
global Deployment
|
global DeploymentF
|
||||||
global MacPkgDir # relative path to package directory
|
global MacPkgDir # relative path to package directory
|
||||||
global MacBinDir # relative path to binary directory
|
global MacBinDir # relative path to binary directory
|
||||||
global MacBuildDir # relative path to build directory
|
global MacBuildDir # relative path to build directory
|
||||||
|
|
@ -435,30 +466,32 @@ def RunMainBuildBash():
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
# [3] Invoke the main Bash script
|
# [3] Invoke the main Bash script; takes time:-)
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
if Deployment:
|
if DeploymentF:
|
||||||
|
return 0
|
||||||
|
elif DeploymentP:
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
myscript = "build4mac.py"
|
myscript = "build4mac.py"
|
||||||
if subprocess.call( command, shell=True ) != 0:
|
if subprocess.call( command, shell=True ) != 0:
|
||||||
print("")
|
print( "", file=sys.stderr )
|
||||||
print( "-------------------------------------------------------------" )
|
print( "-------------------------------------------------------------", file=sys.stderr )
|
||||||
print( "!!! <%s>: failed to build KLayout" % myscript, file=sys.stderr )
|
print( "!!! <%s>: failed to build KLayout" % myscript, file=sys.stderr )
|
||||||
print( "-------------------------------------------------------------" )
|
print( "-------------------------------------------------------------", file=sys.stderr )
|
||||||
print("")
|
print( "", file=sys.stderr )
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
print("")
|
print( "", file=sys.stderr )
|
||||||
print( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" )
|
print( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", file=sys.stderr )
|
||||||
print( "### <%s>: successfully built KLayout" % myscript, file=sys.stderr )
|
print( "### <%s>: successfully built KLayout" % myscript, file=sys.stderr )
|
||||||
print( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" )
|
print( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++", file=sys.stderr )
|
||||||
print("")
|
print( "", file=sys.stderr )
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
## To deploy built binaries and libraries on which those binaries depend
|
## For making a bundle (klayout.app), deploy built binaries and libraries
|
||||||
# for making a bundle (klayout.app)
|
# on which those binaries depend.
|
||||||
#
|
#
|
||||||
# Reference: "Deploying an Application on Mac OS X" of Qt Assistant.
|
# Reference: "Deploying an Application on Mac OS X" of Qt Assistant.
|
||||||
#
|
#
|
||||||
|
|
@ -467,7 +500,9 @@ def RunMainBuildBash():
|
||||||
def DeployBinariesForBundle():
|
def DeployBinariesForBundle():
|
||||||
global ProjectDir
|
global ProjectDir
|
||||||
global ModuleQt
|
global ModuleQt
|
||||||
global Deployment
|
global NonOSStdLang
|
||||||
|
global DeploymentF
|
||||||
|
global DeploymentP
|
||||||
global MacPkgDir
|
global MacPkgDir
|
||||||
global MacBinDir
|
global MacBinDir
|
||||||
global MacBuildDir
|
global MacBuildDir
|
||||||
|
|
@ -486,7 +521,11 @@ def DeployBinariesForBundle():
|
||||||
# [1] Check the status of working directory
|
# [1] Check the status of working directory
|
||||||
#-------------------------------------------------------------
|
#-------------------------------------------------------------
|
||||||
os.chdir(ProjectDir)
|
os.chdir(ProjectDir)
|
||||||
if not Deployment:
|
if not DeploymentF and not DeploymentP:
|
||||||
|
return 1
|
||||||
|
if DeploymentF and NonOSStdLang:
|
||||||
|
print( "!!! You chose <-y|--deploy> while using non-OS-standard script language.", file=sys.stderr )
|
||||||
|
print( " Use <-Y|--DEPLOY> instead", file=sys.stderr )
|
||||||
return 1
|
return 1
|
||||||
if not os.path.isfile(MacBuildLog):
|
if not os.path.isfile(MacBuildLog):
|
||||||
print( "!!! Build log file <%s> does not present !!!" % MacBuildLog, file=sys.stderr )
|
print( "!!! Build log file <%s> does not present !!!" % MacBuildLog, file=sys.stderr )
|
||||||
|
|
@ -676,31 +715,37 @@ def DeployBinariesForBundle():
|
||||||
print( msg % buddy, file=sys.stderr )
|
print( msg % buddy, file=sys.stderr )
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
if DeploymentF:
|
||||||
|
print( " [8] Finally, deploying Qt's Frameworks ..." )
|
||||||
|
#-------------------------------------------------------------
|
||||||
|
# [8] Deploy Qt Frameworks
|
||||||
|
#-------------------------------------------------------------
|
||||||
|
verbose = " -verbose=%d" % DeployVerbose
|
||||||
|
if ModuleQt == 'Qt4MacPorts':
|
||||||
|
deploytool = Qt4MacPorts['deploy']
|
||||||
|
app_bundle = "klayout.app"
|
||||||
|
options = macdepQtOpt + verbose
|
||||||
|
elif ModuleQt == 'Qt5MacPorts':
|
||||||
|
deploytool = Qt5MacPorts['deploy']
|
||||||
|
app_bundle = "klayout.app"
|
||||||
|
options = macdepQtOpt + verbose
|
||||||
|
|
||||||
print( " [8] Finally, deploying Qt's Frameworks ..." )
|
|
||||||
#-------------------------------------------------------------
|
|
||||||
# [8] Deploy Qt frameworks
|
|
||||||
#-------------------------------------------------------------
|
|
||||||
verbose = " -verbose=%d" % DeployVerbose
|
|
||||||
if ModuleQt == 'Qt4MacPorts':
|
|
||||||
deploytool = Qt4MacPorts['deploy']
|
|
||||||
app_bundle = "klayout.app"
|
|
||||||
options = macdepQtOpt + verbose
|
|
||||||
elif ModuleQt == 'Qt5MacPorts':
|
|
||||||
deploytool = Qt5MacPorts['deploy']
|
|
||||||
app_bundle = "klayout.app"
|
|
||||||
options = macdepQtOpt + verbose
|
|
||||||
|
|
||||||
os.chdir(ProjectDir)
|
|
||||||
os.chdir(MacPkgDir)
|
|
||||||
command = "%s %s %s" % ( deploytool, app_bundle, options )
|
|
||||||
if subprocess.call( command, shell=True ) != 0:
|
|
||||||
msg = "!!! Failed to deploy applications on OSX !!!"
|
|
||||||
print( msg, file=sys.stderr )
|
|
||||||
print("")
|
|
||||||
os.chdir(ProjectDir)
|
os.chdir(ProjectDir)
|
||||||
return 1
|
os.chdir(MacPkgDir)
|
||||||
|
command = "%s %s %s" % ( deploytool, app_bundle, options )
|
||||||
|
if subprocess.call( command, shell=True ) != 0:
|
||||||
|
msg = "!!! Failed to deploy applications on OSX !!!"
|
||||||
|
print( msg, file=sys.stderr )
|
||||||
|
print("")
|
||||||
|
os.chdir(ProjectDir)
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
print( "##### Finished deploying libraries and executables for <klayout.app> #####" )
|
||||||
|
print("")
|
||||||
|
os.chdir(ProjectDir)
|
||||||
|
return 0
|
||||||
else:
|
else:
|
||||||
|
print( " [8] Skipped deploying Qt's Frameworks ..." )
|
||||||
print( "##### Finished deploying libraries and executables for <klayout.app> #####" )
|
print( "##### Finished deploying libraries and executables for <klayout.app> #####" )
|
||||||
print("")
|
print("")
|
||||||
os.chdir(ProjectDir)
|
os.chdir(ProjectDir)
|
||||||
|
|
@ -818,16 +863,31 @@ def DeployScriptBundles():
|
||||||
def main():
|
def main():
|
||||||
SetGlobals()
|
SetGlobals()
|
||||||
ParseCommandLineArguments()
|
ParseCommandLineArguments()
|
||||||
|
#----------------------------------------------------------
|
||||||
|
# [The main build stage]
|
||||||
|
#----------------------------------------------------------
|
||||||
ret = RunMainBuildBash()
|
ret = RunMainBuildBash()
|
||||||
if not Deployment:
|
if not DeploymentF and not DeploymentP:
|
||||||
if ret == 0:
|
if ret == 0:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
|
#----------------------------------------------------------
|
||||||
|
# [Deployment stage-1]
|
||||||
|
# Deployment of dynamic link libraries, executables and
|
||||||
|
# resources to make the main "klayout.app" bundle
|
||||||
|
#----------------------------------------------------------
|
||||||
ret1 = DeployBinariesForBundle()
|
ret1 = DeployBinariesForBundle()
|
||||||
|
if not ret1 == 0:
|
||||||
|
sys.exit(1)
|
||||||
|
#----------------------------------------------------------
|
||||||
|
# [Deployment stage-2]
|
||||||
|
# Deployment of wrapper Bash scripts and resources
|
||||||
|
# to make "KLayoutEditor.app" and "KLayoutViewer.app"
|
||||||
|
#----------------------------------------------------------
|
||||||
ret2 = DeployScriptBundles()
|
ret2 = DeployScriptBundles()
|
||||||
if not (ret1 == 0 and ret2 == 0):
|
if ret2 == 0:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
||||||
|
|
@ -141,26 +141,26 @@ PythonHighSierra= { 'exe': '/System/Library/Frameworks/Python.framework/Versions
|
||||||
'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib'
|
'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Using anaconda (https://www.anaconda.com/download/#macos): *+*+*+ EXPERIMENTAL *+*+*+
|
# Using anaconda2 (https://www.anaconda.com/download/#macos) 5.0.1: *+*+*+ EXPERIMENTAL *+*+*+
|
||||||
# If the path to your `conda` command is '$HOME/anaconda/bin/conda'
|
# If the path to your `conda` command is '$HOME/anaconda2/bin/conda'
|
||||||
# and your Python environment was prepared by: $ conda create -n py27klayout python=2.7
|
# and your Python environment was prepared by: $ conda create -n py27klayout python=2.7
|
||||||
#
|
#
|
||||||
# No additional modules are added in the beginning.
|
# No additional modules are installed in the experiment.
|
||||||
# [Key Type Name] = 'Ana27'
|
# [Key Type Name] = 'Ana27'
|
||||||
Anaconda27 = { 'exe': '$HOME/anaconda/envs/py27klayout/bin/python2.7' ,
|
Anaconda27 = { 'exe': '$HOME/anaconda2/envs/py27klayout/bin/python2.7' ,
|
||||||
'inc': '$HOME/anaconda/envs/py27klayout/include/python2.7',
|
'inc': '$HOME/anaconda2/envs/py27klayout/include/python2.7',
|
||||||
'lib': '$HOME/anaconda/envs/py27klayout/lib/libpython2.7.dylib'
|
'lib': '$HOME/anaconda2/envs/py27klayout/lib/libpython2.7.dylib'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Using anaconda (https://www.anaconda.com/download/#macos): *+*+*+ EXPERIMENTAL *+*+*+
|
# Using anaconda2 (https://www.anaconda.com/download/#macos) 5.0.1: *+*+*+ EXPERIMENTAL *+*+*+
|
||||||
# If the path to your `conda` command is '$HOME/anaconda/bin/conda'
|
# If the path to your `conda` command is '$HOME/anaconda2/bin/conda'
|
||||||
# and your Python environment was prepared by: $ conda create -n py36klayout python=3.6
|
# and your Python environment was prepared by: $ conda create -n py36klayout python=3.6
|
||||||
#
|
#
|
||||||
# No additional modules are added in the beginning.
|
# No additional modules are installed in the experiment.
|
||||||
# [Key Type Name] = 'Ana36'
|
# [Key Type Name] = 'Ana36'
|
||||||
Anaconda36 = { 'exe': '$HOME/anaconda/envs/py36klayout/bin/python3.6' ,
|
Anaconda36 = { 'exe': '$HOME/anaconda2/envs/py36klayout/bin/python3.6' ,
|
||||||
'inc': '$HOME/anaconda/envs/py36klayout/include/python3.6m',
|
'inc': '$HOME/anaconda2/envs/py36klayout/include/python3.6m',
|
||||||
'lib': '$HOME/anaconda/envs/py36klayout/lib/libpython3.6m.dylib'
|
'lib': '$HOME/anaconda2/envs/py36klayout/lib/libpython3.6m.dylib'
|
||||||
}
|
}
|
||||||
|
|
||||||
# Python 3.6 from MacPorts (https://www.macports.org/) *+*+*+ EXPERIMENTAL *+*+*+
|
# Python 3.6 from MacPorts (https://www.macports.org/) *+*+*+ EXPERIMENTAL *+*+*+
|
||||||
|
|
@ -182,7 +182,7 @@ PythonDictionary= { 'nil' : None,
|
||||||
}
|
}
|
||||||
|
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
# [4] KLayout executables
|
# [4] KLayout executables including buddy tools
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
KLayoutExecs = ['klayout']
|
KLayoutExecs = ['klayout']
|
||||||
KLayoutExecs += ['strm2cif', 'strm2dxf', 'strm2gds', 'strm2gdstxt', 'strm2oas']
|
KLayoutExecs += ['strm2cif', 'strm2dxf', 'strm2gds', 'strm2gdstxt', 'strm2oas']
|
||||||
|
|
|
||||||
|
|
@ -190,9 +190,9 @@ def GetKLayoutVersionFrom( verfile='version.h' ):
|
||||||
for line in contents:
|
for line in contents:
|
||||||
m = verReg.match(line)
|
m = verReg.match(line)
|
||||||
if m:
|
if m:
|
||||||
# print(m.group(0)) # KLAYOUT_VERSION="0.25"
|
# print(m.group(0)) # KLAYOUT_VERSION="0.25.1"
|
||||||
# print(m.group(1)) # KLAYOUT_VERSION="
|
# print(m.group(1)) # KLAYOUT_VERSION="
|
||||||
# print(m.group(2)) # 0.25
|
# print(m.group(2)) # 0.25.1
|
||||||
# print(m.group(3)) # "
|
# print(m.group(3)) # "
|
||||||
version = m.group(2)
|
version = m.group(2)
|
||||||
return version
|
return version
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue