From 5bb85c749007abe6669d90f07d949fb22c4e86e9 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Wed, 8 Jan 2020 22:20:55 +0900 Subject: [PATCH 1/2] The command line buddy tools need the symbolic link under Frameworks: 'db_plugins' --slink--> ../MacOS/db_plugins/ --- macbuild/build4mac.py | 30 +++++++++++++++++++++++++++--- macbuild/build4mac_util.py | 3 +++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index 26a6b1b7a..e6d822460 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -632,8 +632,11 @@ def DeployBinariesForBundle(): # +-- Frameworks/+ # | +-- '*.framework' # | +-- '*.dylib' + # | +-- 'db_plugins' --slink--> ../MacOS/db_plugins/ # +-- MacOS/+ # | +-- 'klayout' + # | +-- db_plugins/ + # | +-- lay_plugins/ # +-- Buddy/+ # +-- 'strm2cif' # +-- 'strm2dxf' @@ -714,8 +717,8 @@ def DeployBinariesForBundle(): os.chdir(ProjectDir) #------------------------------------------------------------------- - # copy the contents of the plugin directories to a place next to the application - # binary + # Copy the contents of the plugin directories to a place next to + # the application binary #------------------------------------------------------------------- for piDir in [ "db_plugins", "lay_plugins" ]: os.makedirs( os.path.join( targetDirM, piDir )) @@ -751,13 +754,34 @@ def DeployBinariesForBundle(): exit() ''' + #---------------------------------------------------------------------------------- + # (D) Make a symbolic link + # 'db_plugins' --slink--> ../MacOS/db_plugins/ + # under Frameworks/, which is required for the command line Buddy tools. + # + # Ref. https://github.com/KLayout/klayout/issues/460#issuecomment-571803458 + # + # : + # +-- Frameworks/+ + # | +-- '*.framework' + # | +-- '*.dylib' + # | +-- 'db_plugins' --slink--> ../MacOS/db_plugins/ + # +-- MacOS/+ + # | +-- 'klayout' + # | +-- db_plugins/ + # | +-- lay_plugins/ + # : + #---------------------------------------------------------------------------------- + os.chdir( targetDirF ) + os.symlink( "../MacOS/db_plugins/", "./db_plugins" ) + + print( " [5] Setting and changing the identification names among KLayout's libraries ..." ) #------------------------------------------------------------- # [5] Set the identification names for KLayout's libraries # and make the library aware of the locations of libraries # on which it depends; that is, inter-library dependency #------------------------------------------------------------- - os.chdir( targetDirF ) ret = SetChangeIdentificationNameOfDyLib( depDicOrdinary, pathDic ) if not ret == 0: msg = "!!! Failed to set and change to new identification names !!!" diff --git a/macbuild/build4mac_util.py b/macbuild/build4mac_util.py index 4cd1d8dba..ea682fe21 100755 --- a/macbuild/build4mac_util.py +++ b/macbuild/build4mac_util.py @@ -134,8 +134,11 @@ def SetChangeIdentificationNameOfDyLib( libdic, pathDic ): # +-- Frameworks/+ # | +-- '*.framework' # | +-- '*.dylib' +# | +-- 'db_plugins' --slink--> ../MacOS/db_plugins/ # +-- MacOS/+ # | +-- 'klayout' +# | +-- db_plugins/ +# | +-- lay_plugins/ # +-- Buddy/+ # +-- 'strm2cif' # +-- 'strm2dxf' From 20dd3771086d4d3341c7a638128714575fa1de80 Mon Sep 17 00:00:00 2001 From: Kazunari Sekigawa Date: Sat, 7 Mar 2020 07:30:41 +0900 Subject: [PATCH 2/2] Update the build tools for macOS: * KLayout version 0.26.4 * Homebrew Ruby 2.6 --> 2.7. --- macbuild/ReadMe.md | 20 ++++++++++---------- macbuild/build4mac.py | 16 ++++++++-------- macbuild/build4mac_env.py | 18 +++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/macbuild/ReadMe.md b/macbuild/ReadMe.md index 847d26dd7..1ca45ab36 100644 --- a/macbuild/ReadMe.md +++ b/macbuild/ReadMe.md @@ -1,4 +1,4 @@ -Relevant KLayout version: 0.26.1 +Relevant KLayout version: 0.26.4 # 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: @@ -61,11 +61,11 @@ $ [python] ./build4mac.py : 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 + [-r|--ruby ] : case-insensitive type=['nil', 'Sys', 'MP26', 'HB27', '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 | + : HB27: use Ruby 2.7 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 | @@ -139,22 +139,22 @@ $ ./build4mac.py -q qt5macports -r mp26 -p mp37 -Y * "Rmp26Pmp37" means that Ruby is 2.6 from MacPorts; Python is 3.7 from MacPorts. 4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation. -### 6C. Fully Homebrew-flavored build with Homebrew Ruby 2.6 and Homebrew Python 3.7 +### 6C. Fully Homebrew-flavored build with Homebrew Ruby 2.7 and Homebrew Python 3.7 ``` $ cd /where/'build.sh'/exists -$ ./build4mac.py -q qt5brew -r hb26 -p hb37 +$ ./build4mac.py -q qt5brew -r hb27 -p hb37 ``` 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.
The buddy command-line tools (strm*) will also be deployed in this step. ``` -$ ./build4mac.py -q qt5brew -r hb26 -p hb37 -Y +$ ./build4mac.py -q qt5brew -r hb27 -p hb37 -Y ``` The application bundle **`klayout.app`** is located under:
- **`LW-qt5Brew.pkg.macos-Catalina-release-Rhb26Phb37`** directory, where + **`LW-qt5Brew.pkg.macos-Catalina-release-Rhb27Phb37`** directory, where * "LW-" means that this is a lightweight package. * "qt5Brew" means that Qt5 from Homebrew is used. -* "Rhb26Phb37" means that Ruby is 2.6 from Homebrew; Python is 3.7 from Homebrew. +* "Rhb27Phb37" means that Ruby is 2.7 from Homebrew; Python is 3.7 from Homebrew. 4. Copy/move the generated application bundle **`klayout.app`** to your **`/Applications`** directory for installation. ### 6D. Partially Homebrew-flavored build with System Ruby and Homebrew Python 3.7 @@ -220,8 +220,8 @@ $ cd /where/'build.sh'/exists $ ./makeDMG4mac.py -p ST-qt5MP.pkg.macos-Catalina-release-RsysPsys -m ``` This command will generate the two files below:
-* **`ST-klayout-0.26.1-macOS-Catalina-1-qt5MP-RsysPsys.dmg`** ---(1) the main DMG file -* **`ST-klayout-0.26.1-macOS-Catalina-1-qt5MP-RsysPsys.dmg.md5`** ---(2) MD5-value text file +* **`ST-klayout-0.26.4-macOS-Catalina-1-qt5MP-RsysPsys.dmg`** ---(1) the main DMG file +* **`ST-klayout-0.26.4-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.
diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py index e6d822460..cd9dafe32 100755 --- a/macbuild/build4mac.py +++ b/macbuild/build4mac.py @@ -67,11 +67,11 @@ def SetGlobals(): Usage += " : Qt5MacPorts: use Qt5 from MacPorts | \n" Usage += " : Qt5Brew: use Qt5 from Homebrew | \n" Usage += " : Qt5Ana3: use Qt5 from Anaconda3 | \n" - Usage += " [-r|--ruby ] : case-insensitive type=['nil', 'Sys', 'MP26', 'HB26', 'Ana3'] | sys \n" + Usage += " [-r|--ruby ] : case-insensitive type=['nil', 'Sys', 'MP26', 'HB27', 'Ana3'] | sys \n" Usage += " : nil: don't bind Ruby | \n" Usage += " : Sys: use OS-bundled Ruby [2.0 - 2.6] depending on OS | \n" Usage += " : MP26: use Ruby 2.6 from MacPorts | \n" - Usage += " : HB26: use Ruby 2.6 from Homebrew | \n" + Usage += " : HB27: use Ruby 2.7 from Homebrew | \n" Usage += " : Ana3: use Ruby 2.5 from Anaconda3 | \n" Usage += " [-p|--python ] : case-insensitive type=['nil', 'Sys', 'MP37', 'HB37', 'Ana3'] | sys \n" Usage += " : nil: don't bind Python | \n" @@ -191,7 +191,7 @@ def ParseCommandLineArguments(): p.add_option( '-r', '--ruby', dest='type_ruby', - help="Ruby type=['nil', 'Sys', 'MP26', 'HB26', 'Ana3']" ) + help="Ruby type=['nil', 'Sys', 'MP26', 'HB27', 'Ana3']" ) p.add_option( '-p', '--python', dest='type_python', @@ -289,7 +289,7 @@ def ParseCommandLineArguments(): candidates['NIL'] = 'nil' candidates['SYS'] = 'Sys' candidates['MP26'] = 'MP26' - candidates['HB26'] = 'HB26' + candidates['HB27'] = 'HB27' candidates['ANA3'] = 'Ana3' try: choiceRuby = candidates[ opt.type_ruby.upper() ] @@ -315,8 +315,8 @@ def ParseCommandLineArguments(): elif choiceRuby == "MP26": ModuleRuby = 'Ruby26MacPorts' NonOSStdLang = True - elif choiceRuby == "HB26": - ModuleRuby = 'Ruby26Brew' + elif choiceRuby == "HB27": + ModuleRuby = 'Ruby27Brew' NonOSStdLang = True elif choiceRuby == "Ana3": ModuleRuby = 'RubyAnaconda3' @@ -1008,11 +1008,11 @@ def DeployBinariesForBundle(): #------------------------------------------------------------- # [10] Special deployment of Ruby2.6 from Homebrew? #------------------------------------------------------------- - deploymentRuby26HB = (ModuleRuby == 'Ruby26Brew') + deploymentRuby26HB = (ModuleRuby == 'Ruby27Brew') if deploymentRuby26HB and NonOSStdLang: print( "" ) - print( " [10] You have reached optional deployment of Ruby from %s ..." % HBRuby26Path ) + print( " [10] You have reached optional deployment of Ruby from %s ..." % HBRuby27Path ) print( " [!!!] Sorry, the deployed package will not work properly since deployment of" ) print( " Ruby2.6 from Homebrew is not yet supported." ) print( " Since you have Homebrew development environment, there two options:" ) diff --git a/macbuild/build4mac_env.py b/macbuild/build4mac_env.py index 318168602..621acd1ed 100755 --- a/macbuild/build4mac_env.py +++ b/macbuild/build4mac_env.py @@ -54,7 +54,7 @@ Qt5Ana3 = { 'qmake' : '%s/opt/anaconda3/bin/qmake' % MyHome, #----------------------------------------------------- RubyNil = [ 'nil' ] RubySys = [ 'RubyElCapitan', 'RubySierra', 'RubyHighSierra', 'RubyMojave', 'RubyCatalina' ] -RubyExt = [ 'Ruby26MacPorts', 'Ruby26Brew', 'RubyAnaconda3' ] +RubyExt = [ 'Ruby26MacPorts', 'Ruby27Brew', 'RubyAnaconda3' ] Rubies = RubyNil + RubySys + RubyExt #----------------------------------------------------- @@ -117,13 +117,13 @@ Ruby26MacPorts = { 'exe': '/opt/local/bin/ruby2.6', 'lib': '/opt/local/lib/libruby.2.6.dylib' } -# Ruby 2.6 from Homebrew *+*+*+ EXPERIMENTAL *+*+*+ +# Ruby 2.7 from Homebrew *+*+*+ EXPERIMENTAL *+*+*+ # install with 'brew install ruby' -# [Key Type Name] = 'HB26' -HBRuby26Path = '/usr/local/Cellar/ruby/2.6.5' -Ruby26Brew = { 'exe': '%s/bin/ruby' % HBRuby26Path, - 'inc': '%s/include/ruby-2.6.0' % HBRuby26Path, - 'lib': '%s/lib/libruby.2.6.dylib' % HBRuby26Path +# [Key Type Name] = 'HB27' +HBRuby27Path = '/usr/local/Cellar/ruby/2.7.0' +Ruby27Brew = { 'exe': '%s/bin/ruby' % HBRuby27Path, + 'inc': '%s/include/ruby-2.7.0' % HBRuby27Path, + 'lib': '%s/lib/libruby.2.7.dylib' % HBRuby27Path } # Ruby 2.5 bundled with anaconda3 installed under $HOME/opt/anaconda3/ *+*+*+ EXPERIMENTAL *+*+*+ @@ -143,7 +143,7 @@ RubyDictionary = { 'nil' : None, 'RubyMojave' : RubyMojave, 'RubyCatalina' : RubyCatalina, 'Ruby26MacPorts': Ruby26MacPorts, - 'Ruby26Brew' : Ruby26Brew, + 'Ruby27Brew' : Ruby27Brew, 'RubyAnaconda3' : RubyAnaconda3 } @@ -213,7 +213,7 @@ Python37MacPorts= { 'exe': '/opt/local/Library/Frameworks/Python.framework/Versi # Python 3.7 from Homebrew *+*+*+ EXPERIMENTAL *+*+*+ # install with 'brew install python' # [Key Type Name] = 'HB37' -HBPython37FrameworkPath = '/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework' +HBPython37FrameworkPath = '/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework' Python37Brew = { 'exe': '%s/Versions/3.7/bin/python3.7m' % HBPython37FrameworkPath, 'inc': '%s/Versions/3.7/include/python3.7m' % HBPython37FrameworkPath, 'lib': '%s/Versions/3.7/lib/libpython3.7m.dylib' % HBPython37FrameworkPath