Relevant KLayout version: 0.26.9
# 1. Introduction
This directory **`macbuild`** contains different files required for building KLayout (http://www.klayout.de/) version 0.26.1 or later for different 64-bit Mac OSXs, including:
* El Capitan (10.11)
* Sierra (10.12)
* High Sierra (10.13)
* Mojave (10.14)
* Catalina (10.15) : the primary development environment
* Big Sur (11.0) : under development for the future support
# 2. Qt5 Frameworks
By default, the Qt framework is "Qt5" from MacPorts (https://www.macports.org/), which is usually located under:
```
/opt/local/libexec/qt5/
```
Alternatively, you can use "Qt5" from Homebrew (https://brew.sh/), which is usually located under:
```
/usr/local/opt/qt/
```
OR
"Qt5" from Anaconda3 (https://www.anaconda.com/), which is usually located under:
```
$HOME/opt/anaconda3/pkgs/qt-{version}
```
If you have installed Anaconda3 under $HOME/opt/anaconda3/, make a symbolic link:
```
/Applications/anaconda3/ ---> $HOME/opt/anaconda3/
```
# 3. Script language support: Ruby and Python
By default, supported script languages, i.e., Ruby and Python, are those standard ones bundled with the OS.
As for Catalina (10.15),
```
$ /usr/bin/ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
$ /usr/bin/python --version
Python 2.7.16
```
Even in the latest OS (11.0 Big Sur) as of today (November 2020), Python 3.x is not bundled with the OS, which is why users want non-OS-standard script language support.
To meet such a requirement, the build script **`build4mac.py`** provides several possible combinations of Qt5, Ruy, and Python module.
Some typical use cases are described in Section 6.
# 4. Prerequisites
You need to have:
* the latest Xcode and command-line tool kit compliant with each OS
* Qt5 package from MacPorts, Homebrew, or Anaconda3
* optionally Ruby and Python packages from MacPorts, Homebrew, or Anaconda3
#### For matching versions of Ruby and Python, please also refer to `build4mac_env.py`. ####
# 5. Command-line options of **`build4mac.py`** are as shown below.
```
---------------------------------------------------------------------------------------------------------
<< Usage of **`build4mac.py`** >>
for building KLayout 0.26.1 or later on different Apple Mac OSX platforms.
$ [python] ./build4mac.py
option & argument : descriptions (refer to 'macbuild/build4mac_env.py' for details)| default value
--------------------------------------------------------------------------------------+---------------
[-q|--qt ] : case-insensitive type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3'] | qt5macports
: Qt5MacPorts: use Qt5 from MacPorts |
: Qt5Brew: use Qt5 from Homebrew |
: Qt5Ana3: use Qt5 from Anaconda3 |
[-r|--ruby ] : case-insensitive type=['nil', 'Sys', 'MP27', 'HB27', 'Ana3'] | sys
: nil: don't bind Ruby |
: Sys: use OS-bundled Ruby [2.0 - 2.6] depending on OS |
: MP27: use Ruby 2.7 from MacPorts |
: HB27: use Ruby 2.7 from Homebrew |
: Ana3: use Ruby 2.5 from Anaconda3 |
[-p|--python ] : case-insensitive type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3', | sys
: 'HBAuto'] |
: nil: don't bind Python |
: Sys: use OS-bundled Python 2.7 [ElCapitan -- BigSur] |
: MP38: use Python 3.8 from MacPorts |
: HB38: use Python 3.8 from Homebrew |
: Ana3: use Python 3.7 from Anaconda3 |
: HBAuto: use the latest Python 3.x auto-detected from Homebrew |
[-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled
[-m|--make