#! /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 shutil import glob 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 * from build4mac_util import * #------------------------------------------------------------------------------- ## To set global variables including present directory and platform info. #------------------------------------------------------------------------------- def SetGlobals(): global ProjectDir # project directory where "build.sh" exists 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 only for checking the command line parameters to "build.sh" global Deployment # True if deploying the binaries for a package global Version # KLayout's version # 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