#! /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 and utility functions #------------------------------------------------------------------------------- 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 NonOSStdLang # True if non-OS-standard language is chosen 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 DeploymentF # True if fully (including Qt's Frameworks) deploy the binaries for bundles global DeploymentP # True if partially deploy the binaries for non-OS-standard script language user global DeployVerbose # -verbose=<0-3> level passed to 'macdeployqt' tool 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 : descriptions | 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 += " : Refer to 'macbuild/build4mac_env.py' for details | \n" Usage += " [-q|--qt ] : type=['Qt4MacPorts', 'Qt5MacPorts'] | qt5macports \n" Usage += " [-r|--ruby ] : type=['nil', 'Sys', 'Src24', 'MP24'] | sys \n" Usage += " [-p|--python ] : type=['nil', 'Sys', 'Ana27', 'Ana36', 'MP36'] | sys \n" Usage += " [-n|--noqtbinding] : don't create Qt bindings for ruby scripts | disabled \n" Usage += " [-m|--make