diff --git a/macbuild/ReadMe.txt b/macbuild/ReadMe.txt new file mode 100644 index 000000000..080317a54 --- /dev/null +++ b/macbuild/ReadMe.txt @@ -0,0 +1,25 @@ +<< Draft Version 0.001>> + +This directory "macbuild" contains different files required to build KLayout +version 0.25 or later for different Max OSX including: + * Yosemite (10.10) + * El Capitan (10.11) + * Sierra (10.12) + * High Sierra (10.13) + +By default, Qt framework is Qt5 from Mac Ports (https://www.macports.org/) which +is usually located under: + /opt/local/libexec/qt5/ + +Also by default, supported script languages, i.e,, Ruby and Python, are those +standard ones bundled with the OS. +However, you are able to choose other options like Python from Anaconda. + +bla bla bla ... + + +To use the top script "build4mac.py" make a symbolic link from the parent directory like: + build4mac.py -> macbuild/build4mac.py +then execute the Python script to build with appropriate options if required. + +[End of File] diff --git a/macbuild/build4mac.py b/macbuild/build4mac.py new file mode 100755 index 000000000..ca48f0452 --- /dev/null +++ b/macbuild/build4mac.py @@ -0,0 +1,406 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + +#=============================================================================== +# File: "macbuild/build4mac.py" +# +# The top Python script for building KLayout (http://www.klayout.de/index.php) +# version 0.25 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 platform +import optparse +import subprocess + +#------------------------------------------------------------------------------- +## To import global dictionaries of different modules +#------------------------------------------------------------------------------- +mydir = os.path.dirname(os.path.abspath(__file__)) +sys.path.append( mydir + "/macbuild" ) +from build4mac_env import * + +#------------------------------------------------------------------------------- +## To set global variables including present directory and platform info. +#------------------------------------------------------------------------------- +def SetGlobals(): + global PresentDir # present directory + global Usage # string on usage + global BuildBash # the main build Bash script + global Platform # platform + global ModuleQt # Qt module to be used + global ModuleRuby # Ruby module to be used + global ModulePython # Python module to be used + global NoQtBindings # True if not creating Qt bindings for Ruby scripts + global MakeOptions # options passed to `make` + global DebugMode # True if debug mode build + global CheckComOnly # True if check the command line only + # auxiliary variables on platform + global System # 6-tuple from platform.uname() + global Node # - do - + global Release # - do - + global Version # - do - + global Machine # - do - + global Processor # - do - + global Bit # machine bit-size + + Usage = "\n" + Usage += "---------------------------------------------------------------------------------------------\n" + Usage += "<< Usage of 'build4mac.py' >>\n" + Usage += " for building KLayout 0.25 or later on different Apple Mac OSX platforms.\n" + Usage += "\n" + Usage += "$ [python] build4mac.py \n" + Usage += " option & argument : comment on option if any | default value\n" + Usage += " -----------------------------------------------------------------------+---------------\n" + Usage += " : * key type names below are case insensitive * | \n" + Usage += " : 'nil' = not to support the script language | \n" + Usage += " : 'Sys' = using the OS standard script language | \n" + Usage += " [-q|--qt ] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n" + Usage += " [-r|--ruby ] : type=['nil', 'Sys', 'RubySource'] | sys \n" + Usage += " [-p|--python ] : type=['nil', 'Sys', 'Anaconda27', 'Anaconda36'] | sys \n" + Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n" + Usage += " [-m|--make