mirror of https://github.com/KLayout/klayout.git
Merge branch 'merge-pr564'
This commit is contained in:
commit
3107138561
|
|
@ -1,4 +1,4 @@
|
|||
Relevant KLayout version: 0.26.4
|
||||
Relevant KLayout version: 0.26.5
|
||||
|
||||
# 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:
|
||||
|
|
@ -26,6 +26,11 @@ Alternatively, you can use "Qt5" from Homebrew (https://brew.sh/) which is usual
|
|||
$HOME/opt/anaconda3/pkgs/qt-{version}
|
||||
```
|
||||
|
||||
If you have installed Anaconda3 under $HOME/opt/anaconda3/, make a symbolic link:
|
||||
```
|
||||
/Applications/anaconda3/ ---> $HOME/opt/anaconda3/
|
||||
```
|
||||
|
||||
# 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.<br>
|
||||
As for Catalina (10.15),
|
||||
|
|
@ -220,8 +225,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:<br>
|
||||
* **`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
|
||||
* **`ST-klayout-0.26.5-macOS-Catalina-1-qt5MP-RsysPsys.dmg`** ---(1) the main DMG file
|
||||
* **`ST-klayout-0.26.5-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>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -3,19 +3,20 @@
|
|||
* Template File:
|
||||
* macbuild/Resources/template-KLayoutDMG.applescript
|
||||
*
|
||||
* On the runtime, "makeDMG4mac.py" will generate the actual AppleScrip File:
|
||||
* On the runtime, "makeDMG4mac.py" will generate the actual AppleScrip File
|
||||
* "macbuild/Resources/KLayoutDMG.applescript"
|
||||
* from this template. Hence, the generated actual scrip file does not need
|
||||
* to be version controlled by Git.
|
||||
*
|
||||
* Description:
|
||||
* A template AppleScript to make a fancy DMG installer of KLayout
|
||||
* (http://www.klayout.de/index.php) bundles.
|
||||
* This is a template AppleScript to make a fancy DMG installer of KLayout
|
||||
* (http://www.klayout.de/index.php) application bundles.
|
||||
* "makeDMG4mac.py" will read this template and generate the actual AppleScript to execute.
|
||||
* Values to be found and replaced by "makeDMG4mac.py" are marked by ${KEYWORD}.
|
||||
* Those values to be found and replaced by "makeDMG4mac.py" are marked by ${KEYWORD} in this
|
||||
* template file.
|
||||
*
|
||||
* The background image was designed using Logoist3 (http://www.syniumsoftware.com/en/logoist)
|
||||
* and exported to a PNG file of 1000 x 500 pix size.
|
||||
* The background PNG image file (1000 x 500 pix size) was designed by using Logoist3
|
||||
* (http://www.syniumsoftware.com/en/logoist).
|
||||
*-----------------------------------------------------------------------------------------------
|
||||
* This is a derivative work of Ref. 2) below. Refer to "macbuild/LICENSE" file.
|
||||
* Ref.
|
||||
|
|
@ -65,14 +66,16 @@ on run (volumeName) -- most likely, the volume name is "KLayout"
|
|||
set arrangement to not arranged
|
||||
end tell
|
||||
|
||||
-- [6] Set the background PNG image (1000 x 700 pix) file name stored
|
||||
-- [6] Set the background PNG image file name stored
|
||||
set background picture of opts to file ".background:${BACKGROUND_PNG_FILE}"
|
||||
|
||||
-- [7] Set positions of each icon
|
||||
-- ITEM_1 = klayout.app {860, 165}
|
||||
-- ITEM_2 = Applications {860, 345}
|
||||
-- ITEM_3 = AUX. holder {700, 450}
|
||||
set position of item "${ITEM_1}" to {${X1}, ${Y1}}
|
||||
set position of item "${ITEM_2}" to {${X2}, ${Y2}}
|
||||
${ITEM_3}
|
||||
|
||||
-- [8] Update the contents of container
|
||||
close
|
||||
|
|
|
|||
|
|
@ -42,11 +42,12 @@ Qt5Brew = { 'qmake' : '/usr/local/opt/qt/bin/qmake',
|
|||
'deploy': '/usr/local/opt/qt/bin/macdeployqt'
|
||||
}
|
||||
|
||||
# Qt5 bundled with anaconda3 installed under $HOME/opt/anaconda3/
|
||||
# installed by the standard installation package
|
||||
# Qt5 bundled with anaconda3 installed under /Applications/anaconda3/
|
||||
# The standard installation deploys the tool under $HOME/opt/anaconda3/.
|
||||
# If so, you need to make a symbolic link: /Applications/anaconda3 ---> $HOME/opt/anaconda3/
|
||||
# [Key Type Name] = 'Qt5Ana3'
|
||||
Qt5Ana3 = { 'qmake' : '%s/opt/anaconda3/bin/qmake' % MyHome,
|
||||
'deploy': '%s/opt/anaconda3/bin/macdeployqt' % MyHome
|
||||
Qt5Ana3 = { 'qmake' : '/Applications/anaconda3/bin/qmake',
|
||||
'deploy': '/Applications/anaconda3/bin/macdeployqt'
|
||||
}
|
||||
|
||||
#-----------------------------------------------------
|
||||
|
|
@ -126,12 +127,13 @@ Ruby27Brew = { 'exe': '%s/bin/ruby' % HBRuby27Path,
|
|||
'lib': '%s/lib/libruby.2.7.dylib' % HBRuby27Path
|
||||
}
|
||||
|
||||
# Ruby 2.5 bundled with anaconda3 installed under $HOME/opt/anaconda3/ *+*+*+ EXPERIMENTAL *+*+*+
|
||||
# install with 'conda install ruby'
|
||||
# Ruby 2.5 bundled with anaconda3 installed under /Applications/anaconda3/ *+*+*+ EXPERIMENTAL *+*+*+
|
||||
# The standard installation deploys the tool under $HOME/opt/anaconda3/.
|
||||
# If so, you need to make a symbolic link: /Applications/anaconda3 ---> $HOME/opt/anaconda3/
|
||||
# [Key Type Name] = 'Ana3'
|
||||
RubyAnaconda3 = { 'exe': '%s/opt/anaconda3/bin/ruby' % MyHome,
|
||||
'inc': '%s/opt/anaconda3/include/ruby-2.5.0' % MyHome,
|
||||
'lib': '%s/opt/anaconda3/lib/libruby.2.5.1.dylib' % MyHome
|
||||
RubyAnaconda3 = { 'exe': '/Applications/anaconda3/bin/ruby',
|
||||
'inc': '/Applications/anaconda3/include/ruby-2.5.0',
|
||||
'lib': '/Applications/anaconda3/lib/libruby.2.5.1.dylib'
|
||||
}
|
||||
|
||||
# Consolidated dictionary kit for Ruby
|
||||
|
|
@ -219,12 +221,13 @@ Python37Brew = { 'exe': '%s/Versions/3.7/bin/python3.7m' % HBPython37Framewor
|
|||
'lib': '%s/Versions/3.7/lib/libpython3.7m.dylib' % HBPython37FrameworkPath
|
||||
}
|
||||
|
||||
# Python 3.7 bundled with anaconda3 installed under $HOME/opt/anaconda3/ *+*+*+ EXPERIMENTAL *+*+*+
|
||||
# installed by the standard installation package
|
||||
# Python 3.7 bundled with anaconda3 installed under /Applications/anaconda3/ *+*+*+ EXPERIMENTAL *+*+*+
|
||||
# The standard installation deploys the tool under $HOME/opt/anaconda3/.
|
||||
# If so, you need to make a symbolic link: /Applications/anaconda3 ---> $HOME/opt/anaconda3/
|
||||
# [Key Type Name] = 'Ana3'
|
||||
PythonAnaconda3 = { 'exe': '%s/opt/anaconda3/bin/python3.7m' % MyHome,
|
||||
'inc': '%s/opt/anaconda3/include/python3.7m' % MyHome,
|
||||
'lib': '%s/opt/anaconda3/lib/libpython3.7m.dylib' % MyHome
|
||||
PythonAnaconda3 = { 'exe': '/Applications/anaconda3/bin/python3.7m',
|
||||
'inc': '/Applications/anaconda3/include/python3.7m',
|
||||
'lib': '/Applications/anaconda3/lib/libpython3.7m.dylib'
|
||||
}
|
||||
|
||||
# Consolidated dictionary kit for Python
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import sys
|
|||
import os
|
||||
import re
|
||||
import shutil
|
||||
import zipfile
|
||||
import glob
|
||||
import platform
|
||||
import optparse
|
||||
|
|
@ -47,7 +48,7 @@ def SetGlobals():
|
|||
global PackagePrefix # the package prefix: 'ST-', 'LW-', 'HW-', or 'EX-'
|
||||
global QtIdentification # Qt identification
|
||||
global RubyPythonID # Ruby- and Python-identification
|
||||
global Version # KLayout's version
|
||||
global KLVersion # KLayout's version
|
||||
global OccupiedDS # approx. occupied disc space
|
||||
global BackgroundPNG # the background PNG image file
|
||||
global VolumeIcons # the volume icon file
|
||||
|
|
@ -56,6 +57,10 @@ def SetGlobals():
|
|||
global VolumeDMG # the volume name of DMG
|
||||
global TargetDMG # the name of target DMG file
|
||||
global RootApplications # reserved directory name for applications
|
||||
global CatalinaAnaconda3 # True if 'Catalina with Anaconda3'
|
||||
global CatalinaHomebrew # True if 'Catalina with Homebrew'
|
||||
global DicLightWeight # dictionary for LW-* packages
|
||||
global Item3AppleScript # ITEM_3 in the Apple script
|
||||
# auxiliary variables on platform
|
||||
global System # 6-tuple from platform.uname()
|
||||
global Node # - do -
|
||||
|
|
@ -130,7 +135,7 @@ def SetGlobals():
|
|||
PackagePrefix = ""
|
||||
QtIdentification = ""
|
||||
RubyPythonID = ""
|
||||
Version = GetKLayoutVersionFrom( "./version.sh" )
|
||||
KLVersion = GetKLayoutVersionFrom( "./version.sh" )
|
||||
OccupiedDS = -1
|
||||
BackgroundPNG = "KLayoutDMG-Back.png"
|
||||
VolumeIcons = "KLayoutHDD.icns"
|
||||
|
|
@ -139,6 +144,21 @@ def SetGlobals():
|
|||
VolumeDMG = "KLayout"
|
||||
TargetDMG = ""
|
||||
RootApplications = "/Applications"
|
||||
CatalinaAnaconda3 = False
|
||||
CatalinaHomebrew = False
|
||||
DicLightWeight = dict()
|
||||
Item3AppleScript = ""
|
||||
# Populate DicLightWeight
|
||||
DicLightWeight[ "ana3" ] = dict()
|
||||
DicLightWeight[ "brew" ] = dict()
|
||||
DicLightWeight[ "ana3" ]["zip"] = "macbuild/Resources/script-bundle-A.zip"
|
||||
DicLightWeight[ "ana3" ]["src"] = "script-bundle-A"
|
||||
DicLightWeight[ "ana3" ]["des"] = "Anaconda3User-ReadMeFirst"
|
||||
DicLightWeight[ "ana3" ]["item3"] = 'set position of item "Anaconda3User-ReadMeFirst" to {700, 400}'
|
||||
DicLightWeight[ "brew" ]["zip"] = "macbuild/Resources/script-bundle-B.zip"
|
||||
DicLightWeight[ "brew" ]["src"] = "script-bundle-B"
|
||||
DicLightWeight[ "brew" ]["des"] = "HomebrewUser-ReadMeFirst"
|
||||
DicLightWeight[ "brew" ]["item3"] = 'set position of item "HomebrewUser-ReadMeFirst" to {700, 400}'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
## To check the contents of the package directory
|
||||
|
|
@ -156,11 +176,18 @@ def SetGlobals():
|
|||
# on failure, -1
|
||||
#------------------------------------------------------------------------------
|
||||
def CheckPkgDirectory():
|
||||
global Platform
|
||||
global OpClean
|
||||
global OpMake
|
||||
global DefaultBundleName
|
||||
global BundleName
|
||||
global PackagePrefix
|
||||
global QtIdentification
|
||||
global RubyPythonID
|
||||
global CatalinaAnaconda3
|
||||
global CatalinaHomebrew
|
||||
global DicLightWeight
|
||||
global Item3AppleScript
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# [1] Check the contents of the package directory
|
||||
|
|
@ -175,30 +202,12 @@ def CheckPkgDirectory():
|
|||
print( "" )
|
||||
return -1
|
||||
|
||||
os.chdir(PkgDir)
|
||||
if not os.path.isdir( DefaultBundleName ):
|
||||
print( "! The package directory <%s> does not hold <%s> bundle" % (PkgDir, DefaultBundleName), file=sys.stderr )
|
||||
print( "" )
|
||||
os.chdir(ProjectDir)
|
||||
return -1
|
||||
|
||||
command = "\du -sm %s" % DefaultBundleName
|
||||
sizeApp = int( os.popen(command).read().strip("\n").split("\t")[0] )
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# [2] Change the application bundle name on demand
|
||||
#-----------------------------------------------------------------------------
|
||||
if BundleName == "":
|
||||
BundleName = DefaultBundleName
|
||||
else:
|
||||
os.rename( DefaultBundleName, BundleName )
|
||||
os.chdir(ProjectDir)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# [3] Identify (Qt, Ruby, Python)
|
||||
# [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-Rhb27Phb37
|
||||
# * HW-qt5Brew.pkg.macos-Catalina-release-RsysPhb37
|
||||
# * EX-qt5MP.pkg.macos-Catalina-release-Rmp26Pmp37
|
||||
#-----------------------------------------------------------------------------
|
||||
|
|
@ -213,7 +222,73 @@ def CheckPkgDirectory():
|
|||
PackagePrefix = pkgdirComponents[0]
|
||||
QtIdentification = pkgdirComponents[2]
|
||||
RubyPythonID = pkgdirComponents[5]
|
||||
return sizeApp
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# [3] Check if Catalina with Anaconda3 / Homebrew
|
||||
#-----------------------------------------------------------------------------
|
||||
CatalinaAnaconda3 = Platform == "Catalina"
|
||||
CatalinaAnaconda3 &= PackagePrefix == "LW"
|
||||
CatalinaAnaconda3 &= QtIdentification == "qt5Ana3"
|
||||
CatalinaAnaconda3 &= RubyPythonID == "Rana3Pana3"
|
||||
|
||||
CatalinaHomebrew = Platform == "Catalina"
|
||||
CatalinaHomebrew &= PackagePrefix == "LW"
|
||||
CatalinaHomebrew &= QtIdentification == "qt5Brew"
|
||||
CatalinaHomebrew &= RubyPythonID == "Rhb27Phb37"
|
||||
|
||||
if CatalinaAnaconda3:
|
||||
mydic = DicLightWeight["ana3"]
|
||||
srcDir = PkgDir + "/" + mydic["src"]
|
||||
desDir = PkgDir + "/" + mydic["des"]
|
||||
if OpMake:
|
||||
with zipfile.ZipFile( mydic["zip"], 'r' ) as zip_ref:
|
||||
zip_ref.extractall(PkgDir)
|
||||
os.rename( srcDir, desDir )
|
||||
if OpClean:
|
||||
if os.path.isdir(srcDir):
|
||||
shutil.rmtree(srcDir)
|
||||
if os.path.isdir(desDir):
|
||||
shutil.rmtree(desDir)
|
||||
Item3AppleScript = mydic["item3"]
|
||||
|
||||
if CatalinaHomebrew:
|
||||
mydic = DicLightWeight["brew"]
|
||||
srcDir = PkgDir + "/" + mydic["src"]
|
||||
desDir = PkgDir + "/" + mydic["des"]
|
||||
if OpMake:
|
||||
with zipfile.ZipFile( mydic["zip"], 'r' ) as zip_ref:
|
||||
zip_ref.extractall(PkgDir)
|
||||
os.rename( srcDir, desDir )
|
||||
if OpClean:
|
||||
if os.path.isdir(srcDir):
|
||||
shutil.rmtree(srcDir)
|
||||
if os.path.isdir(desDir):
|
||||
shutil.rmtree(desDir)
|
||||
Item3AppleScript = mydic["item3"]
|
||||
|
||||
#------------------------------------------------------
|
||||
# [4] Check the presence of the default bundle
|
||||
#------------------------------------------------------
|
||||
os.chdir(PkgDir)
|
||||
if not os.path.isdir( DefaultBundleName ):
|
||||
print( "! The package directory <%s> does not hold <%s> bundle" % (PkgDir, DefaultBundleName), file=sys.stderr )
|
||||
print( "" )
|
||||
os.chdir(ProjectDir)
|
||||
return -1
|
||||
|
||||
#------------------------------------------------------
|
||||
# [5] Check the occupied disk space
|
||||
#------------------------------------------------------
|
||||
command = "\du -sm %s" % DefaultBundleName
|
||||
sizeApp = int( os.popen(command).read().strip("\n").split("\t")[0] )
|
||||
|
||||
#------------------------------------------------------
|
||||
# [6] Change the application bundle name if required
|
||||
#------------------------------------------------------
|
||||
if OpMake and BundleName != "" and BundleName != DefaultBundleName:
|
||||
os.rename( DefaultBundleName, BundleName )
|
||||
os.chdir(ProjectDir)
|
||||
return sizeApp
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
## To get command line parameters
|
||||
|
|
@ -231,7 +306,7 @@ def ParseCommandLineArguments():
|
|||
global PackagePrefix
|
||||
global QtIdentification
|
||||
global RubyPythonID
|
||||
global Version
|
||||
global KLVersion
|
||||
global OccupiedDS
|
||||
global TargetDMG
|
||||
|
||||
|
|
@ -290,7 +365,7 @@ def ParseCommandLineArguments():
|
|||
base, ext = os.path.splitext( os.path.basename(opt.bundle_name) )
|
||||
BundleName = base + ".app"
|
||||
else:
|
||||
BundleName = ""
|
||||
BundleName = DefaultBundleName
|
||||
|
||||
if (OpClean and OpMake) or (not OpClean and not OpMake):
|
||||
print( "! Specify <-c|--clean> OR <-m|--make>", file=sys.stderr )
|
||||
|
|
@ -307,7 +382,7 @@ def ParseCommandLineArguments():
|
|||
quit()
|
||||
else:
|
||||
TargetDMG = "%s-klayout-%s-%s-%s-%d-%s-%s.dmg" \
|
||||
% (PackagePrefix, Version, GenOSName, Platform, DMGSerialNum, QtIdentification, RubyPythonID)
|
||||
% (PackagePrefix, KLVersion, GenOSName, Platform, DMGSerialNum, QtIdentification, RubyPythonID)
|
||||
return
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
|
@ -364,6 +439,7 @@ def MakeTargetDMGFile(msg=""):
|
|||
BACKGROUND_PNG_FILE=BackgroundPNG,
|
||||
ITEM_1='%s' % BundleName, X1='860', Y1='165',
|
||||
ITEM_2='Applications', X2='860', Y2='345',
|
||||
ITEM_3=Item3AppleScript,
|
||||
CHECK_BASH='[ -f " & dotDSStore & " ]; echo $?'
|
||||
)
|
||||
try:
|
||||
|
|
@ -523,10 +599,10 @@ def MakeTargetDMGFile(msg=""):
|
|||
print( " generated MD5 checksum file <%s>" % md5TargetDMG )
|
||||
print( "" )
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# [3] Rename the application bundle if required
|
||||
#-------------------------------------------------------------
|
||||
if not BundleName == DefaultBundleName:
|
||||
#-------------------------------------------------------------------------
|
||||
# [3] Rename back the application bundle to the default name if required
|
||||
#-------------------------------------------------------------------------
|
||||
if BundleName != "" and BundleName != DefaultBundleName:
|
||||
dirPresent = "%s/%s" % (PkgDir, BundleName)
|
||||
dirDefault = "%s/%s" % (PkgDir, DefaultBundleName)
|
||||
os.rename( dirPresent, dirDefault )
|
||||
|
|
|
|||
Loading…
Reference in New Issue