-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhauled the build system for MacOS ['Monterey', 'Ventura', 'Sonoma…
…'] to build KLayout-0.28.13 or later with support for libgit2.
- Loading branch information
Showing
22 changed files
with
824 additions
and
972 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/Applications/klayout.app/Contents/MacOS/klayout -b -r | ||
import readline | ||
import code | ||
import sys | ||
import os | ||
pwd = os.getcwd() | ||
sys.path.append(pwd) | ||
|
||
rootPython = "/Applications/klayout.app/Contents/Frameworks/Python.framework/Versions" | ||
verPython = "${PYTHON_VER}" | ||
piptarget = [ "--target", "%s/%s/lib/python%s/site-packages" % (rootPython, verPython, verPython) ] | ||
|
||
piphelpstr = """ | ||
-------------------------------------------------------------------------------- | ||
(1) Install ['pandas', 'scipy', 'matplotlib'] | ||
>>> import pip | ||
>>> pip.main( ['install', 'pandas', 'scipy', 'matplotlib'] + piptarget ) | ||
(2) List modules | ||
>>> import pip | ||
>>> pip.main( ['list'] ) | ||
(3) Uninstall ['scipy'] | ||
>>> import pip | ||
>>> pip.main( ['uninstall', 'scipy'] ) | ||
-------------------------------------------------------------------------------- | ||
""" | ||
def howtopip(): | ||
print(piphelpstr) | ||
|
||
|
||
variables = globals().copy() | ||
variables.update(locals()) | ||
shell = code.InteractiveConsole(variables) | ||
cprt = 'Type "help", "copyright", "credits" or "license" for more information.' | ||
banner = "Python %s on %s\n%s\n(%s)" % (sys.version, sys.platform, | ||
cprt, "KLayout Python Console") | ||
exit_msg = 'now exiting %s...' % "KLayout Python Console" | ||
shell.interact(banner, exit_msg) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -623,18 +623,24 @@ def Patch_Python_In_PythonFramework( pythonFrameworkPath, | |
#---------------------------------------------------------------------------------------- | ||
## To change the Python's relative library paths to the absolute paths | ||
# | ||
# 1: absolute path as in [email protected] | ||
# 1: absolute path as seen in [email protected] | ||
# BigSur{kazzz-s} lib-dynload (1)% otool -L _sqlite3.cpython-39-darwin.so | ||
# _sqlite3.cpython-39-darwin.so: | ||
# ===> /usr/local/opt/sqlite/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0) | ||
# /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5) | ||
# | ||
# 2: relative path as in [email protected]~ | ||
# 2: relative path as seen in [email protected] | ||
# Monterey{kazzz-s} lib-dynload (1)% otool -L _sqlite3.cpython-39-darwin.so | ||
# _sqlite3.cpython-39-darwin.so: | ||
# ===> @loader_path/../../../../../../../../../../opt/sqlite/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0) | ||
# /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3) | ||
# | ||
# 3. absolute path again as seen in [email protected] | ||
# Monterey{kazzz-s} lib-dynload (1)% otool -L _sqlite3.cpython-311-darwin.so | ||
# _sqlite3.cpython-311-darwin.so: | ||
# ===> /usr/local/opt/sqlite/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0) | ||
# /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3) | ||
# | ||
# @param[in] frameworkPath: Python Framework path | ||
# @param[in] debug_level: debug level | ||
# | ||
|
@@ -650,17 +656,25 @@ def Change_Python_LibPath_RelativeToAbsolute( frameworkPath, debug_level=0 ): | |
patRel3 = r'(%s)(.+)' % HomebrewSearchPathFilter3 # = '@loader_path/../../../../../../../../../../opt' | ||
regRel3 = re.compile(patRel3) | ||
|
||
#---------------------------------------------------------------------- | ||
#--------------------------------------------------------------------------------------------------- | ||
# (A) Collect *.[so|dylib] that the Python Frameworks depends on | ||
#---------------------------------------------------------------------- | ||
# Ref. https://formulae.brew.sh/formula/[email protected]#default | ||
#--------------------------------------------------------------------------------------------------- | ||
# Ref. https://formulae.brew.sh/formula/[email protected] | ||
# as of 2023-09-22, [email protected] depends on: | ||
# gdbm 1.23 GNU database manager | ||
# mpdecimal 2.5.1 Library for decimal floating point arithmetic | ||
# openssl@3 3.1.2 Cryptography and SSL/TLS Toolkit | ||
# readline 8.2.1 Library for command-line editing | ||
# sqlite 3.43.1 Command-line interface for SQLite | ||
# xz 5.4.4 General-purpose data compression with high compression ratio | ||
#--------------------------------------------------------------------------------------------------- | ||
# https://formulae.brew.sh/formula/[email protected] | ||
# as of 2023-10-24, [email protected] depends on: | ||
# mpdecimal 2.5.1 Library for decimal floating point arithmetic | ||
# openssl@3 3.1.3 Cryptography and SSL/TLS Toolkit | ||
# sqlite 3.43.2 Command-line interface for SQLite | ||
# xz 5.4.4 General-purpose data compression with high compression ratio | ||
#--------------------------------------------------------------------------------------------------- | ||
find_grep_results = os.popen( 'find %s -type f | grep -E "%s"' % (frameworkPath, filter_regex) ).read().split('\n') | ||
framework_files = filter( lambda x: x != '', map(lambda x: x.strip(), find_grep_results) ) | ||
|
||
|
@@ -745,6 +759,37 @@ def Change_Python_LibPath_RelativeToAbsolute( frameworkPath, debug_level=0 ): | |
print( " ---> Change_Python_LibPath_RelativeToAbsolute(): Changed the library paths." ) | ||
return 0 | ||
|
||
#---------------------------------------------------------------------------------------- | ||
## To generate the 'start-console.py' file from the template file | ||
# | ||
# @param[in] template: input template file (template-start-console.py) | ||
# @param[in] pythonver: Python version string such as "3.11" | ||
# @param[in] target: output target file (start-console.py) | ||
# | ||
# @return True on success, False on failure | ||
#---------------------------------------------------------------------------------------- | ||
def Generate_Start_Console_Py( template, pythonver, target ): | ||
try: | ||
fd = open( template, "r" ) | ||
tmpl = fd.read() | ||
fd.close() | ||
except Exception as e: | ||
print( "! Failed to read <%s>" % template, file=sys.stderr ) | ||
return False | ||
else: | ||
t = string.Template(tmpl) | ||
startpy = t.safe_substitute( PYTHON_VER=pythonver ) | ||
|
||
try: | ||
fd = open( target, "w" ) | ||
fd.write(startpy) | ||
fd.close() | ||
except Exception as e: | ||
print( "! Failed to write <%s>" % target, file=sys.stderr ) | ||
return False | ||
else: | ||
return True | ||
|
||
#---------------- | ||
# End of File | ||
#---------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
#=============================================================================== | ||
# File: "macbuild/macQAT2.sh" | ||
# | ||
# The top Bash script to run "ut_runner" after building KLayout | ||
# (http://www.klayout.de/index.php) version 0.26.1 or later on different Apple | ||
# Mac OSX platforms. | ||
# | ||
# This script must be copied to a directory that can be found in $PATH. | ||
#=============================================================================== | ||
|
||
prjdir=`pwd` | ||
|
||
if [ $# -ge 2 ]; then | ||
first_arg=$1 | ||
shift | ||
remaining_args=("$@") | ||
echo "#########################" | ||
echo "# Starging macQAT2.sh #" | ||
echo "#########################" | ||
echo " Current Dir: $prjdir" | ||
echo " First Arg: $first_arg" | ||
echo "Remaining Args: ${remaining_args[@]}" | ||
echo "" | ||
export TESTSRC=../ | ||
export TESTTMP=$first_arg | ||
export DYLD_LIBRARY_PATH=$prjdir:$prjdir/db_plugins:$prjdir/lay_plugins | ||
./ut_runner ${remaining_args[@]} | ||
else | ||
echo "Usage: -------------------------------------------------" | ||
echo " $ macQAT2.sh <test_dir> <args to ./ut_runner>" | ||
echo " ex. $ change directory to a *.macQAT/" | ||
echo " $ macQAT2.sh __Homebrew tlGitTests" | ||
echo "--------------------------------------------------------" | ||
fi | ||
|
||
#-------------- | ||
# End of File | ||
#-------------- |
Oops, something went wrong.