Skip to content

Commit ccae17f

Browse files
Merge pull request #1979 from Kazzz-S/0.29.11-mac1
Using the Ruby 3.4 from Homebrew
2 parents 71a943a + f40758b commit ccae17f

File tree

6 files changed

+69
-69
lines changed

6 files changed

+69
-69
lines changed

macbuild/ReadMe.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Relevant KLayout version: 0.29.7<br>
1+
Relevant KLayout version: 0.29.11<br>
22
Author: Kazzz-S<br>
3-
Last modified: 2024-09-23<br>
3+
Last modified: 2025-01-19<br>
44

55
# 1. Introduction
6-
This directory **`macbuild`** contains various files required for building KLayout (http://www.klayout.de/) version 0.29.7 or later for different 64-bit macOS, including:
6+
This directory **`macbuild`** contains various files required for building KLayout (http://www.klayout.de/) version 0.29.11 or later for different 64-bit macOS, including:
77
* Sonoma (14.x) : the primary development environment
88
* Ventura (13.x) : experimental
99
* Sequoia (15.x) : -- ditto --
@@ -19,7 +19,7 @@ Pre-built DMG packages are also not provided.<br>
1919
* El Capitan (10.11)
2020

2121
Throughout this document, the primary target machine is **Intel x86_64** with **macOS Sonoma**.<br>
22-
All Apple (M1|M2|M3) chips are still untested, as the author does not own an (M1|M2|M3) Mac.<br>
22+
All Apple (M1|M2|M3|M4) chips are still untested, as the author does not own an (M1|M2|M3|M4) Mac.<br>
2323
However, some kind volunteers told me they successfully built on an Apple silicon machine.<br>
2424

2525
# 2. Qt Frameworks
@@ -70,7 +70,7 @@ The operating system type is detected automatically.
7070
```
7171
-----------------------------------------------------------------------------------------------------------
7272
<< Usage of 'build4mac.py' >>
73-
for building KLayout 0.29.7 or later on different Apple macOS platforms.
73+
for building KLayout 0.29.11 or later on different Apple macOS platforms.
7474
7575
$ [python] ./build4mac.py
7676
option & argument : descriptions (refer to 'macbuild/build4mac_env.py' for details) | default value
@@ -83,11 +83,11 @@ $ [python] ./build4mac.py
8383
: Qt6MacPorts: use Qt6 from MacPorts (*) |
8484
: Qt6Brew: use Qt6 from Homebrew (*) |
8585
: (*) migration to Qt6 is ongoing |
86-
[-r|--ruby <type>] : case-insensitive type=['nil', 'Sys', 'MP33', 'HB33', 'Ana3'] | sys
86+
[-r|--ruby <type>] : case-insensitive type=['nil', 'Sys', 'MP33', 'HB34', 'Ana3'] | sys
8787
: nil: don't bind Ruby |
8888
: Sys: use [Sequoia|Sonoma|Ventura|Monterey]-bundled Ruby 2.6 |
8989
: MP33: use Ruby 3.3 from MacPorts |
90-
: HB33: use Ruby 3.3 from Homebrew |
90+
: HB34: use Ruby 3.4 from Homebrew |
9191
: Ana3: use Ruby 3.2 from Anaconda3 |
9292
[-p|--python <type>] : case-insensitive type=['nil', 'Sys', 'MP312', 'HB312', 'Ana3', | sys
9393
: 'MP311', 'HB311', 'HBAuto'] |
@@ -195,10 +195,10 @@ $ ./build4mac.py -q qt5macports -r mp33 -p mp312 -Y
195195
> [!IMPORTANT]
196196
> To build KLayout >= 0.29.0, you need "Qt6" >= 6.7.0 to address [the compilation issue](https://github.com/KLayout/klayout/issues/1599).<br>
197197
198-
0. Install Homebrew, then install Qt6, Ruby 3.3, Python 3.12, and libgit2 by
198+
0. Install Homebrew, then install Qt6, Ruby 3.4, Python 3.12, and libgit2 by
199199
```
200200
$ brew install qt@6
201-
$ brew install ruby@3.3
201+
$ brew install ruby@3.4
202202
$ brew install [email protected]
203203
$ brew install libgit2
204204
$ cd /where/'build.sh'/exists
@@ -208,20 +208,20 @@ $ ./python3HB.py -v 3.12
208208
1. Invoke **`build4mac.py`** with the following options:
209209
```
210210
$ cd /where/'build.sh'/exists
211-
$ ./build4mac.py -q qt6brew -r hb33 -p hb312
211+
$ ./build4mac.py -q qt6brew -r hb34 -p hb312
212212
```
213213
2. Confirm successful build (it will take about one hour, depending on your machine spec).
214214
3. Rerun **`build4mac.py`** with the same options used in 1. PLUS "-Y" to deploy executables and libraries under **`klayout.app`** bundle.<br>
215215
The buddy command-line tools (strm*) will also be deployed under **klayout.app/Contents/Buddy/** in this step.<br>
216216

217217
```
218-
$ ./build4mac.py -q qt6brew -r hb33 -p hb312 -Y
218+
$ ./build4mac.py -q qt6brew -r hb34 -p hb312 -Y
219219
```
220220
The application bundle **`klayout.app`** is located under:<br>
221-
**`LW-qt6Brew.pkg.macos-Sonoma-release-Rhb33Phb312`** directory, where
221+
**`LW-qt6Brew.pkg.macos-Sonoma-release-Rhb34Phb312`** directory, where
222222
* "LW-" means this is a lightweight package.
223223
* "qt6Brew" means that Qt6 from Homebrew is used.
224-
* "Rhb33Phb312" means that Ruby is 3.3 from Homebrew; Python is 3.12 from Homebrew.
224+
* "Rhb34Phb312" means that Ruby is 3.4 from Homebrew; Python is 3.12 from Homebrew.
225225
4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation.
226226

227227
> [!WARNING]
@@ -397,8 +397,8 @@ $ cd /where/'build.sh'/exists
397397
$ ./makeDMG4mac.py -p LW-qt5MP.pkg.macos-Sonoma-release-Rmp33Pmp312 -m
398398
```
399399
This command will generate the two files below:<br>
400-
* **`LW-klayout-0.29.7-macOS-Sonoma-1-qt5MP-Rmp33Pmp312.dmg`** ---(1) the main DMG file
401-
* **`LW-klayout-0.29.7-macOS-Sonoma-1-qt5MP-Rmp33Pmp312.dmg.md5`** ---(2) MD5-value text file
400+
* **`LW-klayout-0.29.11-macOS-Sonoma-1-qt5MP-Rmp33Pmp312.dmg`** ---(1) the main DMG file
401+
* **`LW-klayout-0.29.11-macOS-Sonoma-1-qt5MP-Rmp33Pmp312.dmg.md5`** ---(2) MD5-value text file
402402
403403
# Known issues
404404
Because we assume some specific versions of non-OS-standard Ruby and Python, updating Homebrew, MacPorts, or Anaconda3 may cause build- and link errors.<br>
1 Byte
Binary file not shown.

macbuild/build4mac.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# File: "macbuild/build4mac.py"
66
#
77
# The top Python script for building KLayout (http://www.klayout.de/index.php)
8-
# version 0.29.7 or later on different Apple Mac OSX platforms.
8+
# version 0.29.11 or later on different Apple Mac OSX platforms.
99
#===============================================================================
1010
import sys
1111
import os
@@ -45,7 +45,7 @@ def GenerateUsage(platform):
4545
usage = "\n"
4646
usage += "-----------------------------------------------------------------------------------------------------------\n"
4747
usage += "<< Usage of 'build4mac.py' >>\n"
48-
usage += " for building KLayout 0.29.7 or later on different Apple macOS platforms.\n"
48+
usage += " for building KLayout 0.29.11 or later on different Apple macOS platforms.\n"
4949
usage += "\n"
5050
usage += "$ [python] ./build4mac.py\n"
5151
usage += " option & argument : descriptions (refer to 'macbuild/build4mac_env.py' for details) | default value\n"
@@ -58,11 +58,11 @@ def GenerateUsage(platform):
5858
usage += " : Qt6MacPorts: use Qt6 from MacPorts (*) |\n"
5959
usage += " : Qt6Brew: use Qt6 from Homebrew (*) |\n"
6060
usage += " : (*) migration to Qt6 is ongoing |\n"
61-
usage += " [-r|--ruby <type>] : case-insensitive type=['nil', 'Sys', 'MP33', 'HB33', 'Ana3'] | %s\n" % myRuby
61+
usage += " [-r|--ruby <type>] : case-insensitive type=['nil', 'Sys', 'MP33', 'HB34', 'Ana3'] | %s\n" % myRuby
6262
usage += " : nil: don't bind Ruby |\n"
6363
usage += " : Sys: use [Sequoia|Sonoma|Ventura|Monterey]-bundled Ruby 2.6 |\n"
6464
usage += " : MP33: use Ruby 3.3 from MacPorts |\n"
65-
usage += " : HB33: use Ruby 3.3 from Homebrew |\n"
65+
usage += " : HB34: use Ruby 3.4 from Homebrew |\n"
6666
usage += " : Ana3: use Ruby 3.2 from Anaconda3 |\n"
6767
usage += " [-p|--python <type>] : case-insensitive type=['nil', 'Sys', 'MP312', 'HB312', 'Ana3', | %s\n" % myPython
6868
usage += " : 'MP311', 'HB311', 'HBAuto'] |\n"
@@ -271,7 +271,7 @@ def Parse_CLI_Args(config):
271271

272272
p.add_option( '-r', '--ruby',
273273
dest='type_ruby',
274-
help="Ruby type=['nil', 'Sys', 'MP33', 'HB33', 'Ana3']" )
274+
help="Ruby type=['nil', 'Sys', 'MP33', 'HB34', 'Ana3']" )
275275

276276
p.add_option( '-p', '--python',
277277
dest='type_python',
@@ -405,7 +405,7 @@ def Parse_CLI_Args(config):
405405
candidates['NIL'] = 'nil'
406406
candidates['SYS'] = 'Sys'
407407
candidates['MP33'] = 'MP33'
408-
candidates['HB33'] = 'HB33'
408+
candidates['HB34'] = 'HB34'
409409
candidates['ANA3'] = 'Ana3'
410410
try:
411411
choiceRuby = candidates[ opt.type_ruby.upper() ]
@@ -428,8 +428,8 @@ def Parse_CLI_Args(config):
428428
elif choiceRuby == "MP33":
429429
ModuleRuby = 'Ruby33MacPorts'
430430
NonOSStdLang = True
431-
elif choiceRuby == "HB33":
432-
ModuleRuby = 'Ruby33Brew'
431+
elif choiceRuby == "HB34":
432+
ModuleRuby = 'Ruby34Brew'
433433
NonOSStdLang = True
434434
elif choiceRuby == "Ana3":
435435
ModuleRuby = 'RubyAnaconda3'
@@ -730,7 +730,7 @@ def Get_Build_Parameters(config):
730730
# <pymod> will be built if:
731731
# BuildPymodWhl = True
732732
# Platform = [ 'Sequoia', 'Sonoma', 'Ventura', 'Monterey']
733-
# ModuleRuby = [ 'Ruby33MacPorts', 'Ruby33Brew', 'RubyAnaconda3' ]
733+
# ModuleRuby = [ 'Ruby33MacPorts', 'Ruby34Brew', 'RubyAnaconda3' ]
734734
# ModulePython = [ 'Python312MacPorts', 'Python311MacPorts',
735735
# 'Python311Brew',
736736
# 'PythonAnaconda3' ]
@@ -741,7 +741,7 @@ def Get_Build_Parameters(config):
741741

742742
PymodDistDir = dict()
743743
if Platform in [ 'Sequoia', 'Sonoma', 'Ventura', 'Monterey' ]:
744-
if ModuleRuby in [ 'Ruby33MacPorts', 'Ruby33Brew', 'RubyAnaconda3' ]:
744+
if ModuleRuby in [ 'Ruby33MacPorts', 'Ruby34Brew', 'RubyAnaconda3' ]:
745745
if ModulePython in [ 'Python312MacPorts', 'Python311MacPorts' ]:
746746
PymodDistDir[ModulePython] = 'dist-MP3-%s' % ModuleQt
747747
elif ModulePython in [ 'Python311Brew' ]:
@@ -764,7 +764,7 @@ def Build_pymod_wheel(parameters):
764764
# [1] <pymod> will be built if:
765765
# BuildPymodWhl = True
766766
# Platform = [ 'Sequoia', 'Sonoma', 'Ventura', 'Monterey']
767-
# ModuleRuby = [ 'Ruby33MacPorts', 'Ruby33Brew', 'RubyAnaconda3' ]
767+
# ModuleRuby = [ 'Ruby33MacPorts', 'Ruby34Brew', 'RubyAnaconda3' ]
768768
# ModulePython = [ 'Python312MacPorts', 'Python311MacPorts',
769769
# 'Python311Brew',
770770
# 'PythonAnaconda3' ]
@@ -777,7 +777,7 @@ def Build_pymod_wheel(parameters):
777777
return 0
778778
if not Platform in [ 'Sequoia', 'Sonoma', 'Ventura', 'Monterey' ]:
779779
return 0
780-
elif not ModuleRuby in [ 'Ruby33MacPorts', 'Ruby33Brew', 'RubyAnaconda3' ]:
780+
elif not ModuleRuby in [ 'Ruby33MacPorts', 'Ruby34Brew', 'RubyAnaconda3' ]:
781781
return 0
782782
elif not ModulePython in [ 'Python312MacPorts', 'Python311MacPorts', \
783783
'Python311Brew', \
@@ -2158,11 +2158,11 @@ def Deploy_Binaries_For_Bundle(config, parameters):
21582158
#-------------------------------------------------------------
21592159
# [10] Special deployment of Ruby3.3 from Homebrew?
21602160
#-------------------------------------------------------------
2161-
deploymentRuby33HB = (ModuleRuby == 'Ruby33Brew')
2161+
deploymentRuby33HB = (ModuleRuby == 'Ruby34Brew')
21622162
if deploymentRuby33HB and NonOSStdLang:
21632163

21642164
print( "" )
2165-
print( " [10] You have reached optional deployment of Ruby from %s ..." % HBRuby33Path )
2165+
print( " [10] You have reached optional deployment of Ruby from %s ..." % HBRuby34Path )
21662166
print( " [!!!] Sorry, the deployed package will not work properly since deployment of" )
21672167
print( " Ruby3.3 from Homebrew is not yet supported." )
21682168
print( " Since you have Homebrew development environment, there two options:" )

macbuild/build4mac_env.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# Here are dictionaries of ...
88
# different modules for building KLayout (http://www.klayout.de/index.php)
9-
# version 0.29.7 or later on different Apple Mac OSX platforms.
9+
# version 0.29.11 or later on different Apple Mac OSX platforms.
1010
#
1111
# This file is imported by 'build4mac.py' script.
1212
#===============================================================================
@@ -130,7 +130,7 @@
130130
#-----------------------------------------------------
131131
RubyNil = [ 'nil' ]
132132
RubySys = [ 'RubyMonterey', 'RubyVentura', 'RubySonoma', 'RubySequoia' ]
133-
RubyExt = [ 'Ruby33MacPorts', 'Ruby33Brew', 'RubyAnaconda3' ]
133+
RubyExt = [ 'Ruby33MacPorts', 'Ruby34Brew', 'RubyAnaconda3' ]
134134
Rubies = RubyNil + RubySys + RubyExt
135135

136136
#-----------------------------------------------------
@@ -196,13 +196,13 @@
196196
'lib': '/opt/local/lib/libruby.3.3.dylib'
197197
}
198198

199-
# Ruby 3.3 from Homebrew
200-
# install with 'brew install ruby@3.3'
201-
# [Key Type Name] = 'HB33'
202-
HBRuby33Path = '%s/opt/ruby@3.3' % DefaultHomebrewRoot
203-
Ruby33Brew = { 'exe': '%s/bin/ruby' % HBRuby33Path,
204-
'inc': '%s/include/ruby-3.3.0' % HBRuby33Path,
205-
'lib': '%s/lib/libruby.3.3.dylib' % HBRuby33Path
199+
# Ruby 3.4 from Homebrew
200+
# install with 'brew install ruby@3.4'
201+
# [Key Type Name] = 'HB34'
202+
HBRuby34Path = '%s/opt/ruby@3.4' % DefaultHomebrewRoot
203+
Ruby34Brew = { 'exe': '%s/bin/ruby' % HBRuby34Path,
204+
'inc': '%s/include/ruby-3.4.0' % HBRuby34Path,
205+
'lib': '%s/lib/libruby.3.4.dylib' % HBRuby34Path
206206
}
207207

208208
# Ruby 3.2 bundled with anaconda3 installed under /Applications/anaconda3/
@@ -221,7 +221,7 @@
221221
'RubySonoma' : RubySonoma,
222222
'RubySequoia' : RubySequoia,
223223
'Ruby33MacPorts': Ruby33MacPorts,
224-
'Ruby33Brew' : Ruby33Brew,
224+
'Ruby34Brew' : Ruby34Brew,
225225
'RubyAnaconda3' : RubyAnaconda3
226226
}
227227

macbuild/makeDMG4mac.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def SetGlobals():
7878
Usage = "\n"
7979
Usage += "---------------------------------------------------------------------------------------------------------\n"
8080
Usage += "<< Usage of 'makeDMG4mac.py' >>\n"
81-
Usage += " for making a DMG file of KLayout 0.29.7 or later on different Apple macOS platforms.\n"
81+
Usage += " for making a DMG file of KLayout 0.29.11 or later on different Apple macOS platforms.\n"
8282
Usage += "\n"
8383
Usage += "$ [python] ./makeDMG4mac.py\n"
8484
Usage += " option & argument : descriptions | default value\n"
@@ -220,15 +220,15 @@ def SetGlobals():
220220
# The package directory name should look like:
221221
# * ST-qt5MP.pkg.macos-Sonoma-release-RsysPsys
222222
# * LW-qt5Ana3.pkg.macos-Sonoma-release-Rana3Pana3
223-
# * LW-qt6Brew.pkg.macos-Sonoma-release-Rhb33Phb312 --- (1)
223+
# * LW-qt6Brew.pkg.macos-Sonoma-release-Rhb34Phb312 --- (1)
224224
# * LW-qt5MP.pkg.macos-Sonoma-release-Rmp33Pmp312
225225
# * HW-qt6Brew.pkg.macos-Sonoma-release-RsysPhb311
226226
#
227227
# * ST-qt6MP.pkg.macos-Sonoma-release-RsysPsys
228228
# * LW-qt6MP.pkg.macos-Sonoma-release-Rmp33Pmp312
229229
#
230230
# Generated DMG will be, for example,
231-
# (1) ---> LW-klayout-0.29.7-macOS-Sonoma-1-qt6Brew-Rhb33Phb312.dmg
231+
# (1) ---> LW-klayout-0.29.7-macOS-Sonoma-1-qt6Brew-Rhb34Phb312.dmg
232232
#
233233
# @return on success, positive integer in [MB] that tells approx. occupied disc space;
234234
# on failure, -1
@@ -270,10 +270,10 @@ def CheckPkgDirectory():
270270
# [2] Identify (Qt, Ruby, Python) from PkgDir
271271
# * ST-qt5MP.pkg.macos-Sonoma-release-RsysPsys
272272
# * LW-qt5Ana3.pkg.macos-Sonoma-release-Rana3Pana3
273-
# * LW-qt6Brew.pkg.macos-Sonoma-release-Rhb33Phb312
273+
# * LW-qt6Brew.pkg.macos-Sonoma-release-Rhb34Phb312
274274
# * LW-qt5MP.pkg.macos-Sonoma-release-Rmp33Pmp312
275275
# * HW-qt6Brew.pkg.macos-Sonoma-release-RsysPhb311
276-
# * EX-qt5MP.pkg.macos-Sonoma-release-Rhb33Pmp312
276+
# * EX-qt5MP.pkg.macos-Sonoma-release-Rhb34Pmp312
277277
#
278278
# * ST-qt6MP.pkg.macos-Sonoma-release-RsysPsys
279279
# * LW-qt6MP.pkg.macos-Sonoma-release-Rmp33Pmp312
@@ -324,7 +324,7 @@ def CheckPkgDirectory():
324324
LatestOSHomebrew = Platform == LatestOS
325325
LatestOSHomebrew &= PackagePrefix == "LW"
326326
LatestOSHomebrew &= QtIdentification in [ "qt5Brew", "qt6Brew", "qt5MP", "qt6MP" ] # "qt[5|6]MP" are the alternatives
327-
LatestOSHomebrew &= RubyPythonID in [ "Rhb33Phb312", "Rhb33Phb311", "Rhb33Phbauto" ]
327+
LatestOSHomebrew &= RubyPythonID in [ "Rhb34Phb312", "Rhb34Phb311", "Rhb34Phbauto" ]
328328

329329
LatestOSAnaconda3 = Platform == LatestOS
330330
LatestOSAnaconda3 &= PackagePrefix == "LW"

0 commit comments

Comments
 (0)