From aaf117508d5428f6d03c679140a829a00f7f4200 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Sun, 22 Dec 2019 20:15:53 +0900 Subject: [PATCH 1/4] To build 0.26.1 on Catalina. --- macbuild/ReadMe.md | 264 +++++-- macbuild/Resources/KLayoutDMG-Back.logoist | Bin 452095 -> 199144 bytes macbuild/Resources/KLayoutDMG-Back.png | Bin 311787 -> 207064 bytes macbuild/Resources/KLayoutDMG.applescript | 116 ---- macbuild/Resources/KLayoutEditor.sh | 36 - macbuild/Resources/KLayoutViewer.sh | 36 - .../icon-resources/klayout-Ana3.logoist | Bin 0 -> 92023 bytes .../Resources/icon-resources/klayout-Ana3.png | Bin 0 -> 76863 bytes .../icon-resources/klayout-HB.logoist | Bin 0 -> 100754 bytes .../Resources/icon-resources/klayout-HB.png | Bin 0 -> 84476 bytes .../icon-resources/klayout-blue.logoist | Bin 0 -> 96794 bytes .../Resources/icon-resources/klayout-blue.png | Bin 0 -> 91204 bytes .../icon-resources/klayout-green.logoist | Bin 0 -> 80509 bytes .../icon-resources/klayout-green.png | Bin 0 -> 74155 bytes .../icon-resources/klayout-orange.logoist | Bin 0 -> 82643 bytes .../icon-resources/klayout-orange.png | Bin 0 -> 76956 bytes .../icon-resources/klayout-pink.logoist | Bin 0 -> 81898 bytes .../Resources/icon-resources/klayout-pink.png | Bin 0 -> 77667 bytes .../icon-resources/klayout-purple.logoist | Bin 0 -> 81898 bytes .../icon-resources/klayout-purple.png | Bin 0 -> 77392 bytes .../icon-resources/klayout-red.logoist | Bin 0 -> 82384 bytes .../Resources/icon-resources/klayout-red.png | Bin 0 -> 76034 bytes .../icon-resources/klayout-yellow.logoist | Bin 0 -> 92022 bytes .../icon-resources/klayout-yellow.png | Bin 0 -> 86417 bytes macbuild/Resources/klayout-Ana3.icns | Bin 0 -> 353292 bytes macbuild/Resources/klayout-HB.icns | Bin 0 -> 360246 bytes macbuild/Resources/klayout-blue.icns | Bin 251637 -> 381075 bytes macbuild/Resources/klayout-green.icns | Bin 213038 -> 346187 bytes macbuild/Resources/klayout-orange.icns | Bin 0 -> 348445 bytes macbuild/Resources/klayout-pink.icns | Bin 0 -> 348521 bytes macbuild/Resources/klayout-purple.icns | Bin 0 -> 356414 bytes macbuild/Resources/klayout-red.icns | Bin 210773 -> 327739 bytes macbuild/Resources/klayout-yellow.icns | Bin 239220 -> 362697 bytes macbuild/Resources/modified-inv.png | Bin 0 -> 24738 bytes macbuild/Resources/modified-inv_schematic.png | Bin 0 -> 10555 bytes macbuild/Resources/script-bundles.zip | Bin 0 -> 9379888 bytes .../Resources/template-KLayoutDMG.applescript | 22 +- macbuild/build4mac.py | 651 +++++++++--------- macbuild/build4mac_env.py | 217 +++--- macbuild/build4mac_util.py | 19 +- macbuild/makeDMG4mac.py | 215 +++--- 41 files changed, 785 insertions(+), 791 deletions(-) delete mode 100644 macbuild/Resources/KLayoutDMG.applescript delete mode 100755 macbuild/Resources/KLayoutEditor.sh delete mode 100755 macbuild/Resources/KLayoutViewer.sh create mode 100644 macbuild/Resources/icon-resources/klayout-Ana3.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-Ana3.png create mode 100644 macbuild/Resources/icon-resources/klayout-HB.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-HB.png create mode 100644 macbuild/Resources/icon-resources/klayout-blue.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-blue.png create mode 100644 macbuild/Resources/icon-resources/klayout-green.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-green.png create mode 100644 macbuild/Resources/icon-resources/klayout-orange.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-orange.png create mode 100644 macbuild/Resources/icon-resources/klayout-pink.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-pink.png create mode 100644 macbuild/Resources/icon-resources/klayout-purple.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-purple.png create mode 100644 macbuild/Resources/icon-resources/klayout-red.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-red.png create mode 100644 macbuild/Resources/icon-resources/klayout-yellow.logoist create mode 100644 macbuild/Resources/icon-resources/klayout-yellow.png create mode 100644 macbuild/Resources/klayout-Ana3.icns create mode 100644 macbuild/Resources/klayout-HB.icns create mode 100644 macbuild/Resources/klayout-orange.icns create mode 100644 macbuild/Resources/klayout-pink.icns create mode 100644 macbuild/Resources/klayout-purple.icns create mode 100644 macbuild/Resources/modified-inv.png create mode 100644 macbuild/Resources/modified-inv_schematic.png create mode 100644 macbuild/Resources/script-bundles.zip diff --git a/macbuild/ReadMe.md b/macbuild/ReadMe.md index 9ea112376..847d26dd7 100644 --- a/macbuild/ReadMe.md +++ b/macbuild/ReadMe.md @@ -1,13 +1,15 @@ -Relevant KLayout version: 0.25.2 +Relevant KLayout version: 0.26.1 # 1. Introduction -This directory "macbuild" contains different files required for building KLayout (http://www.klayout.de/) version 0.25 or later for different 64-bit Mac OSXs including: -* Yosemite (10.10) +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) -By default, Qt framework is "Qt5" from MacPorts (https://www.macports.org/) which is usually located under: +# 2. Qt5 Frameworks +By default, Qt frameworks are "Qt5" from MacPorts (https://www.macports.org/) which is usually located under: ``` /opt/local/libexec/qt5/ ``` @@ -16,102 +18,218 @@ Alternatively, you can use "Qt5" from Homebrew (https://brew.sh/) which is usual ``` /usr/local/opt/qt/ ``` -Please refer to Section # 5. of this document regarding use of Homebrew. -KLayout 0.25.2 was successfully built with "Qt 5.10.0" from MacPorts and "Qt 5.10.1" from Homebrew. + OR -### IMPORTANT +"Qt5" from Anaconda3 (https://www.anaconda.com/) which is usually located under: ``` -* Please DO NOT USE "Qt 4.x" which is problematic in compilation. +$HOME/opt/anaconda3/pkgs/qt-{version} ``` -Also by default, supported script languages, i.e, Ruby and Python, are those standard ones bundled with the OS. +# 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] -# 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. +$ /usr/bin/python --version + Python 2.7.16 +``` +Even in the latest OS as of today (December 2019), Python 3.x is not bundled with the OS, and this is the main reason why users want non-OS-standard script language support. -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.7 provided by MacPorts or Homebrew is usable. -Please try this (refer to 3B below or Section #5) if you feel it's useful. +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. -# 3. Use-cases -### 3A. Debug build using the OS-standard script languages -1. Make a symbolic link (if it does not exist) 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 (it will take about one hour). -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. The buddy command line tools (strm*) will also be deployed in this step. -``` -$ ./build4mac.py -d -y -``` -5. Copy/move generated bundles ("klayout.app" and "klayout.scripts/") to your "/Applications" directory for installation. +# 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`. #### -### 3B. Release build using the non-OS-standard Ruby 2.4 and Python 3.6 both from MacPorts -1. Make a symbolic link (if it does not exist) from the parent directory (where 'build.sh' exists) to 'build4mac.py', that is, +# 5. Command-line options of **`build4mac.py`** are as shown below. ``` -build4mac.py -> macbuild/build4mac.py +--------------------------------------------------------------------------------------------------------- +<< 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', 'MP26', 'HB26', 'Ana3'] | sys + : nil: don't bind Ruby | + : Sys: use OS-bundled Ruby [2.0 - 2.6] depending on OS | + : MP26: use Ruby 2.6 from MacPorts | + : HB26: use Ruby 2.6 from Homebrew | + : Ana3: use Ruby 2.5 from Anaconda3 | + [-p|--python ] : case-insensitive type=['nil', 'Sys', 'MP37', 'HB37', 'Ana3'] | sys + : nil: don't bind Python | + : Sys: use OS-bundled Python 2.7 [ElCapitan -- Catalina] | + : MP37: use Python 3.7 from MacPorts | + : HB37: use Python 3.7 from Homebrew | + : Ana3: use Python 3.7 from Anaconda3 | + [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled + [-m|--make