diff --git a/macbuild/ReadMe.md b/macbuild/ReadMe.md new file mode 100644 index 000000000..0e39fdb87 --- /dev/null +++ b/macbuild/ReadMe.md @@ -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] diff --git a/macbuild/ReadMe.txt b/macbuild/ReadMe.txt index cb2b7749f..ffa630d17 100644 --- a/macbuild/ReadMe.txt +++ b/macbuild/ReadMe.txt @@ -1,39 +1,69 @@ -<< Draft Version 0.002>> +<< Draft Version 0.003>> +Relevant KLayout version: 0.25.1 1. Introduction: - This directory "macbuild" contains different files required for building KLayout - version 0.25 or later for different Max OSX including: + 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: + By default, Qt framework is "Qt5" from Mac Ports (https://www.macports.org/) which is + usually located under: /opt/local/libexec/qt5/ + : + * 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 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 'build4mac.py', that is, build4mac.py -> macbuild/build4mac.py - - (2) Invoke 'build4mac.py' with appropriate options, for example, for debug-build: + (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 under "klayout.app" bundle. + 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] diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index 21f8fd439..9eaeaca8b 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -17,7 +17,7 @@ import optparse 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__)) sys.path.append( mydir + "/macbuild" ) @@ -35,11 +35,13 @@ def SetGlobals(): global ModuleQt # Qt module to be used global ModuleRuby # Ruby 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 MakeOptions # options passed to `make` global DebugMode # True if debug mode build 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 Version # KLayout's version # auxiliary variables on platform @@ -52,35 +54,37 @@ def SetGlobals(): global Bit # machine bit-size Usage = "\n" - Usage += "---------------------------------------------------------------------------------------------\n" + Usage += "--------------------------------------------------------------------------------------------------------\n" Usage += "<< Usage of 'build4mac.py' >>\n" Usage += " for building KLayout 0.25 or later on different Apple Mac OSX platforms.\n" Usage += "\n" - Usage += "$ [python] build4mac.py \n" - Usage += " option & argument : comment on option if any | default value\n" - Usage += " -----------------------------------------------------------------------+---------------\n" - Usage += " : * key type names below are case insensitive * | \n" - Usage += " : 'nil' = not to support the script language | \n" - Usage += " : 'Sys' = using the OS standard script language | \n" - Usage += " : Refer to 'macbuild/build4mac_env.py' for details| \n" - Usage += " [-q|--qt ] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n" - Usage += " [-r|--ruby ] : type=['nil', 'Sys', 'Src24', 'MP24'] | sys \n" - Usage += " [-p|--python ] : type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36'] | sys \n" - Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n" - Usage += " [-m|--make