python fully embedded into bundle. wonder if it is useful.

This commit is contained in:
Thomas Ferreira de Lima 2018-03-13 04:17:01 -04:00
parent 2598f28e69
commit ea8aa5f99f
2 changed files with 43 additions and 1 deletions

View File

@ -237,7 +237,8 @@ def WalkDictTree(dependencyDict, visited_files):
dependency_list.append(str(next(iter(deplib)))) dependency_list.append(str(next(iter(deplib))))
libNameChanges.extend(WalkDictTree(deplib, visited_files)) libNameChanges.extend(WalkDictTree(deplib, visited_files))
else: else:
raise RuntimeError("Unexpected value: %s, %s" % (deplib, dependencies)) #raise RuntimeError("Unexpected value: %s" % deplib)
pass
else: else:
raise RuntimeError("Unexpected value: %s" % dependencies) raise RuntimeError("Unexpected value: %s" % dependencies)
if len(dependency_list) > 0: if len(dependency_list) > 0:

41
test-pylib.py Normal file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env python3
import pprint
import os
from macbuild.build4mac_util import WalkFrameworkPaths, PerformChanges, DetectChanges
bundlePath = 'qt5.pkg.macos-HighSierra-release/klayout.app'
bundleExecPathAbs = os.getcwd() + '/%s/Contents/MacOS/' % bundlePath
# rsync -a --safe-links /usr/local/opt/python/Frameworks/Python.framework/ qt5.pkg.macos-HighSierra-release/klayout.app/Contents/Frameworks/Python.framework
# cp -RL /usr/local/opt/python/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages qt5.pkg.macos-HighSierra-release/klayout.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/
# rm -rf qt5.pkg.macos-HighSierra-release/klayout.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/test
pythonFrameworkPath = '%s/Contents/Frameworks/Python.framework' % bundlePath
depdict = WalkFrameworkPaths(pythonFrameworkPath)
# pp = pprint.PrettyPrinter(indent=1)
# pp.pprint(depdict)
pythonOriginalFrameworkPath = '/usr/local/opt/python/Frameworks/Python.framework'
appPythonFrameworkPath = '@executable_path/../Frameworks/Python.framework/'
PerformChanges(depdict, [(pythonOriginalFrameworkPath, appPythonFrameworkPath)], bundleExecPathAbs)
klayoutPath = bundleExecPathAbs
depdict = WalkFrameworkPaths(klayoutPath, filter_regex=r'klayout$')
PerformChanges(depdict, [(pythonOriginalFrameworkPath, appPythonFrameworkPath)], bundleExecPathAbs)
klayoutPath = bundleExecPathAbs + '../Frameworks'
depdict = WalkFrameworkPaths(klayoutPath, filter_regex=r'libklayout')
PerformChanges(depdict, [(pythonOriginalFrameworkPath, appPythonFrameworkPath)], bundleExecPathAbs)
usrLocalPath = '/usr/local/opt/'
appUsrLocalPath = '@executable_path/../Frameworks/'
depdict = WalkFrameworkPaths(pythonFrameworkPath)
PerformChanges(depdict, [(usrLocalPath, appUsrLocalPath)], bundleExecPathAbs)
# usrLocalPath = '/usr/local/lib/'
# appUsrLocalPath = '@executable_path/../Frameworks/'
# depdict = WalkFrameworkPaths(pythonFrameworkPath)
# PerformChanges(depdict, [(usrLocalPath, appUsrLocalPath)], bundleExecPathAbs)