To test "build4mac.py" family with non-standard script language support like Anaconda.

This refs #4.
This commit is contained in:
Kazunari Sekigawa 2018-01-03 12:53:41 +09:00
parent 0ead95ddf6
commit 91bf2a1eb0
3 changed files with 65 additions and 23 deletions

View File

@ -61,9 +61,10 @@ def SetGlobals():
Usage += " : * key type names below are case insensitive * | \n" Usage += " : * key type names below are case insensitive * | \n"
Usage += " : 'nil' = not to support the script language | \n" Usage += " : 'nil' = not to support the script language | \n"
Usage += " : 'Sys' = using the OS standard script language | \n" Usage += " : 'Sys' = using the OS standard script language | \n"
Usage += " : Refer to 'macbuild/build4mac_env.py' for details| \n"
Usage += " [-q|--qt <type>] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n" Usage += " [-q|--qt <type>] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n"
Usage += " [-r|--ruby <type>] : type=['nil', 'Sys', 'RubySource'] | sys \n" Usage += " [-r|--ruby <type>] : type=['nil', 'Sys', 'Src24', 'MP24'] | sys \n"
Usage += " [-p|--python <type>] : type=['nil', 'Sys', 'Anaconda27', 'Anaconda36'] | sys \n" Usage += " [-p|--python <type>] : type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36'] | sys \n"
Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n" Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n"
Usage += " [-m|--make <option>] : option passed to 'make' | -j4 \n" Usage += " [-m|--make <option>] : option passed to 'make' | -j4 \n"
Usage += " [-d|--debug] : enable debug mode build | disabled \n" Usage += " [-d|--debug] : enable debug mode build | disabled \n"
@ -155,11 +156,11 @@ def ParseCommandLineArguments():
p.add_option( '-r', '--ruby', p.add_option( '-r', '--ruby',
dest='type_ruby', dest='type_ruby',
help="Ruby type=['nil', 'Sys', 'RubySource']" ) help="Ruby type=['nil', 'Sys', 'Src24', 'MP24']" )
p.add_option( '-p', '--python', p.add_option( '-p', '--python',
dest='type_python', dest='type_python',
help="Python type=['nil', 'Sys', 'Anaconda27', 'Anaconda36']" ) help="Python type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36']" )
p.add_option( '-n', '--noqtbinding', p.add_option( '-n', '--noqtbinding',
action='store_true', action='store_true',
@ -231,7 +232,7 @@ def ParseCommandLineArguments():
quit() quit()
# Determine Ruby type # Determine Ruby type
candidates = [ i.upper() for i in ['nil', 'Sys', 'RubySource'] ] candidates = [ i.upper() for i in ['nil', 'Sys', 'Src24', 'MP24'] ]
ModuleRuby = "" ModuleRuby = ""
index = 0 index = 0
for item in candidates: for item in candidates:
@ -253,6 +254,8 @@ def ParseCommandLineArguments():
break break
elif index == 2: elif index == 2:
ModuleRuby = 'Ruby24SrcBuild' ModuleRuby = 'Ruby24SrcBuild'
elif index == 3:
ModuleRuby = 'Ruby24MacPorts'
else: else:
index += 1 index += 1
if ModuleRuby == "": if ModuleRuby == "":
@ -262,7 +265,7 @@ def ParseCommandLineArguments():
quit() quit()
# Determine Python type # Determine Python type
candidates = [ i.upper() for i in ['nil', 'Sys', 'Anaconda27', 'Anaconda36'] ] candidates = [ i.upper() for i in ['nil', 'Sys', 'Ana27', 'Ana36', 'MP36'] ]
ModulePython = "" ModulePython = ""
index = 0 index = 0
for item in candidates: for item in candidates:
@ -286,6 +289,8 @@ def ParseCommandLineArguments():
ModulePython = 'Anaconda27' ModulePython = 'Anaconda27'
elif index == 3: elif index == 3:
ModulePython = 'Anaconda36' ModulePython = 'Anaconda36'
elif index == 4:
ModulePython = 'Python36MacPorts'
else: else:
index += 1 index += 1
if ModulePython == "": if ModulePython == "":
@ -488,7 +493,7 @@ def DeployBinariesForBundle():
print( " [3] Creating the standard directory structure for 'klayout.app' bundle ..." ) print( " [3] Creating the standard directory structure for 'klayout.app' bundle ..." )
#------------------------------------------------------------- #-----------------------------------------------------------------
# [3] Create the directory skeleton for "klayout.app" bundle # [3] Create the directory skeleton for "klayout.app" bundle
# and command line buddy tools such as "strm2cif". # and command line buddy tools such as "strm2cif".
# They are stored in the directory structure below. # They are stored in the directory structure below.
@ -497,8 +502,11 @@ def DeployBinariesForBundle():
# +-- Contents/+ # +-- Contents/+
# +-- Info.plist # +-- Info.plist
# +-- PkgInfo # +-- PkgInfo
# +-- Resources/ # +-- Resources/+
# +-- Frameworks/ # | +-- 'klayout.icns'
# +-- Frameworks/+
# | +-- '*.framework'
# | +-- '*.dylib'
# +-- MacOS/+ # +-- MacOS/+
# | +-- 'klayout' # | +-- 'klayout'
# +-- Buddy/+ # +-- Buddy/+
@ -506,7 +514,7 @@ def DeployBinariesForBundle():
# +-- 'strm2dxf' # +-- 'strm2dxf'
# : # :
# +-- 'strmxor' # +-- 'strmxor'
#------------------------------------------------------------- #-----------------------------------------------------------------
targetDir0 = "%s/klayout.app/Contents" % AbsMacPkgDir targetDir0 = "%s/klayout.app/Contents" % AbsMacPkgDir
targetDirR = targetDir0 + "/Resources" targetDirR = targetDir0 + "/Resources"
targetDirF = targetDir0 + "/Frameworks" targetDirF = targetDir0 + "/Frameworks"
@ -715,23 +723,25 @@ def DeployScriptBundles():
print( " [3] Creating the standard directory structure for the script bundles ..." ) print( " [3] Creating the standard directory structure for the script bundles ..." )
#------------------------------------------------------------- #--------------------------------------------------------------------------------------------
# [3] Create the directory skeleton for the two script bundles. # [3] Create the directory skeleton for the two script bundles.
# #
# klayout.scripts/+ # klayout.scripts/+
# +-- KLayoutEditor.app/+ # +-- KLayoutEditor.app/+
# | +-- Contents/+ # | +-- Contents/+
# | +-- Info.plist # | +-- Info.plist
# | +-- Resources/ # | +-- Resources/+
# | | +-- 'klayout-red.icns'
# | +-- MacOS/+ # | +-- MacOS/+
# | +-- 'KLayoutEditor.sh' # | +-- 'KLayoutEditor.sh'
# +-- KLayoutViewer.app/+ # +-- KLayoutViewer.app/+
# +-- Contents/+ # +-- Contents/+
# +-- Info.plist # +-- Info.plist
# +-- Resources/ # +-- Resources/+
# | +-- 'klayout-blue.icns'
# +-- MacOS/+ # +-- MacOS/+
# +-- 'KLayoutViewer.sh' # +-- 'KLayoutViewer.sh'
#------------------------------------------------------------- #--------------------------------------------------------------------------------------------
os.chdir(ProjectDir) os.chdir(ProjectDir)
targetDir0E = "%s/%s/KLayoutEditor.app/Contents" % ( AbsMacPkgDir, scriptDir ) targetDir0E = "%s/%s/KLayoutEditor.app/Contents" % ( AbsMacPkgDir, scriptDir )
targetDir0V = "%s/%s/KLayoutViewer.app/Contents" % ( AbsMacPkgDir, scriptDir ) targetDir0V = "%s/%s/KLayoutViewer.app/Contents" % ( AbsMacPkgDir, scriptDir )

View File

@ -27,6 +27,7 @@ Qts = [ 'Qt4MacPorts', 'Qt5MacPorts' ]
# Whereabout of different components of Qt4 # Whereabout of different components of Qt4
#----------------------------------------------------- #-----------------------------------------------------
# Qt4 from MacPorts (https://www.macports.org/) # Qt4 from MacPorts (https://www.macports.org/)
# [Key Type Name] = 'Qt4MacPorts'
Qt4MacPorts = { 'qmake' : '/opt/local/libexec/qt4/bin/qmake', Qt4MacPorts = { 'qmake' : '/opt/local/libexec/qt4/bin/qmake',
'deploy': '/opt/local/libexec/qt4/bin/macdeployqt' 'deploy': '/opt/local/libexec/qt4/bin/macdeployqt'
} }
@ -35,6 +36,7 @@ Qt4MacPorts = { 'qmake' : '/opt/local/libexec/qt4/bin/qmake',
# Whereabout of different components of Qt5 # Whereabout of different components of Qt5
#----------------------------------------------------- #-----------------------------------------------------
# Qt5 from MacPorts (https://www.macports.org/) # Qt5 from MacPorts (https://www.macports.org/)
# [Key Type Name] = 'Qt5MacPorts'
Qt5MacPorts = { 'qmake' : '/opt/local/libexec/qt5/bin/qmake', Qt5MacPorts = { 'qmake' : '/opt/local/libexec/qt5/bin/qmake',
'deploy': '/opt/local/libexec/qt5/bin/macdeployqt' 'deploy': '/opt/local/libexec/qt5/bin/macdeployqt'
} }
@ -43,30 +45,34 @@ Qt5MacPorts = { 'qmake' : '/opt/local/libexec/qt5/bin/qmake',
# [2] Ruby # [2] Ruby
#----------------------------------------------------- #-----------------------------------------------------
Rubies = [ 'nil', 'RubyYosemite', 'RubyElCapitan', 'RubySierra', 'RubyHighSierra' ] Rubies = [ 'nil', 'RubyYosemite', 'RubyElCapitan', 'RubySierra', 'RubyHighSierra' ]
Rubies += [ 'Ruby24SrcBuild' ] Rubies += [ 'Ruby24SrcBuild', 'Ruby24MacPorts' ]
#----------------------------------------------------- #-----------------------------------------------------
# Whereabout of different components of Ruby # Whereabout of different components of Ruby
#----------------------------------------------------- #-----------------------------------------------------
# Bundled with Yosemite (10.10) # Bundled with Yosemite (10.10)
# [Key Type Name] = 'Sys'
RubyYosemite = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby' , RubyYosemite = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby' ,
'inc': '/System/Library/Frameworks/Ruby.framework/Headers', 'inc': '/System/Library/Frameworks/Ruby.framework/Headers',
'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib' 'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib'
} }
# Bundled with El Capitan (10.11) # Bundled with El Capitan (10.11)
# [Key Type Name] = 'Sys'
RubyElCapitan = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby' , RubyElCapitan = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby' ,
'inc': '/System/Library/Frameworks/Ruby.framework/Headers', 'inc': '/System/Library/Frameworks/Ruby.framework/Headers',
'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib' 'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib'
} }
# Bundled with Sierra (10.12) # Bundled with Sierra (10.12)
# [Key Type Name] = 'Sys'
RubySierra = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby' , RubySierra = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby' ,
'inc': '/System/Library/Frameworks/Ruby.framework/Headers', 'inc': '/System/Library/Frameworks/Ruby.framework/Headers',
'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib' 'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.dylib'
} }
# Bundled with High Sierra (10.13) # Bundled with High Sierra (10.13)
# [Key Type Name] = 'Sys'
RubyHighSierra = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby' , RubyHighSierra = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby' ,
'inc': '/System/Library/Frameworks/Ruby.framework/Headers', 'inc': '/System/Library/Frameworks/Ruby.framework/Headers',
'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib' 'lib': '/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/libruby.dylib'
@ -74,49 +80,62 @@ RubyHighSierra = { 'exe': '/System/Library/Frameworks/Ruby.framework/Versions/2
# Ruby 2.4 built from source code (https://github.com/ruby): *+*+*+ EXPERIMENTAL *+*+*+ # Ruby 2.4 built from source code (https://github.com/ruby): *+*+*+ EXPERIMENTAL *+*+*+
# configured by: # configured by:
# $ ./configure --prefix=$HOME/Ruby24/ --enable-shared # $ ./configure --prefix=$HOME/Ruby24/ --enable-shared --program-suffix=2.4
Ruby24SrcBuild = { 'exe': '$HOME/Ruby24/bin/ruby', # [Key Type Name] = 'Src24'
Ruby24SrcBuild = { 'exe': '$HOME/Ruby24/bin/ruby2.4',
'inc': '$HOME/Ruby24/include/ruby-2.4.0', 'inc': '$HOME/Ruby24/include/ruby-2.4.0',
'lib': '$HOME/Ruby24/lib/libruby.2.4.dylib' 'lib': '$HOME/Ruby24/lib/libruby.2.4.dylib'
} }
# Ruby 2.4 from MacPorts (https://www.macports.org/) *+*+*+ EXPERIMENTAL *+*+*+
# [Key Type Name] = 'MP24'
Ruby24MacPorts = { 'exe': '/opt/local/bin/ruby2.4',
'inc': '/opt/local/include/ruby-2.4.0',
'lib': '/opt/local/lib/libruby.2.4.dylib'
}
# Consolidated dictionary kit for Ruby # Consolidated dictionary kit for Ruby
RubyDictionary = { 'nil' : None, RubyDictionary = { 'nil' : None,
'RubyYosemite' : RubyYosemite, 'RubyYosemite' : RubyYosemite,
'RubyElCapitan' : RubyElCapitan, 'RubyElCapitan' : RubyElCapitan,
'RubySierra' : RubySierra, 'RubySierra' : RubySierra,
'RubyHighSierra': RubyHighSierra, 'RubyHighSierra': RubyHighSierra,
'Ruby24SrcBuild': Ruby24SrcBuild 'Ruby24SrcBuild': Ruby24SrcBuild,
'Ruby24MacPorts': Ruby24MacPorts
} }
#----------------------------------------------------- #-----------------------------------------------------
# [3] Python # [3] Python
#----------------------------------------------------- #-----------------------------------------------------
Pythons = [ 'nil', 'PythonYosemite', 'PythonElCapitan', 'PythonSierra', 'PythonHighSierra' ] Pythons = [ 'nil', 'PythonYosemite', 'PythonElCapitan', 'PythonSierra', 'PythonHighSierra' ]
Pythons += [ 'Anaconda27', 'Anaconda36' ] Pythons += [ 'Anaconda27', 'Anaconda36', 'Python36MacPorts' ]
#----------------------------------------------------- #-----------------------------------------------------
# Whereabout of different components of Python # Whereabout of different components of Python
#----------------------------------------------------- #-----------------------------------------------------
# Bundled with Yosemite (10.10) # Bundled with Yosemite (10.10)
# [Key Type Name] = 'Sys'
PythonYosemite = { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' , PythonYosemite = { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' ,
'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7', 'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7',
'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib' 'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib'
} }
# Bundled with El Capitan (10.11) # Bundled with El Capitan (10.11)
# [Key Type Name] = 'Sys'
PythonElCapitan = { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' , PythonElCapitan = { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' ,
'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7', 'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7',
'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib' 'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib'
} }
# Bundled with Sierra (10.12) # Bundled with Sierra (10.12)
# [Key Type Name] = 'Sys'
PythonSierra = { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' , PythonSierra = { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' ,
'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7', 'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7',
'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib' 'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib'
} }
# Bundled with High Sierra (10.13) # Bundled with High Sierra (10.13)
# [Key Type Name] = 'Sys'
PythonHighSierra= { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' , PythonHighSierra= { 'exe': '/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python' ,
'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7', 'inc': '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7',
'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib' 'lib': '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib'
@ -127,6 +146,7 @@ PythonHighSierra= { 'exe': '/System/Library/Frameworks/Python.framework/Versions
# and your Python environment was prepared by: $ conda create -n py27klayout python=2.7 # and your Python environment was prepared by: $ conda create -n py27klayout python=2.7
# #
# No additional modules are added in the beginning. # No additional modules are added in the beginning.
# [Key Type Name] = 'Ana27'
Anaconda27 = { 'exe': '$HOME/anaconda/envs/py27klayout/bin/python2.7' , Anaconda27 = { 'exe': '$HOME/anaconda/envs/py27klayout/bin/python2.7' ,
'inc': '$HOME/anaconda/envs/py27klayout/include/python2.7', 'inc': '$HOME/anaconda/envs/py27klayout/include/python2.7',
'lib': '$HOME/anaconda/envs/py27klayout/lib/libpython2.7.dylib' 'lib': '$HOME/anaconda/envs/py27klayout/lib/libpython2.7.dylib'
@ -137,11 +157,19 @@ Anaconda27 = { 'exe': '$HOME/anaconda/envs/py27klayout/bin/python2.7' ,
# and your Python environment was prepared by: $ conda create -n py36klayout python=3.6 # and your Python environment was prepared by: $ conda create -n py36klayout python=3.6
# #
# No additional modules are added in the beginning. # No additional modules are added in the beginning.
# [Key Type Name] = 'Ana36'
Anaconda36 = { 'exe': '$HOME/anaconda/envs/py36klayout/bin/python3.6' , Anaconda36 = { 'exe': '$HOME/anaconda/envs/py36klayout/bin/python3.6' ,
'inc': '$HOME/anaconda/envs/py36klayout/include/python3.6m', 'inc': '$HOME/anaconda/envs/py36klayout/include/python3.6m',
'lib': '$HOME/anaconda/envs/py36klayout/lib/libpython3.6m.dylib' 'lib': '$HOME/anaconda/envs/py36klayout/lib/libpython3.6m.dylib'
} }
# Python 3.6 from MacPorts (https://www.macports.org/) *+*+*+ EXPERIMENTAL *+*+*+
# [Key Type Name] = 'MP36'
Python36MacPorts= { 'exe': '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m' ,
'inc': '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m',
'lib': '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib'
}
# Consolidated dictionary kit for Python # Consolidated dictionary kit for Python
PythonDictionary= { 'nil' : None, PythonDictionary= { 'nil' : None,
'PythonYosemite' : PythonYosemite, 'PythonYosemite' : PythonYosemite,
@ -149,7 +177,8 @@ PythonDictionary= { 'nil' : None,
'PythonSierra' : PythonSierra, 'PythonSierra' : PythonSierra,
'PythonHighSierra': PythonHighSierra, 'PythonHighSierra': PythonHighSierra,
'Anaconda27' : Anaconda27, 'Anaconda27' : Anaconda27,
'Anaconda36' : Anaconda36 'Anaconda36' : Anaconda36,
'Python36MacPorts': Python36MacPorts
} }
#----------------------------------------------------- #-----------------------------------------------------

View File

@ -121,8 +121,11 @@ def SetChangeIdentificationNameOfDyLib( libdic ):
# +-- Contents/+ # +-- Contents/+
# +-- Info.plist # +-- Info.plist
# +-- PkgInfo # +-- PkgInfo
# +-- Resources/ # +-- Resources/+
# +-- Frameworks/ # | +-- 'klayout.icns'
# +-- Frameworks/+
# | +-- '*.framework'
# | +-- '*.dylib'
# +-- MacOS/+ # +-- MacOS/+
# | +-- 'klayout' # | +-- 'klayout'
# +-- Buddy/+ # +-- Buddy/+