From 267a5ee7b0f56ba0ada4137bae29ccdead35894f Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Thu, 23 Nov 2023 15:13:41 +0900 Subject: [PATCH] Overhauled the build system for MacOS ['Monterey', 'Ventura', 'Sonoma'] to build KLayout-0.28.13 or later with support for libgit2. --- macbuild/ReadMe.md | 308 +++----- macbuild/Resources/KLayoutDMG-BackQt5.logoist | Bin 208837 -> 199568 bytes macbuild/Resources/KLayoutDMG-BackQt5.png | Bin 214384 -> 204023 bytes macbuild/Resources/KLayoutDMG-BackQt6.logoist | Bin 208923 -> 200298 bytes macbuild/Resources/KLayoutDMG-BackQt6.png | Bin 212658 -> 202593 bytes macbuild/Resources/script-bundle-A.zip | Bin 6532496 -> 6533264 bytes macbuild/Resources/script-bundle-B.zip | Bin 6533198 -> 6534030 bytes macbuild/Resources/script-bundle-H.zip | Bin 6528706 -> 6529534 bytes macbuild/Resources/script-bundle-P.zip | Bin 6580678 -> 6581623 bytes macbuild/Resources/script-bundles.zip | Bin 14436045 -> 14409438 bytes macbuild/Resources/start-console.py | 19 + macbuild/Resources/template-start-console.py | 39 + macbuild/build4mac.py | 724 ++++++++---------- macbuild/build4mac_env.py | 334 +++----- macbuild/build4mac_util.py | 55 +- macbuild/macQAT.py | 63 +- macbuild/macQAT.sh | 10 +- macbuild/macQAT2.sh | 40 + macbuild/makeDMG4mac.py | 83 +- macbuild/nightlyBuild.py | 102 ++- macbuild/python3HB.py | 17 +- src/klayout.pri | 10 +- 22 files changed, 828 insertions(+), 976 deletions(-) create mode 100644 macbuild/Resources/template-start-console.py create mode 100755 macbuild/macQAT2.sh diff --git a/macbuild/ReadMe.md b/macbuild/ReadMe.md index c5f20d882..ce1ca3410 100644 --- a/macbuild/ReadMe.md +++ b/macbuild/ReadMe.md @@ -1,39 +1,37 @@ -Relevant KLayout version: 0.28.6
+Relevant KLayout version: 0.28.13
Author: Kazzz-S
-Last modified: 2023-03-19
+Last modified: 2023-11-11
# 1. Introduction -This directory **`macbuild`** contains various files required for building KLayout (http://www.klayout.de/) version 0.28.6 or later for different 64-bit macOS, including: -* Catalina (10.15.7) : the primary development environment -* Big Sur (11.x) : experimental; Apple (M1|M2) chip is not tested since the author does not own an (M1|M2) Mac -* Monterey (12.x) : -- ditto -- -* Ventura (13.x) : -- ditto -- +This directory **`macbuild`** contains various files required for building KLayout (http://www.klayout.de/) version 0.28.13 or later for different 64-bit macOS, including: +* Monterey (12.x) : the primary development environment +* Ventura (13.x) : experimental +* Sonoma (14.x) : -- ditto -- -Building KLayout for the previous operating systems listed below should still be possible.
-However, they are not actively supported, and DMG packages are not provided. +Building KLayout for the previous operating systems listed below has been discontinued.
+Pre-built DMG packages are also not provided. +* Big Sur (11.7.10) +* Catalina (10.15.7) * Mojave (10.14) * High Sierra (10.13) * Sierra (10.12) * El Capitan (10.11) -Throughout this document, the primary target machine is **Intel x86_64** with **macOS Catalina**.
-A **((Notes))** marker indicates special notes for specific operating systems. +Throughout this document, the primary target machine is **Intel x86_64** with **macOS Monterey**.
+All Apple (M1|M2|M3) chips are still untested, as the author does not own an (M1|M2|M3) Mac.
# 2. Qt Frameworks -**((Notes))** For **Catalina** - -The default Qt framework is "Qt5" from MacPorts (https://www.macports.org/), which is usually located under: -``` -/opt/local/libexec/qt5/ -``` - -**((Notes))** For **Big Sur**, **Monterey**, and **Ventura** The default Qt framework is "Qt5" from Homebrew (https://brew.sh/), which is usually located under: ``` /usr/local/opt/qt@5/ ``` +If you prefer **MacPorts** (https://www.macports.org/), "Qt5" is usually located under: +``` +/opt/local/libexec/qt5/ +``` + You can also choose "Qt5" from Anaconda3 (https://www.anaconda.com/), which is usually located under: ``` $HOME/opt/anaconda3/pkgs/qt-{version} @@ -46,91 +44,26 @@ If you have installed Anaconda3 under $HOME/opt/anaconda3/, make a symbolic link The migration work to "Qt6" is ongoing. You can try to use it; however, you will encounter some build and runtime errors. # 3. Script language support: Ruby and Python -Earlier, by default, supported script languages, i.e., Ruby and Python, were those standard ones bundled with the OS.
-``` -$ /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 -``` -Note that this configuration for backward compatibility is possible only for macOS Catalina (10.15.7).
-In contrast, Homebrew's Ruby 3.2 and Python 3.9 are the default environment for Big Sur, Monterey, and Ventura.
-Since Python 2.7 is already deprecated, using MacPorts' or Homebrew's Ruby 3.2 and Python 3.9 are also recommended for Catalina. - -The build script **`build4mac.py`** provides several possible combinations of Qt5, Ruy, and Python modules to accommodate such a slightly complex environment.
+The build script **`build4mac.py`** provides several possible combinations of Qt5, Ruby, and Python modules to suit the user's needs and preferences.
Some typical use cases are described in Section 6. # 4. Prerequisites You need to have the followings: * 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 +* Qt5 package from Homebrew, MacPorts, or Anaconda3 +* Optionally, Ruby and Python packages from Homebrew, MacPorts, or Anaconda3 #### For matching versions of Ruby and Python, please also refer to `build4mac_env.py`. # 5. Command-line options of **`build4mac.py`** -**((Notes))** For **Catalina** + +**`build4mac.py`** is the top level Python script for for building KLayout for a macOS. +The operating system type is detected automatically. + ``` --------------------------------------------------------------------------------------------------------- << Usage of 'build4mac.py' >> - for building KLayout 0.28.6 or later on different Apple macOS / 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 - : 'Qt6MacPorts', 'Qt6Brew'] | - : Qt5MacPorts: use Qt5 from MacPorts | - : Qt5Brew: use Qt5 from Homebrew | - : Qt5Ana3: use Qt5 from Anaconda3 | - : Qt6MacPorts: use Qt6 from MacPorts (*) | - : Qt6Brew: use Qt6 from Homebrew (*) | - : (*) migration to Qt6 is ongoing | - [-r|--ruby ] : case-insensitive type=['nil', 'Sys', 'MP31', 'HB31', 'Ana3', | sys - : 'MP32', HB32'] | - : nil: don't bind Ruby | - : Sys: use OS-bundled Ruby [2.0 - 2.6] depending on OS | - : MP31: use Ruby 3.1 from MacPorts | - : HB31: use Ruby 3.1 from Homebrew | - : Ana3: use Ruby 3.1 from Anaconda3 | - : MP32: use Ruby 3.2 from MacPorts | - : HB32: use Ruby 3.2 from Homebrew | - [-p|--python ] : case-insensitive type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3', | sys - : 'MP39', HB39', 'HBAuto'] | - : nil: don't bind Python | - : Sys: use OS-bundled Python 2.7 up to Catalina | - : MP38: use Python 3.8 from MacPorts | - : HB38: use Python 3.8 from Homebrew | - : Ana3: use Python 3.9 from Anaconda3 | - : MP39: use Python 3.9 from MacPorts | - : HB39: use Python 3.9 from Homebrew | - : HBAuto: use the latest Python 3.x auto-detected from Homebrew | - [-P|--buildPymod] : build and deploy Pymod (*.whl and *.egg) for LW-*.dmg | disabled - [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled - [-u|--noqtuitools] : don't include uitools in Qt binding | disabled - [-m|--make