mirror of https://github.com/KLayout/klayout.git
Merge pull request #1181 from Kazzz-S/master-mac-qt6
master-branch: Update of the Mac build system to include the migration to Qt6
This commit is contained in:
commit
72c4dc055d
|
|
@ -1,15 +1,15 @@
|
|||
Relevant KLayout version: 0.27.10<br>
|
||||
Relevant KLayout version: 0.27.11<br>
|
||||
Author: Kazzz-S<br>
|
||||
Last modified: 2022-07-28<br>
|
||||
Last modified: 2022-10-10<br>
|
||||
|
||||
# 1. Introduction
|
||||
This directory **`macbuild`** contains different files required for building KLayout (http://www.klayout.de/) version 0.27.10 or later for different 64-bit macOS, including:
|
||||
This directory **`macbuild`** contains different files required for building KLayout (http://www.klayout.de/) version 0.27.11 or later for different 64-bit macOS, including:
|
||||
* Catalina (10.15.7) : the primary development environment
|
||||
* Big Sur (11.x) : experimental; Apple M1 chip is not tested since the author does not own an M1 Mac
|
||||
* Monterey (12.x) : -- ditto --
|
||||
|
||||
Building KLayout for the previous operating systems listed below should still be possible. <br>
|
||||
However, they are not actively supported, and DMG packages for them are not provided.
|
||||
However, they are not actively supported, and DMG packages are not provided.
|
||||
* Mojave (10.14)
|
||||
* High Sierra (10.13)
|
||||
* Sierra (10.12)
|
||||
|
|
@ -18,29 +18,32 @@ However, they are not actively supported, and DMG packages for them are not prov
|
|||
Throughout this document, the primary target machine is **Intel x86_64** with **macOS Catalina**.<br>
|
||||
A **((Notes))** marker indicates special notes for specific operating systems.
|
||||
|
||||
# 2. Qt5 Frameworks
|
||||
By default, the Qt framework is "Qt5" from MacPorts (https://www.macports.org/), which is usually located under:
|
||||
# 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/
|
||||
```
|
||||
|
||||
Alternatively, you can use "Qt5" from Homebrew (https://brew.sh/), which is usually located under:
|
||||
**((Notes))** For **Big Sur** and **Monterey**
|
||||
|
||||
The default Qt framework is "Qt5" from Homebrew (https://brew.sh/), which is usually located under:
|
||||
```
|
||||
/usr/local/opt/qt@5/
|
||||
```
|
||||
|
||||
OR
|
||||
|
||||
"Qt5" from Anaconda3 (https://www.anaconda.com/), which is usually located under:
|
||||
You can also choose "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/
|
||||
```
|
||||
**((Notes))** "Qt5" from Homebrew is chosen as the default for **Big Sur** and **Monterey**.
|
||||
|
||||
The migration work to "Qt6" is ongoing. You can try to use it; however, you will encounter some build and runtime errors.
|
||||
For example, as of 2021-11-27, MacPorts' Qt6 does not provide `qt6-qtmultimedia`, which causes a build error.
|
||||
|
||||
# 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.<br>
|
||||
|
|
@ -53,7 +56,7 @@ $ /usr/bin/python --version
|
|||
Python 2.7.16
|
||||
```
|
||||
|
||||
Big Sur (11.x) and Monterey (< 12.3) still provide the Python 2.7 binaries to run various legacy applications.<br>
|
||||
Big Sur (11.x) and Monterey (< 12.3) still provide Python 2.7 binaries to run various legacy applications.<br>
|
||||
However, the latest Xcode 13.1 does not allow us to link the legacy Python 2.7 library with the newly compiled KLayout binaries.<br>
|
||||
Moreover, Monterey (12.3.1) finally eliminated the Python 2.7 binaries.<br>
|
||||
Therefore, Homebrew is adopted as the default environment for Big Sur and Monterey.
|
||||
|
|
@ -62,10 +65,10 @@ The build script **`build4mac.py`** provides several possible combinations of Qt
|
|||
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
|
||||
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
|
||||
* 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.
|
||||
|
|
@ -73,15 +76,19 @@ You need to have:
|
|||
```
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
<< Usage of 'build4mac.py' >>
|
||||
for building KLayout 0.27.10 or later on different Apple macOS / Mac OSX platforms.
|
||||
for building KLayout 0.27.11 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 <type>] : case-insensitive type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3'] | qt5macports
|
||||
[-q|--qt <type>] : 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 <type>] : case-insensitive type=['nil', 'Sys', 'MP31', 'HB31', 'Ana3'] | sys
|
||||
: nil: don't bind Ruby |
|
||||
: Sys: use OS-bundled Ruby [2.0 - 2.6] depending on OS |
|
||||
|
|
@ -89,12 +96,13 @@ $ [python] ./build4mac.py
|
|||
: HB31: use Ruby 3.1 from Homebrew |
|
||||
: Ana3: use Ruby 3.1 from Anaconda3 |
|
||||
[-p|--python <type>] : case-insensitive type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3', | sys
|
||||
: 'HBAuto'] |
|
||||
: HB39', 'HBAuto'] |
|
||||
: nil: don't bind Python |
|
||||
: Sys: use OS-bundled Python 2.7 [ElCapitan -- Catalina] |
|
||||
: MP38: use Python 3.8 from MacPorts |
|
||||
: HB38: use Python 3.8 from Homebrew |
|
||||
: Ana3: use Python 3.8 from Anaconda3 |
|
||||
: 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
|
||||
|
|
@ -105,7 +113,7 @@ $ [python] ./build4mac.py
|
|||
[-y|--deploy] : deploy executables and dylibs including Qt's Frameworks | disabled
|
||||
[-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled
|
||||
: from the source code and use the tools in the same machine |
|
||||
: ! After confirmation of successful build of 'klayout.app', |
|
||||
: ! After confirmation of the successful build of 'klayout.app', |
|
||||
: rerun this script with BOTH: |
|
||||
: 1) the same options used for building AND |
|
||||
: 2) <-y|--deploy> OR <-Y|--DEPLOY> |
|
||||
|
|
@ -121,15 +129,19 @@ $ [python] ./build4mac.py
|
|||
```
|
||||
---------------------------------------------------------------------------------------------------------
|
||||
<< Usage of 'build4mac.py' >>
|
||||
for building KLayout 0.27.10 or later on different Apple macOS / Mac OSX platforms.
|
||||
for building KLayout 0.27.11 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 <type>] : case-insensitive type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3'] | qt5brew
|
||||
[-q|--qt <type>] : case-insensitive type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3', | qt5brew
|
||||
: '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 <type>] : case-insensitive type=['nil', 'Sys', 'MP31', 'HB31', 'Ana3'] | hb31
|
||||
: nil: don't bind Ruby |
|
||||
: Sys: use OS-bundled Ruby [2.0 - 2.6] depending on OS |
|
||||
|
|
@ -137,12 +149,13 @@ $ [python] ./build4mac.py
|
|||
: HB31: use Ruby 3.1 from Homebrew |
|
||||
: Ana3: use Ruby 3.1 from Anaconda3 |
|
||||
[-p|--python <type>] : case-insensitive type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3', | hb38
|
||||
: 'HBAuto'] |
|
||||
: HB39', 'HBAuto'] |
|
||||
: nil: don't bind Python |
|
||||
: Sys: use OS-bundled Python 2.7 [ElCapitan -- Catalina] |
|
||||
: MP38: use Python 3.8 from MacPorts |
|
||||
: HB38: use Python 3.8 from Homebrew |
|
||||
: Ana3: use Python 3.8 from Anaconda3 |
|
||||
: 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
|
||||
|
|
@ -153,7 +166,7 @@ $ [python] ./build4mac.py
|
|||
[-y|--deploy] : deploy executables and dylibs including Qt's Frameworks | disabled
|
||||
[-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled
|
||||
: from the source code and use the tools in the same machine |
|
||||
: ! After confirmation of successful build of 'klayout.app', |
|
||||
: ! After confirmation of the successful build of 'klayout.app', |
|
||||
: rerun this script with BOTH: |
|
||||
: 1) the same options used for building AND |
|
||||
: 2) <-y|--deploy> OR <-Y|--DEPLOY> |
|
||||
|
|
@ -181,7 +194,7 @@ $ sudo port install qt5
|
|||
$ cd /where/'build.sh'/exists
|
||||
$ ./build4mac.py
|
||||
```
|
||||
2. Confirm successful build (it will take about one hour depending on your machine spec).
|
||||
2. Confirm successful build (it will take about one hour, depending on your machine spec).
|
||||
3. Run **`build4mac.py`** again with the same options used in 1. PLUS "-y" to deploy executables and libraries (including Qt's framework) under **`klayout.app`** bundle.<br>
|
||||
The buddy command-line tools (strm*) will also be deployed in this step.
|
||||
```
|
||||
|
|
@ -215,7 +228,7 @@ $ sudo port install py38-pip
|
|||
$ cd /where/'build.sh'/exists
|
||||
$ ./build4mac.py -q qt5macports -r mp31 -p mp38
|
||||
```
|
||||
2. Confirm successful build (it will take about one hour depending on your machine spec).
|
||||
2. Confirm successful build (it will take about one hour, depending on your machine spec).
|
||||
3. Run **`build4mac.py`** again with the same options used in 1. PLUS "-Y" to deploy executables and libraries under **`klayout.app`** bundle.<br>
|
||||
The buddy command-line tools (strm*) will also be deployed under **klayout.app/Contents/Buddy/** in this step.<br>
|
||||
If you use `--buildPymod` option in Step-1 and Step-3, the KLayout Python Module (\*.whl, \*.egg) will be built and deployed under **klayout.app/Contents/pymod-dist/**.
|
||||
|
|
@ -242,7 +255,7 @@ $ brew install python@3.8
|
|||
$ cd /where/'build.sh'/exists
|
||||
$ ./build4mac.py -q qt5brew -r hb31 -p hb38
|
||||
```
|
||||
2. Confirm successful build (it will take about one hour depending on your machine spec).
|
||||
2. Confirm successful build (it will take about one hour, depending on your machine spec).
|
||||
3. Run **`build4mac.py`** again with the same options used in 1. PLUS "-Y" to deploy executables and libraries under **`klayout.app`** bundle.<br>
|
||||
The buddy command-line tools (strm*) will also be deployed under **klayout.app/Contents/Buddy/** in this step.<br>
|
||||
If you use `--buildPymod` option in Step-1 and Step-3, the KLayout Python Module (\*.whl, \*.egg) will be built and deployed under **klayout.app/Contents/pymod-dist/**.
|
||||
|
|
@ -268,8 +281,8 @@ $ brew install python@3.8
|
|||
$ cd /where/'build.sh'/exists
|
||||
$ ./build4mac.py -q qt5brew -r sys -p hb38
|
||||
```
|
||||
2. Confirm successful build (it will take about one hour depending on your machine spec).
|
||||
3. Run **`build4mac.py`** again with the same options used in 1. PLUS "-y" to deploy executables and libraries (including Qt's framework and Python framework) under **`klayout.app`** bundle.<br>
|
||||
2. Confirm successful build (it will take about one hour, depending on your machine spec).
|
||||
3. Run **`build4mac.py`** again with the same options used in 1. PLUS "-y" to deploy executables and libraries (including Qt and Python frameworks) under the **`klayout.app`** bundle.<br>
|
||||
The buddy command-line tools (strm*) will also be deployed under **klayout.app/Contents/Buddy/** in this step.
|
||||
|
||||
```
|
||||
|
|
@ -295,7 +308,7 @@ $ conda install ruby
|
|||
$ cd /where/'build.sh'/exists
|
||||
$ ./build4mac.py -q qt5ana3 -r ana3 -p ana3
|
||||
```
|
||||
2. Confirm successful build (it will take about one hour depending on your machine spec).
|
||||
2. Confirm successful build (it will take about one hour, depending on your machine spec).
|
||||
3. Run **`build4mac.py`** again with the same options used in 1. PLUS "-Y" to deploy executables and libraries under **`klayout.app`** bundle.<br>
|
||||
The buddy command-line tools (strm*) will also be deployed under **klayout.app/Contents/Buddy/** in this step.<br>
|
||||
If you use `--buildPymod` option in Step-1 and Step-3, the KLayout Python Module (\*.whl, \*.egg) will be built and deployed under **klayout.app/Contents/pymod-dist/**.
|
||||
|
|
@ -309,14 +322,14 @@ $ ./build4mac.py -q qt5ana3 -r ana3 -p ana3 -Y
|
|||
* "qt5Ana3" means that Qt5 from Anaconda3 is used.
|
||||
* "Rana3Pana3" means that Ruby (3.1) is from Anaconda3; Python (3.8) is from Anaconda3.
|
||||
4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation.
|
||||
5. You may have to set `PYTHONHOME` environment variable like:
|
||||
5. You may have to set the `PYTHONHOME` environment variable like:
|
||||
```
|
||||
export PYTHONHOME=$HOME/opt/anaconda3
|
||||
```
|
||||
|
||||
### 6F. Other combinations
|
||||
Logically, several different module combinations other than 6A. through 6E. are possible, including `nil` choice.<br>
|
||||
If you choose such a combination, the resultant package directory name will begin with **`EX-`** (exceptional).
|
||||
Logically, several different module combinations other than 6A through 6E are possible, including `nil` choice.<br>
|
||||
The resultant package directory name will begin with **`EX-`** (exceptional) if you choose such a combination.
|
||||
|
||||
----
|
||||
|
||||
|
|
@ -334,16 +347,16 @@ $ cd /where/'build.sh'/exists
|
|||
$ ./makeDMG4mac.py -p ST-qt5MP.pkg.macos-Catalina-release-RsysPsys -m
|
||||
```
|
||||
This command will generate the two files below:<br>
|
||||
* **`ST-klayout-0.27.10-macOS-Catalina-1-qt5MP-RsysPsys.dmg`** ---(1) the main DMG file
|
||||
* **`ST-klayout-0.27.10-macOS-Catalina-1-qt5MP-RsysPsys.dmg.md5`** ---(2) MD5-value text file
|
||||
* **`ST-klayout-0.27.11-macOS-Catalina-1-qt5MP-RsysPsys.dmg`** ---(1) the main DMG file
|
||||
* **`ST-klayout-0.27.11-macOS-Catalina-1-qt5MP-RsysPsys.dmg.md5`** ---(2) MD5-value text file
|
||||
|
||||
# Known issues
|
||||
Because we assume some specific versions of non-OS-standard Ruby and Python, updating MacPorts, Homebrew, or Anaconda3 may cause build- and link errors.<br>
|
||||
In such cases, you need to update the dictionary contents of **`build4mac_env.py`**.
|
||||
|
||||
# Final comments
|
||||
No need to say, KLayout is a great tool! <br>
|
||||
With the object-oriented script language (both Ruby and Python) support, our error-prone layout jobs can be greatly simplified and speed-up.<br>
|
||||
No need to say KLayout is a great tool! <br>
|
||||
With the object-oriented script language (both Ruby and Python) support, our error-prone layout jobs can be greatly simplified and sped up.<br>
|
||||
Building KLayout from its source code is not difficult. Try it with your favorite environment!
|
||||
|
||||
[End of File]
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 205 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 205 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -7,7 +7,6 @@
|
|||
# The top Python script for building KLayout (http://www.klayout.de/index.php)
|
||||
# version 0.26.1 or later on different Apple Mac OSX platforms.
|
||||
#===============================================================================
|
||||
from __future__ import print_function # to use print() of Python 3 in Python >= 2.7
|
||||
import sys
|
||||
import os
|
||||
import codecs
|
||||
|
|
@ -35,12 +34,12 @@ from build4mac_util import *
|
|||
#-------------------------------------------------------------------------------
|
||||
def GenerateUsage(platform):
|
||||
if platform.upper() in [ "MONTEREY", "BIGSUR" ]: # with Xcode [13.1 .. ]
|
||||
myQt5 = "qt5brew"
|
||||
myQt56 = "qt5brew"
|
||||
myRuby = "hb31"
|
||||
myPython = "hb38"
|
||||
moduleset = ('qt5Brew', 'HB31', 'HB38')
|
||||
else: # with Xcode [ .. 12.4]
|
||||
myQt5 = "qt5macports"
|
||||
myQt56 = "qt5macports"
|
||||
myRuby = "sys"
|
||||
myPython = "sys"
|
||||
moduleset = ('qt5MP', 'Sys', 'Sys')
|
||||
|
|
@ -48,15 +47,19 @@ def GenerateUsage(platform):
|
|||
usage = "\n"
|
||||
usage += "---------------------------------------------------------------------------------------------------------\n"
|
||||
usage += "<< Usage of 'build4mac.py' >>\n"
|
||||
usage += " for building KLayout 0.27.10 or later on different Apple macOS / Mac OSX platforms.\n"
|
||||
usage += " for building KLayout 0.27.11 or later on different Apple macOS / Mac OSX platforms.\n"
|
||||
usage += "\n"
|
||||
usage += "$ [python] ./build4mac.py\n"
|
||||
usage += " option & argument : descriptions (refer to 'macbuild/build4mac_env.py' for details)| default value\n"
|
||||
usage += " --------------------------------------------------------------------------------------+---------------\n"
|
||||
usage += " [-q|--qt <type>] : case-insensitive type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3'] | %s \n" % myQt5
|
||||
usage += " [-q|--qt <type>] : case-insensitive type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3', | %s \n" % myQt56
|
||||
usage += " : 'Qt6MacPorts', 'Qt6Brew'] | \n"
|
||||
usage += " : Qt5MacPorts: use Qt5 from MacPorts | \n"
|
||||
usage += " : Qt5Brew: use Qt5 from Homebrew | \n"
|
||||
usage += " : Qt5Ana3: use Qt5 from Anaconda3 | \n"
|
||||
usage += " : Qt6MacPorts: use Qt6 from MacPorts (*) | \n"
|
||||
usage += " : Qt6Brew: use Qt6 from Homebrew (*) | \n"
|
||||
usage += " : (*) migration to Qt6 is ongoing | \n"
|
||||
usage += " [-r|--ruby <type>] : case-insensitive type=['nil', 'Sys', 'MP31', 'HB31', 'Ana3'] | %s \n" % myRuby
|
||||
usage += " : nil: don't bind Ruby | \n"
|
||||
usage += " : Sys: use OS-bundled Ruby [2.0 - 2.6] depending on OS | \n"
|
||||
|
|
@ -64,12 +67,13 @@ def GenerateUsage(platform):
|
|||
usage += " : HB31: use Ruby 3.1 from Homebrew | \n"
|
||||
usage += " : Ana3: use Ruby 3.1 from Anaconda3 | \n"
|
||||
usage += " [-p|--python <type>] : case-insensitive type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3', | %s \n" % myPython
|
||||
usage += " : 'HBAuto'] | \n"
|
||||
usage += " : HB39', 'HBAuto'] | \n"
|
||||
usage += " : nil: don't bind Python | \n"
|
||||
usage += " : Sys: use OS-bundled Python 2.7 [ElCapitan -- Catalina] | \n"
|
||||
usage += " : MP38: use Python 3.8 from MacPorts | \n"
|
||||
usage += " : HB38: use Python 3.8 from Homebrew | \n"
|
||||
usage += " : Ana3: use Python 3.8 from Anaconda3 | \n"
|
||||
usage += " : HB39: use Python 3.9 from Homebrew | \n"
|
||||
usage += " : HBAuto: use the latest Python 3.x auto-detected from Homebrew | \n"
|
||||
usage += " [-P|--buildPymod] : build and deploy Pymod (*.whl and *.egg) for LW-*.dmg | disabled\n"
|
||||
usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled\n"
|
||||
|
|
@ -80,7 +84,7 @@ def GenerateUsage(platform):
|
|||
usage += " [-y|--deploy] : deploy executables and dylibs including Qt's Frameworks | disabled\n"
|
||||
usage += " [-Y|--DEPLOY] : deploy executables and dylibs for those who built KLayout | disabled\n"
|
||||
usage += " : from the source code and use the tools in the same machine | \n"
|
||||
usage += " : ! After confirmation of successful build of 'klayout.app', | \n"
|
||||
usage += " : ! After confirmation of the uccessful build of 'klayout.app', | \n"
|
||||
usage += " : rerun this script with BOTH: | \n"
|
||||
usage += " : 1) the same options used for building AND | \n"
|
||||
usage += " : 2) <-y|--deploy> OR <-Y|--DEPLOY> | \n"
|
||||
|
|
@ -131,7 +135,7 @@ def Get_Default_Config():
|
|||
sys.exit(1)
|
||||
|
||||
if not Machine == "x86_64":
|
||||
if Machine == "arm64" and (Platform == "Monterey" or Platform == "BigSur"): # with an Apple Silicon Chip
|
||||
if Machine == "arm64" and Platform in ["Monterey", "BigSur"]: # with an Apple Silicon Chip
|
||||
print("")
|
||||
print( "### Your Mac equips an Apple Silicon Chip ###" )
|
||||
print("")
|
||||
|
|
@ -375,7 +379,7 @@ def Parse_CLI_Args(config):
|
|||
p = optparse.OptionParser(usage=Usage)
|
||||
p.add_option( '-q', '--qt',
|
||||
dest='type_qt',
|
||||
help="Qt type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3']" )
|
||||
help="Qt type=['Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3', 'Qt6MacPorts', 'Qt6Brew']" )
|
||||
|
||||
p.add_option( '-r', '--ruby',
|
||||
dest='type_ruby',
|
||||
|
|
@ -383,7 +387,7 @@ def Parse_CLI_Args(config):
|
|||
|
||||
p.add_option( '-p', '--python',
|
||||
dest='type_python',
|
||||
help="Python type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3', 'HBAuto']" )
|
||||
help="Python type=['nil', 'Sys', 'MP38', 'HB38', 'Ana3', 'HB39', 'HBAuto']" )
|
||||
|
||||
p.add_option( '-P', '--buildPymod',
|
||||
action='store_true',
|
||||
|
|
@ -480,6 +484,8 @@ def Parse_CLI_Args(config):
|
|||
candidates['QT5MACPORTS'] = 'Qt5MacPorts'
|
||||
candidates['QT5BREW'] = 'Qt5Brew'
|
||||
candidates['QT5ANA3'] = 'Qt5Ana3'
|
||||
candidates['QT6MACPORTS'] = 'Qt6MacPorts'
|
||||
candidates['QT6BREW'] = 'Qt6Brew'
|
||||
try:
|
||||
ModuleQt = candidates[ opt.type_qt.upper() ]
|
||||
except KeyError:
|
||||
|
|
@ -492,11 +498,15 @@ def Parse_CLI_Args(config):
|
|||
print(Usage)
|
||||
sys.exit(1)
|
||||
elif ModuleQt == "Qt5MacPorts":
|
||||
choiceQt5 = 'qt5MP'
|
||||
choiceQt56 = 'qt5MP'
|
||||
elif ModuleQt == "Qt5Brew":
|
||||
choiceQt5 = 'qt5Brew'
|
||||
choiceQt56 = 'qt5Brew'
|
||||
elif ModuleQt == "Qt5Ana3":
|
||||
choiceQt5 = 'qt5Ana3'
|
||||
choiceQt56 = 'qt5Ana3'
|
||||
elif ModuleQt == "Qt6MacPorts":
|
||||
choiceQt56 = 'qt6MP'
|
||||
elif ModuleQt == "Qt6Brew":
|
||||
choiceQt56 = 'qt6Brew'
|
||||
|
||||
# By default, OS-standard (-bundled) script languages (Ruby and Python) are used
|
||||
NonOSStdLang = False
|
||||
|
|
@ -556,6 +566,7 @@ def Parse_CLI_Args(config):
|
|||
candidates['MP38'] = 'MP38'
|
||||
candidates['HB38'] = 'HB38'
|
||||
candidates['ANA3'] = 'Ana3'
|
||||
candidates['HB39'] = 'HB39'
|
||||
candidates['HBAUTO'] = 'HBAuto'
|
||||
try:
|
||||
choicePython = candidates[ opt.type_python.upper() ]
|
||||
|
|
@ -590,6 +601,9 @@ def Parse_CLI_Args(config):
|
|||
elif choicePython == "Ana3":
|
||||
ModulePython = 'PythonAnaconda3'
|
||||
NonOSStdLang = True
|
||||
elif choicePython == "HB39":
|
||||
ModulePython = 'Python39Brew'
|
||||
NonOSStdLang = True
|
||||
elif choicePython == "HBAuto":
|
||||
ModulePython = 'PythonAutoBrew'
|
||||
NonOSStdLang = True
|
||||
|
|
@ -601,7 +615,7 @@ def Parse_CLI_Args(config):
|
|||
sys.exit(1)
|
||||
|
||||
# (D) Set of modules chosen
|
||||
ModuleSet = ( choiceQt5, choiceRuby, choicePython )
|
||||
ModuleSet = ( choiceQt56, choiceRuby, choicePython )
|
||||
|
||||
# (E) Set other parameters
|
||||
BuildPymod = opt.build_pymod
|
||||
|
|
@ -647,10 +661,10 @@ def Parse_CLI_Args(config):
|
|||
elif DeploymentF:
|
||||
if (ModuleRuby in RubySys) and (ModulePython in PythonSys):
|
||||
PackagePrefix = "ST-"
|
||||
message += "a standard (ST-) package including Qt5 and using OS-bundled Ruby and Python..."
|
||||
elif ModulePython == 'Python38Brew' or ModulePython == 'PythonAutoBrew':
|
||||
message += "a standard (ST-) package including Qt[5|6] and using OS-bundled Ruby and Python..."
|
||||
elif ModulePython in ['Python38Brew', 'Python39Brew', 'PythonAutoBrew']:
|
||||
PackagePrefix = "HW-"
|
||||
message += "a heavyweight (HW-) package including Qt5 and Python3.8~ from Homebrew..."
|
||||
message += "a heavyweight (HW-) package including Qt[5|6] and Python3.8~ from Homebrew..."
|
||||
else:
|
||||
PackagePrefix = "EX-"
|
||||
message += "a package with exceptional (EX-) combinations of different modules..."
|
||||
|
|
@ -733,7 +747,7 @@ def Get_Build_Parameters(config):
|
|||
mode = "release"
|
||||
|
||||
# (B) Modules
|
||||
(qt, ruby, python) = ModuleSet # ( 'qt5MP', 'Sys', 'Sys' )
|
||||
(qt, ruby, python) = ModuleSet # ( 'qt6Brew', 'Sys', 'Sys' )
|
||||
ruby_python = "R%sP%s" % ( ruby.lower(), python.lower() )
|
||||
|
||||
# (C) Target directories and files
|
||||
|
|
@ -744,7 +758,7 @@ def Get_Build_Parameters(config):
|
|||
MacBuildDirQAT = MacBuildDir + ".macQAT"
|
||||
parameters['logfile'] = MacBuildLog
|
||||
|
||||
# (D) Qt5
|
||||
# (D) Qt5|6
|
||||
if ModuleQt == 'Qt5MacPorts':
|
||||
parameters['qmake'] = Qt5MacPorts['qmake']
|
||||
parameters['deploy_tool'] = Qt5MacPorts['deploy']
|
||||
|
|
@ -754,6 +768,12 @@ def Get_Build_Parameters(config):
|
|||
elif ModuleQt == 'Qt5Ana3':
|
||||
parameters['qmake'] = Qt5Ana3['qmake']
|
||||
parameters['deploy_tool'] = Qt5Ana3['deploy']
|
||||
elif ModuleQt == 'Qt6MacPorts':
|
||||
parameters['qmake'] = Qt6MacPorts['qmake']
|
||||
parameters['deploy_tool'] = Qt6MacPorts['deploy']
|
||||
elif ModuleQt == 'Qt6Brew':
|
||||
parameters['qmake'] = Qt6Brew['qmake']
|
||||
parameters['deploy_tool'] = Qt6Brew['deploy']
|
||||
|
||||
parameters['bin'] = MacBinDir
|
||||
parameters['build'] = MacBuildDir
|
||||
|
|
@ -805,7 +825,7 @@ def Get_Build_Parameters(config):
|
|||
# BuildPymod = True
|
||||
# Platform = [ 'Monterey', 'BigSur', 'Catalina' ]
|
||||
# ModuleRuby = [ 'Ruby31MacPorts', 'Ruby31Brew', 'RubyAnaconda3' ]
|
||||
# ModulePython = [ 'Python38MacPorts', 'Python38Brew',
|
||||
# ModulePython = [ 'Python38MacPorts', 'Python38Brew', 'Python39Brew',
|
||||
# 'PythonAnaconda3', 'PythonAutoBrew' ]
|
||||
parameters['BuildPymod'] = BuildPymod
|
||||
parameters['Platform'] = Platform
|
||||
|
|
@ -817,7 +837,7 @@ def Get_Build_Parameters(config):
|
|||
if ModuleRuby in [ 'Ruby31MacPorts', 'Ruby31Brew', 'RubyAnaconda3' ]:
|
||||
if ModulePython in ['Python38MacPorts']:
|
||||
PymodDistDir[ModulePython] = 'dist-MP3'
|
||||
elif ModulePython in [ 'Python38Brew', 'PythonAutoBrew' ]:
|
||||
elif ModulePython in [ 'Python38Brew', 'Python39Brew', 'PythonAutoBrew' ]:
|
||||
PymodDistDir[ModulePython] = 'dist-HB3'
|
||||
elif ModulePython in [ 'PythonAnaconda3' ]:
|
||||
PymodDistDir[ModulePython] = 'dist-ana3'
|
||||
|
|
@ -839,7 +859,7 @@ def Build_pymod(parameters):
|
|||
# Platform = [ 'Monterey', 'BigSur', 'Catalina' ]
|
||||
# ModuleRuby = [ 'Ruby31MacPorts', 'Ruby31Brew', 'RubyAnaconda3' ]
|
||||
# ModulePython = [ 'Python38MacPorts', 'Python38Brew',
|
||||
# 'PythonAnaconda3', 'PythonAutoBrew' ]
|
||||
# 'PythonAnaconda3', 'Python39Brew', 'PythonAutoBrew' ]
|
||||
#---------------------------------------------------------------------------
|
||||
BuildPymod = parameters['BuildPymod']
|
||||
Platform = parameters['Platform']
|
||||
|
|
@ -851,7 +871,7 @@ def Build_pymod(parameters):
|
|||
return 0
|
||||
elif not ModuleRuby in [ 'Ruby31MacPorts', 'Ruby31Brew', 'RubyAnaconda3' ]:
|
||||
return 0
|
||||
elif not ModulePython in [ 'Python38MacPorts', 'Python38Brew', 'PythonAnaconda3', 'PythonAutoBrew' ]:
|
||||
elif not ModulePython in [ 'Python38MacPorts', 'Python38Brew', 'PythonAnaconda3', 'Python39Brew', 'PythonAutoBrew' ]:
|
||||
return 0
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
|
@ -987,8 +1007,8 @@ def Run_Build_Command(parameters):
|
|||
# (C) Target directories and files
|
||||
MacBuildDirQAT = parameters['build'] + ".macQAT"
|
||||
|
||||
# (D) Qt5
|
||||
cmd_args += " \\\n -qt5"
|
||||
# (D) Qt5 | Qt6 (Homebrew)
|
||||
#cmd_args += " \\\n -qt5" # make 'build.sh' detect the Qt type automatically
|
||||
cmd_args += " \\\n -qmake %s" % parameters['qmake']
|
||||
cmd_args += " \\\n -bin %s" % parameters['bin']
|
||||
cmd_args += " \\\n -build %s" % parameters['build']
|
||||
|
|
@ -1585,6 +1605,9 @@ def Deploy_Binaries_For_Bundle(config, parameters):
|
|||
#----------------------------------------------------------------------------------
|
||||
# Typical usage of 'pip' after installation of the DMG package
|
||||
#
|
||||
# $ cd /Applications/klayout.app/Contents/MacOS/
|
||||
# $ ./start-console.py
|
||||
#
|
||||
# $ /Applications/klayout.app/Contents/MacOS/start-console.py
|
||||
# Warning: Populating font family aliases took 195 ms. Replace uses of missing font\
|
||||
# family "Monospace" with one that exists to avoid this cost.
|
||||
|
|
@ -1633,7 +1656,7 @@ def Deploy_Binaries_For_Bundle(config, parameters):
|
|||
print( " Ruby2.7 from Homebrew is not yet supported." )
|
||||
print( " Since you have Homebrew development environment, there two options:" )
|
||||
print( " (1) Retry to make a package with '-Y|--DEPLOY' option." )
|
||||
print( " This will not deploy any of Qt5, Python, and Ruby from Homebrew." )
|
||||
print( " This will not deploy any of Qt[5|6], Python, and Ruby from Homebrew." )
|
||||
print( " Instead, the package will directly use those Frameworks and libraries" )
|
||||
print( " in your Homebrew environment." )
|
||||
print( " (2) Rebuild KLayout with '-r|--ruby <nil|Sys>' option depending on your preference." )
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env python
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#===============================================================================
|
||||
|
|
@ -32,30 +32,13 @@ else:
|
|||
del System, Node, Release, MacVersion, Machine, Processor
|
||||
|
||||
#-----------------------------------------------------
|
||||
# [1] Qt6 or Qt5
|
||||
# [1] Qt5 or Qt6
|
||||
#-----------------------------------------------------
|
||||
Qts = [ 'Qt6MacPorts', 'Qt6Brew' ]
|
||||
Qts += [ 'Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3' ]
|
||||
Qts = [ 'Qt5MacPorts', 'Qt5Brew', 'Qt5Ana3' ]
|
||||
Qts += [ 'Qt6MacPorts', 'Qt6Brew' ]
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Whereabout of different components of Qt6
|
||||
#-----------------------------------------------------
|
||||
# Qt6 from MacPorts (https://www.macports.org/)
|
||||
# install with 'sudo port install [qt6|qt6-qttools]'
|
||||
# [Key Type Name] = 'Qt6MacPorts'
|
||||
Qt6MacPorts = { 'qmake' : '/opt/local/libexec/qt6/bin/qmake',
|
||||
'deploy': '/opt/local/libexec/qt6/bin/macdeployqt'
|
||||
}
|
||||
|
||||
# Qt6 from Homebrew (https://brew.sh/)
|
||||
# install with 'brew install qt6'
|
||||
# [Key Type Name] = 'Qt6Brew'
|
||||
Qt6Brew = { 'qmake' : '%s/opt/qt@6/bin/qmake' % DefaultHomebrewRoot,
|
||||
'deploy': '%s/opt/qt@6/bin/macdeployqt' % DefaultHomebrewRoot
|
||||
}
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Whereabout of different components of Qt5
|
||||
# Whereabouts of different components of Qt5
|
||||
#-----------------------------------------------------
|
||||
# Qt5 from MacPorts (https://www.macports.org/)
|
||||
# install with 'sudo port install [qt5|qt5-qttools]'
|
||||
|
|
@ -79,6 +62,23 @@ Qt5Ana3 = { 'qmake' : '/Applications/anaconda3/bin/qmake',
|
|||
'deploy': '/Applications/anaconda3/bin/macdeployqt'
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Whereabouts of different components of Qt6 *+*+*+ EXPERIMENTAL *+*+*+
|
||||
#-------------------------------------------------------------------------
|
||||
# Qt6 from MacPorts (https://www.macports.org/)
|
||||
# install with 'sudo port install [qt6|qt6-qttools]'
|
||||
# [Key Type Name] = 'Qt6MacPorts'
|
||||
Qt6MacPorts = { 'qmake' : '/opt/local/libexec/qt6/bin/qmake',
|
||||
'deploy': '/opt/local/libexec/qt6/bin/macdeployqt'
|
||||
}
|
||||
|
||||
# Qt6 from Homebrew (https://brew.sh/)
|
||||
# install with 'brew install qt6'
|
||||
# [Key Type Name] = 'Qt6Brew'
|
||||
Qt6Brew = { 'qmake' : '%s/opt/qt@6/bin/qmake' % DefaultHomebrewRoot,
|
||||
'deploy': '%s/opt/qt@6/bin/macdeployqt' % DefaultHomebrewRoot
|
||||
}
|
||||
|
||||
#-----------------------------------------------------
|
||||
# [2] Ruby
|
||||
#-----------------------------------------------------
|
||||
|
|
@ -89,7 +89,7 @@ RubyExt = [ 'Ruby31MacPorts', 'Ruby31Brew', 'RubyAnaconda3' ]
|
|||
Rubies = RubyNil + RubySys + RubyExt
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Whereabout of different components of Ruby
|
||||
# Whereabouts of different components of Ruby
|
||||
#-----------------------------------------------------
|
||||
# Bundled with Yosemite (10.10)
|
||||
# !!! Yosemite is no longer supported (KLayout 0.26 ~) but remains here to keep the record of
|
||||
|
|
@ -225,7 +225,7 @@ PythonExt = [ 'Python38MacPorts', 'Python38Brew', 'Python39Brew', 'PythonAnacon
|
|||
Pythons = PythonNil + PythonSys + PythonExt
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Whereabout of different components of Python
|
||||
# Whereabouts of different components of Python
|
||||
#-----------------------------------------------------
|
||||
# Bundled with Yosemite (10.10)
|
||||
# !!! Yosemite is no longer supported but remains here to keep the record of the directory structure
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#! /usr/bin/env python
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#=============================================================================================
|
||||
|
|
@ -11,7 +11,6 @@
|
|||
# 1) https://el-tramo.be/guides/fancy-dmg/
|
||||
# 2) https://github.com/andreyvit/create-dmg.git
|
||||
#=============================================================================================
|
||||
from __future__ import print_function # to use print() of Python 3 in Python >= 2.7
|
||||
from time import sleep
|
||||
import sys
|
||||
import os
|
||||
|
|
@ -77,7 +76,7 @@ def SetGlobals():
|
|||
Usage = "\n"
|
||||
Usage += "---------------------------------------------------------------------------------------------------------\n"
|
||||
Usage += "<< Usage of 'makeDMG4mac.py' >>\n"
|
||||
Usage += " for making a DMG file of KLayout 0.27.10 or later on different Apple macOS / Mac OSX platforms.\n"
|
||||
Usage += " for making a DMG file of KLayout 0.27.11 or later on different Apple macOS / Mac OSX platforms.\n"
|
||||
Usage += "\n"
|
||||
Usage += "$ [python] ./makeDMG4mac.py\n"
|
||||
Usage += " option & argument : descriptions | default value\n"
|
||||
|
|
@ -137,7 +136,7 @@ def SetGlobals():
|
|||
sys.exit(1)
|
||||
|
||||
if not Machine == "x86_64":
|
||||
if Machine == "arm64" and (Platform == "Monterey" or Platform == "BigSur"): # with an Apple Silicon Chip
|
||||
if Machine == "arm64" and Platform in ["Monterey", "BigSur"]: # with an Apple Silicon Chip
|
||||
print("")
|
||||
print( "### Your Mac equips an Apple Silicon Chip ###" )
|
||||
print("")
|
||||
|
|
@ -159,7 +158,7 @@ def SetGlobals():
|
|||
RubyPythonID = ""
|
||||
KLVersion = GetKLayoutVersionFrom( "./version.sh" )
|
||||
OccupiedDS = -1
|
||||
BackgroundPNG = "KLayoutDMG-Back.png"
|
||||
BackgroundPNG = None
|
||||
VolumeIcons = "KLayoutHDD.icns"
|
||||
AppleScriptDMG = "macbuild/Resources/KLayoutDMG.applescript"
|
||||
WorkDMG = "work-KLayout.dmg"
|
||||
|
|
@ -200,8 +199,12 @@ def SetGlobals():
|
|||
# * LW-qt5Brew.pkg.macos-Catalina-release-Rhb31Phb38
|
||||
# * LW-qt5MP.pkg.macos-Catalina-release-Rmp31Pmp38
|
||||
#
|
||||
# * ST-qt6MP.pkg.macos-Catalina-release-RsysPsys
|
||||
# * LW-qt6Brew.pkg.macos-Catalina-release-Rhb31Phb38
|
||||
# * LW-qt6MP.pkg.macos-Catalina-release-Rmp31Pmp38
|
||||
#
|
||||
# Generated DMG will be, for example,
|
||||
# (1) ---> ST-klayout-0.26.1-macOS-Catalina-1-qt5MP-RsysPsys.dmg
|
||||
# (1) ---> ST-klayout-0.27.11-macOS-Catalina-1-qt5MP-RsysPsys.dmg
|
||||
#
|
||||
# @return on success, positive integer in [MB] that tells approx. occupied disc space;
|
||||
# on failure, -1
|
||||
|
|
@ -217,6 +220,7 @@ def CheckPkgDirectory():
|
|||
global PackagePrefix
|
||||
global QtIdentification
|
||||
global RubyPythonID
|
||||
global BackgroundPNG
|
||||
global LatestOSMacPorts
|
||||
global LatestOSHomebrew
|
||||
global LatestOSAnaconda3
|
||||
|
|
@ -238,14 +242,17 @@ def CheckPkgDirectory():
|
|||
|
||||
#-----------------------------------------------------------------------------
|
||||
# [2] Identify (Qt, Ruby, Python) from PkgDir
|
||||
#
|
||||
# * ST-qt5MP.pkg.macos-Catalina-release-RsysPsys
|
||||
# * LW-qt5Ana3.pkg.macos-Catalina-release-Rana3Pana3
|
||||
# * LW-qt5Brew.pkg.macos-Catalina-release-Rhb31Phb38
|
||||
# * HW-qt5Brew.pkg.macos-Catalina-release-RsysPhb38
|
||||
# * EX-qt5MP.pkg.macos-Catalina-release-Rmp31Pmp38
|
||||
#
|
||||
# * ST-qt6MP.pkg.macos-Catalina-release-RsysPsys
|
||||
# * LW-qt6MP.pkg.macos-Catalina-release-Rmp31Pmp38
|
||||
# * LW-qt6Brew.pkg.macos-Catalina-release-Rhb31Phb38
|
||||
#-----------------------------------------------------------------------------
|
||||
patQRP = u'(ST|LW|HW|EX)([-])(qt5[0-9A-Za-z]+)([.]pkg[.])([A-Za-z]+[-][A-Za-z]+[-]release[-])([0-9A-Za-z]+)'
|
||||
patQRP = u'(ST|LW|HW|EX)([-])([qt5|qt6][0-9A-Za-z]+)([.]pkg[.])([A-Za-z]+[-][A-Za-z]+[-]release[-])([0-9A-Za-z]+)'
|
||||
regQRP = re.compile(patQRP)
|
||||
if not regQRP.match(PkgDir):
|
||||
print( "! Cannot identify (Qt, Ruby, Python) from the package directory name" )
|
||||
|
|
@ -259,24 +266,31 @@ def CheckPkgDirectory():
|
|||
PackagePrefix = pkgdirComponents[0]
|
||||
QtIdentification = pkgdirComponents[2]
|
||||
RubyPythonID = pkgdirComponents[5]
|
||||
if QtIdentification.find('qt5') == 0:
|
||||
BackgroundPNG = "KLayoutDMG-BackQt5.png"
|
||||
elif QtIdentification.find('qt6') == 0:
|
||||
BackgroundPNG = "KLayoutDMG-BackQt6.png"
|
||||
else:
|
||||
BackgroundPNG = None
|
||||
raise Exception( "! neither qt5 nor qt6" )
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# [3] Check if the "LatestOS" with MacPorts / Homebrew / Anaconda3
|
||||
#-----------------------------------------------------------------------------
|
||||
LatestOSMacPorts = Platform == LatestOS
|
||||
LatestOSMacPorts &= PackagePrefix == "LW"
|
||||
LatestOSMacPorts &= QtIdentification == "qt5MP"
|
||||
LatestOSMacPorts &= RubyPythonID == "Rmp31Pmp38"
|
||||
LatestOSMacPorts &= QtIdentification in ["qt5MP", "qt6MP"]
|
||||
LatestOSMacPorts &= RubyPythonID in ["Rmp31Pmp38"]
|
||||
|
||||
LatestOSHomebrew = Platform == LatestOS
|
||||
LatestOSHomebrew &= PackagePrefix == "LW"
|
||||
LatestOSHomebrew &= QtIdentification == "qt5Brew"
|
||||
LatestOSHomebrew &= RubyPythonID == "Rhb31Phb38" or RubyPythonID == "Rhb31Phbauto"
|
||||
LatestOSHomebrew &= QtIdentification in ["qt5Brew", "qt6Brew"]
|
||||
LatestOSHomebrew &= RubyPythonID in ["Rhb31Phb38", "Rhb31Phb39", "Rhb31Phbauto"]
|
||||
|
||||
LatestOSAnaconda3 = Platform == LatestOS
|
||||
LatestOSAnaconda3 &= PackagePrefix == "LW"
|
||||
LatestOSAnaconda3 &= QtIdentification == "qt5Ana3"
|
||||
LatestOSAnaconda3 &= RubyPythonID == "Rana3Pana3"
|
||||
LatestOSAnaconda3 &= QtIdentification in ["qt5Ana3"]
|
||||
LatestOSAnaconda3 &= RubyPythonID in ["Rana3Pana3"]
|
||||
|
||||
if LatestOSMacPorts:
|
||||
mydic = DicLightWeight["ports"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#! /usr/bin/env python
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import print_function # to use print() of Python 3 in Python >= 2.7
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
|
|
@ -71,23 +70,28 @@ def Get_Build_Target_Dict():
|
|||
# @return a dictionary; key=mnemonic, value=build option list
|
||||
#------------------------------------------------------------------------------
|
||||
def Get_Build_Options( targetDic ):
|
||||
if QtType == 5:
|
||||
qtType = "Qt5"
|
||||
else:
|
||||
qtType = "Qt6"
|
||||
|
||||
buildOp = dict()
|
||||
for key in targetDic.keys():
|
||||
target = targetDic[key]
|
||||
if target == "std": # use 'Qt5MacPorts' that provides Qt 5.15.2~ to run on "Big Sur", too
|
||||
buildOp["std"] = [ '-q', 'Qt5MacPorts', '-r', 'sys', '-p', 'sys' ]
|
||||
buildOp["std"] = [ '-q', '%sMacPorts' % qtType, '-r', 'sys', '-p', 'sys' ]
|
||||
elif target == "ports":
|
||||
buildOp["ports"] = [ '-q', 'Qt5MacPorts', '-r', 'MP31', '-p', 'MP38' ]
|
||||
buildOp["ports"] = [ '-q', '%sMacPorts' % qtType, '-r', 'MP31', '-p', 'MP38' ]
|
||||
elif target == "brew":
|
||||
buildOp["brew"] = [ '-q', 'Qt5Brew', '-r', 'HB31', '-p', 'HB38' ]
|
||||
buildOp["brew"] = [ '-q', '%sBrew' % qtType, '-r', 'HB31', '-p', 'HB38' ]
|
||||
elif target == "brewHW":
|
||||
buildOp["brewHW"] = [ '-q', 'Qt5Brew', '-r', 'sys', '-p', 'HB38' ]
|
||||
buildOp["brewHW"] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HB38' ]
|
||||
elif target == "ana3":
|
||||
buildOp["ana3"] = [ '-q', 'Qt5Ana3', '-r', 'Ana3', '-p', 'Ana3' ]
|
||||
buildOp["ana3"] = [ '-q', '%sAna3' % qtType, '-r', 'Ana3', '-p', 'Ana3' ]
|
||||
elif target == "brewA":
|
||||
buildOp["brewA"] = [ '-q', 'Qt5Brew', '-r', 'HB31', '-p', 'HBAuto' ]
|
||||
buildOp["brewA"] = [ '-q', '%sBrew' % qtType, '-r', 'HB31', '-p', 'HBAuto' ]
|
||||
elif target == "brewAHW":
|
||||
buildOp["brewAHW"] = [ '-q', 'Qt5Brew', '-r', 'sys', '-p', 'HBAuto' ]
|
||||
buildOp["brewAHW"] = [ '-q', '%sBrew' % qtType, '-r', 'sys', '-p', 'HBAuto' ]
|
||||
|
||||
if WithPymod:
|
||||
buildOp["ports"] = buildOp["ports"] + ['--buildPymod']
|
||||
|
|
@ -104,23 +108,28 @@ def Get_Build_Options( targetDic ):
|
|||
# @return a dictionary; key=mnemonic, value=".macQAT" directory
|
||||
#------------------------------------------------------------------------------
|
||||
def Get_QAT_Directory( targetDic, platform ):
|
||||
if QtType == 5:
|
||||
qtType = "qt5"
|
||||
else:
|
||||
qtType = "qt6"
|
||||
|
||||
dirQAT = dict()
|
||||
for key in targetDic.keys():
|
||||
target = targetDic[key]
|
||||
if target == "std":
|
||||
dirQAT["std"] = 'qt5MP.build.macos-%s-release-RsysPsys.macQAT' % platform
|
||||
dirQAT["std"] = '%sMP.build.macos-%s-release-RsysPsys.macQAT' % (qtType, platform)
|
||||
elif target == "ports":
|
||||
dirQAT["ports"] = 'qt5MP.build.macos-%s-release-Rmp31Pmp38.macQAT' % platform
|
||||
dirQAT["ports"] = '%sMP.build.macos-%s-release-Rmp31Pmp38.macQAT' % (qtType, platform)
|
||||
elif target == "brew":
|
||||
dirQAT["brew"] = 'qt5Brew.build.macos-%s-release-Rhb31Phb38.macQAT' % platform
|
||||
dirQAT["brew"] = '%sBrew.build.macos-%s-release-Rhb31Phb38.macQAT' % (qtType, platform)
|
||||
elif target == "brewHW":
|
||||
dirQAT["brewHW"] = 'qt5Brew.build.macos-%s-release-RsysPhb38.macQAT' % platform
|
||||
dirQAT["brewHW"] = '%sBrew.build.macos-%s-release-RsysPhb38.macQAT' % (qtType, platform)
|
||||
elif target == "ana3":
|
||||
dirQAT["ana3"] = 'qt5Ana3.build.macos-%s-release-Rana3Pana3.macQAT' % platform
|
||||
dirQAT["ana3"] = '%sAna3.build.macos-%s-release-Rana3Pana3.macQAT' % (qtType, platform)
|
||||
elif target == "brewA":
|
||||
dirQAT["brewA"] = 'qt5Brew.build.macos-%s-release-Rhb31Phbauto.macQAT' % platform
|
||||
dirQAT["brewA"] = '%sBrew.build.macos-%s-release-Rhb31Phbauto.macQAT' % (qtType, platform)
|
||||
elif target == "brewAHW":
|
||||
dirQAT["brewAHW"] = 'qt5Brew.build.macos-%s-release-RsysPhbauto.macQAT' % platform
|
||||
dirQAT["brewAHW"] = '%sBrew.build.macos-%s-release-RsysPhbauto.macQAT' % (qtType, platform)
|
||||
return dirQAT
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
@ -134,6 +143,11 @@ def Get_QAT_Directory( targetDic, platform ):
|
|||
# @return a dictionary; key=mnemonic, value=build option list
|
||||
#------------------------------------------------------------------------------
|
||||
def Get_Package_Options( targetDic, platform, srlDMG, makeflag ):
|
||||
if QtType == 5:
|
||||
qtType = "qt5"
|
||||
else:
|
||||
qtType = "qt6"
|
||||
|
||||
if makeflag:
|
||||
flag = '-m'
|
||||
else:
|
||||
|
|
@ -143,25 +157,25 @@ def Get_Package_Options( targetDic, platform, srlDMG, makeflag ):
|
|||
for key in targetDic.keys():
|
||||
target = targetDic[key]
|
||||
if target == "std":
|
||||
packOp["std"] = [ '-p', 'ST-qt5MP.pkg.macos-%s-release-RsysPsys' % platform,
|
||||
packOp["std"] = [ '-p', 'ST-%sMP.pkg.macos-%s-release-RsysPsys' % (qtType, platform),
|
||||
'-s', '%d' % srlDMG, '%s' % flag ]
|
||||
elif target == "ports":
|
||||
packOp["ports"] = [ '-p', 'LW-qt5MP.pkg.macos-%s-release-Rmp31Pmp38' % platform,
|
||||
packOp["ports"] = [ '-p', 'LW-%sMP.pkg.macos-%s-release-Rmp31Pmp38' % (qtType, platform),
|
||||
'-s', '%d' % srlDMG, '%s' % flag ]
|
||||
elif target == "brew":
|
||||
packOp["brew"] = [ '-p', 'LW-qt5Brew.pkg.macos-%s-release-Rhb31Phb38' % platform,
|
||||
packOp["brew"] = [ '-p', 'LW-%sBrew.pkg.macos-%s-release-Rhb31Phb38' % (qtType, platform),
|
||||
'-s', '%d' % srlDMG, '%s' % flag ]
|
||||
elif target == "brewHW":
|
||||
packOp["brewHW"] = [ '-p', 'HW-qt5Brew.pkg.macos-%s-release-RsysPhb38' % platform,
|
||||
packOp["brewHW"] = [ '-p', 'HW-%sBrew.pkg.macos-%s-release-RsysPhb38' % (qtType, platform),
|
||||
'-s', '%d' % srlDMG, '%s' % flag ]
|
||||
elif target == "ana3":
|
||||
packOp["ana3"] = [ '-p', 'LW-qt5Ana3.pkg.macos-%s-release-Rana3Pana3' % platform,
|
||||
packOp["ana3"] = [ '-p', 'LW-%sAna3.pkg.macos-%s-release-Rana3Pana3' % (qtType, platform),
|
||||
'-s', '%d' % srlDMG, '%s' % flag ]
|
||||
elif target == "brewA":
|
||||
packOp["brewA"] = [ '-p', 'LW-qt5Brew.pkg.macos-%s-release-Rhb31Phbauto' % platform,
|
||||
packOp["brewA"] = [ '-p', 'LW-%sBrew.pkg.macos-%s-release-Rhb31Phbauto' % (qtType, platform),
|
||||
'-s', '%d' % srlDMG, '%s' % flag ]
|
||||
elif target == "brewAHW":
|
||||
packOp["brewAHW"] = [ '-p', 'HW-qt5Brew.pkg.macos-%s-release-RsysPhbauto' % platform,
|
||||
packOp["brewAHW"] = [ '-p', 'HW-%sBrew.pkg.macos-%s-release-RsysPhbauto' % (qtType, platform),
|
||||
'-s', '%d' % srlDMG, '%s' % flag ]
|
||||
return packOp
|
||||
|
||||
|
|
@ -170,6 +184,7 @@ def Get_Package_Options( targetDic, platform, srlDMG, makeflag ):
|
|||
#------------------------------------------------------------------------------
|
||||
def Parse_CommandLine_Arguments():
|
||||
global Usage # usage
|
||||
global QtType # Qt type
|
||||
global Target # target list
|
||||
global Build # operation flag
|
||||
global WithPymod # operation flag
|
||||
|
|
@ -197,8 +212,10 @@ def Parse_CommandLine_Arguments():
|
|||
Usage += "$ [python] nightlyBuild.py\n"
|
||||
Usage += " option & argument : comment on option if any | default value\n"
|
||||
Usage += " ------------------------------------------------------------------------+--------------\n"
|
||||
Usage += " [--qt <type>] : 5='qt5', 6='qt6' (migration to Qt6 is ongoing) | 5\n"
|
||||
Usage += " [--target <list>] : 0='std', 1='ports', 2='brew', 3='brewHW', 4='ana3', | '%s'\n" % targetopt
|
||||
Usage += " 5='brewA', 6='brewAHW' | \n"
|
||||
Usage += " * with --qt=6, use --target='2,3' (4 is ignored) | \n"
|
||||
Usage += " [--build] : build and deploy | disabled\n"
|
||||
Usage += " [--pymod] : build and deploy Pymod, too | disabled\n"
|
||||
Usage += " [--test] : run the QA Test | disabled\n"
|
||||
|
|
@ -216,11 +233,15 @@ def Parse_CommandLine_Arguments():
|
|||
Usage += " (3) $ ./nightlyBuild.py --test | \n"
|
||||
Usage += " (4) $ ./nightlyBuild.py --check (confirm the QA Test results) | \n"
|
||||
Usage += " (5) $ ./nightlyBuild.py --makedmg 1 | \n"
|
||||
Usage += " (6) $ ./nightlyBuild.py --upload '0.27.10' | \n"
|
||||
Usage += " (6) $ ./nightlyBuild.py --upload '0.27.11' | \n"
|
||||
Usage += " (7) $ ./nightlyBuild.py --cleandmg 1 | \n"
|
||||
Usage += "---------------------------------------------------------------------------+----------------------\n"
|
||||
|
||||
p = optparse.OptionParser( usage=Usage )
|
||||
p.add_option( '--qt',
|
||||
dest='qt_type',
|
||||
help='Qt5 or Qt6 (5)' )
|
||||
|
||||
p.add_option( '--target',
|
||||
dest='targets',
|
||||
help='build target list' )
|
||||
|
|
@ -267,7 +288,8 @@ def Parse_CommandLine_Arguments():
|
|||
default=False,
|
||||
help='check usage' )
|
||||
|
||||
p.set_defaults( targets = "%s" % targetopt,
|
||||
p.set_defaults( qt_type = "5",
|
||||
targets = "%s" % targetopt,
|
||||
build = False,
|
||||
with_pymod = False,
|
||||
qa_test = False,
|
||||
|
|
@ -288,6 +310,12 @@ def Parse_CommandLine_Arguments():
|
|||
print(Usage)
|
||||
quit()
|
||||
|
||||
QtType = int(opt.qt_type)
|
||||
if not QtType in [5, 6]:
|
||||
print( "! Invalid Qt type <%d>" % QtType )
|
||||
print(Usage)
|
||||
quit()
|
||||
|
||||
targetDic = Get_Build_Target_Dict()
|
||||
Target = list()
|
||||
for idx in sorted( list( set( [ int(item) for item in opt.targets.split(",") ] ) ) ):
|
||||
|
|
@ -332,6 +360,9 @@ def Build_Deploy():
|
|||
buildOp = Get_Build_Options( Get_Build_Target_Dict() )
|
||||
|
||||
for key in Target:
|
||||
if key == 4 and QtType == 6: # anaconda3 does not provide Qt6 so far
|
||||
continue
|
||||
|
||||
command1 = [ pyBuilder ] + buildOp[key]
|
||||
if key in [ "std", "brewHW", "brewAHW" ] :
|
||||
command2 = [ pyBuilder ] + buildOp[key] + ['-y']
|
||||
|
|
@ -380,6 +411,9 @@ def Run_QATest( exclude ):
|
|||
dirQAT = Get_QAT_Directory( Get_Build_Target_Dict(), myPlatform )
|
||||
|
||||
for key in Target:
|
||||
if key == 4 and QtType == 6: # anaconda3 does not provide Qt6 so far
|
||||
continue
|
||||
|
||||
command1 = [ pyRunnerQAT ] + [ '--run', '--exclude', '%s' % exclude ]
|
||||
print( dirQAT[key], command1 )
|
||||
#continue
|
||||
|
|
@ -412,6 +446,9 @@ def Check_QATest_Results( lines ):
|
|||
dirQAT = Get_QAT_Directory( Get_Build_Target_Dict(), myPlatform )
|
||||
|
||||
for key in Target:
|
||||
if key == 4 and QtType == 6: # anaconda3 does not provide Qt6 so far
|
||||
continue
|
||||
|
||||
os.chdir( dirQAT[key] )
|
||||
logfile = glob.glob( "*.log" )
|
||||
command1 = [ tailCommand ] + [ '-n', '%d' % lines ] + logfile
|
||||
|
|
@ -450,6 +487,9 @@ def DMG_Make( srlDMG ):
|
|||
os.mkdir( stashDMG )
|
||||
|
||||
for key in Target:
|
||||
if key == 4 and QtType == 6: # anaconda3 does not provide Qt6 so far
|
||||
continue
|
||||
|
||||
command1 = [ pyDMGmaker ] + packOp[key]
|
||||
print(command1)
|
||||
#continue
|
||||
|
|
@ -487,6 +527,9 @@ def DMG_Clean( srlDMG ):
|
|||
shutil.rmtree( stashDMG )
|
||||
|
||||
for key in Target:
|
||||
if key == 4 and QtType == 6: # anaconda3 does not provide Qt6 so far
|
||||
continue
|
||||
|
||||
command1 = [ pyDMGmaker ] + packOp[key]
|
||||
print(command1)
|
||||
#continue
|
||||
|
|
|
|||
Loading…
Reference in New Issue