mirror of https://github.com/KLayout/klayout.git
parent
908be96bb9
commit
403efbd090
35
.travis.yml
35
.travis.yml
|
|
@ -1,16 +1,23 @@
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: osx
|
- os: osx
|
||||||
osx_image: xcode9.3beta
|
osx_image: xcode9.4 # macOS 10.13
|
||||||
env:
|
env:
|
||||||
- MATRIX_EVAL=""
|
- MATRIX_EVAL="export PYTHON_VERSION=B37; export MACOS_VERSION=HighSierra;"
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode8.3 # macOS 10.12
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="export PYTHON_VERSION=B37; export MACOS_VERSION=Sierra;"
|
||||||
|
- os: osx
|
||||||
|
osx_image: xcode8 # macOS 10.11
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="export PYTHON_VERSION=B37; export MACOS_VERSION=ElCapitan;"
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- eval "${MATRIX_EVAL}"
|
- eval "${MATRIX_EVAL}"
|
||||||
- brew update
|
- brew update
|
||||||
- brew bundle
|
- brew bundle
|
||||||
- env
|
- env
|
||||||
- pip install pathlib2
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- gem install dropbox-deployment
|
- gem install dropbox-deployment
|
||||||
|
|
@ -18,20 +25,10 @@ install:
|
||||||
- cd osx-config-check ; python2.7 app.py --report-only --skip-sudo-checks ; cd ..
|
- cd osx-config-check ; python2.7 app.py --report-only --skip-sudo-checks ; cd ..
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./build4mac.py -p B37 -q Qt5Brew -c
|
- make build
|
||||||
- source filter-clang.sh; ./build4mac.py -p B37 -q Qt5Brew | filter
|
- make deploy
|
||||||
- ./build4mac.py -p B37 -q Qt5Brew -y
|
- make test
|
||||||
- qt5.pkg.macos-HighSierra-release/klayout.app/Contents/MacOS/klayout -b -r test-pylib-script.py
|
- make dropbox-deploy
|
||||||
- cd qt5.build.macos-HighSierra-release
|
|
||||||
- ln -s klayout.app/Contents/MacOS/klayout klayout
|
|
||||||
- export TESTTMP=testtmp # path to a directory that will hold temporary data (will be created)
|
|
||||||
- export TESTSRC=.. # path to the source directory
|
|
||||||
- ./ut_runner -h
|
|
||||||
- ./ut_runner -s || true
|
|
||||||
- cd ..
|
|
||||||
- export gitcommit=$(git rev-parse --short HEAD)
|
|
||||||
- mkdir deploy
|
|
||||||
- tar czf "deploy/qt5.pkg.macos-HighSierra-release-$gitcommit.tar.gz" qt5.pkg.macos-HighSierra-release
|
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- dropbox-deployment
|
- dropbox-deployment
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
.PHONY: help build deploy test dropbox-deploy
|
||||||
|
|
||||||
|
default: help
|
||||||
|
|
||||||
|
help:
|
||||||
|
@echo "For Mac OS only"
|
||||||
|
@echo "make build PYTHON_VERSION=B37"
|
||||||
|
@echo "make deploy PYTHON_VERSION=B37"
|
||||||
|
@echo "make test MACOS_VERSION=HighSierra"
|
||||||
|
@echo "Valid Mac OS Versions: [Yosemite, ElCapitan, Sierra, HighSierra]"
|
||||||
|
@echo "Valid Python Version: [nil, Sys, B37]"
|
||||||
|
|
||||||
|
build:
|
||||||
|
./build4mac.py -p $(PYTHON_VERSION) -q Qt5Brew -c
|
||||||
|
./build4mac.py -p $(PYTHON_VERSION) -q Qt5Brew
|
||||||
|
|
||||||
|
deploy: build
|
||||||
|
./build4mac.py -p $(PYTHON_VERSION) -q Qt5Brew -y
|
||||||
|
|
||||||
|
test: deploy
|
||||||
|
qt5.pkg.macos--release/klayout.app/Contents/MacOS/klayout -b -r test-pylib-script.py
|
||||||
|
cd qt5.build.macos-$(MACOS_VERSION)-release
|
||||||
|
ln -s klayout.app/Contents/MacOS/klayout klayout
|
||||||
|
export TESTTMP=testtmp
|
||||||
|
export TESTSRC=..
|
||||||
|
./ut_runner -h
|
||||||
|
./ut_runner -s
|
||||||
|
|
||||||
|
dropbox-deploy: test
|
||||||
|
cd ..
|
||||||
|
export gitcommit=$(git rev-parse --short HEAD)
|
||||||
|
mkdir deploy
|
||||||
|
tar czf "deploy/qt5.pkg.macos-$(MACOS_VERSION)-release-$gitcommit.tar.gz" qt5.pkg.macos-$(MACOS_VERSION)-release
|
||||||
|
|
@ -18,12 +18,6 @@ import string
|
||||||
import subprocess
|
import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
try:
|
|
||||||
from pathlib import Path
|
|
||||||
Path('~').expanduser()
|
|
||||||
except (ImportError,AttributeError): # python2
|
|
||||||
from pathlib2 import Path
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
## To import global dictionaries of different modules
|
## To import global dictionaries of different modules
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
@ -181,7 +175,6 @@ def SetChangeLibIdentificationName( executable, relativedir ):
|
||||||
|
|
||||||
def WalkLibDependencyTree( dylibPath, depth=0, filter_regex=r'\t+/usr/local/opt'):
|
def WalkLibDependencyTree( dylibPath, depth=0, filter_regex=r'\t+/usr/local/opt'):
|
||||||
NOTHINGTODO = [] # return empty list if nothing to do.
|
NOTHINGTODO = [] # return empty list if nothing to do.
|
||||||
dylibPath = str(Path(dylibPath))
|
|
||||||
cmdNameId = XcodeToolChain['nameID']
|
cmdNameId = XcodeToolChain['nameID']
|
||||||
cmdNameChg = XcodeToolChain['nameCH']
|
cmdNameChg = XcodeToolChain['nameCH']
|
||||||
otoolCm = 'otool -L %s | grep -E "%s"' % (dylibPath, filter_regex)
|
otoolCm = 'otool -L %s | grep -E "%s"' % (dylibPath, filter_regex)
|
||||||
|
|
@ -193,7 +186,7 @@ def WalkLibDependencyTree( dylibPath, depth=0, filter_regex=r'\t+/usr/local/opt'
|
||||||
if depth < 5:
|
if depth < 5:
|
||||||
if len(deplibs) > 0:
|
if len(deplibs) > 0:
|
||||||
for idx, lib in enumerate(deplibs):
|
for idx, lib in enumerate(deplibs):
|
||||||
lib = str(Path(lib))
|
lib = str(lib)
|
||||||
if lib != list(keys)[0]:
|
if lib != list(keys)[0]:
|
||||||
deplibs[idx] = WalkLibDependencyTree(lib, depth+1, filter_regex)
|
deplibs[idx] = WalkLibDependencyTree(lib, depth+1, filter_regex)
|
||||||
if depth == 0:
|
if depth == 0:
|
||||||
|
|
@ -212,7 +205,6 @@ def WalkFrameworkPaths(frameworkPaths, filter_regex=r'\.(so|dylib)$', search_pat
|
||||||
dependency_dict = dict()
|
dependency_dict = dict()
|
||||||
|
|
||||||
for frameworkPath in frameworkPathsIter:
|
for frameworkPath in frameworkPathsIter:
|
||||||
frameworkPath = str(Path(frameworkPath))
|
|
||||||
# print("Calling:", 'find %s -type f | grep -E "%s"' % (frameworkPath, filter_regex))
|
# print("Calling:", 'find %s -type f | grep -E "%s"' % (frameworkPath, filter_regex))
|
||||||
find_grep_results = os.popen('find %s -type f | grep -E "%s"' % (frameworkPath, filter_regex)).read().split('\n')
|
find_grep_results = os.popen('find %s -type f | grep -E "%s"' % (frameworkPath, filter_regex)).read().split('\n')
|
||||||
framework_files = filter(lambda x: x != '',
|
framework_files = filter(lambda x: x != '',
|
||||||
|
|
@ -239,7 +231,7 @@ def WalkDictTree(dependencyDict, visited_files):
|
||||||
if deplib not in visited_files:
|
if deplib not in visited_files:
|
||||||
visited_files.append(deplib)
|
visited_files.append(deplib)
|
||||||
elif isinstance(deplib, dict):
|
elif isinstance(deplib, dict):
|
||||||
dependency_list.append(str(next(iter(deplib))))
|
dependency_list.append(next(iter(deplib)))
|
||||||
libNameChanges.extend(WalkDictTree(deplib, visited_files))
|
libNameChanges.extend(WalkDictTree(deplib, visited_files))
|
||||||
else:
|
else:
|
||||||
#raise RuntimeError("Unexpected value: %s" % deplib)
|
#raise RuntimeError("Unexpected value: %s" % deplib)
|
||||||
|
|
@ -253,16 +245,13 @@ def WalkDictTree(dependencyDict, visited_files):
|
||||||
visited_files.append(lib)
|
visited_files.append(lib)
|
||||||
return libNameChanges
|
return libNameChanges
|
||||||
|
|
||||||
def FindFramework(path, root_path):
|
|
||||||
path = Path(path)
|
|
||||||
root_path = Path(root_path)
|
|
||||||
relPath = path.relative_to(root_path)
|
|
||||||
return str(root_path / relPath.parts[0])
|
|
||||||
|
|
||||||
|
def FindFramework(path, root_path):
|
||||||
|
relPath = os.path.relpath(path, root_path)
|
||||||
|
return os.path.join(root_path, relPath.split(os.sep)[0])
|
||||||
def ResolveExecutablePath(path, executable_path):
|
def ResolveExecutablePath(path, executable_path):
|
||||||
""" Transforms @executable_path into executable_path"""
|
""" Transforms @executable_path into executable_path"""
|
||||||
executable_path = str(executable_path)
|
p = path.replace("@executable_path", "/%s/" % executable_path)
|
||||||
p = Path(str(path).replace("@executable_path", "/%s/" % executable_path))
|
|
||||||
return p
|
return p
|
||||||
|
|
||||||
def DetectChanges(frameworkDependencyDict):
|
def DetectChanges(frameworkDependencyDict):
|
||||||
|
|
@ -289,11 +278,8 @@ def PerformChanges(frameworkDependencyDict, replaceFromToPairs=None, executable_
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
dependencies = list()
|
dependencies = list()
|
||||||
for replaceFrom, replaceTo, libdir in replaceFromToPairs:
|
for replaceFrom, replaceTo, libdir in replaceFromToPairs:
|
||||||
replaceFrom = str(Path(replaceFrom))
|
|
||||||
replaceTo = str(Path(replaceTo))
|
|
||||||
|
|
||||||
fileName = ResolveExecutablePath(lib.replace(replaceFrom, replaceTo), executable_path)
|
fileName = ResolveExecutablePath(lib.replace(replaceFrom, replaceTo), executable_path)
|
||||||
if str(fileName).startswith('/usr'):
|
if fileName.startswith('/usr'):
|
||||||
# print(f'skipping fileName: {fileName}')
|
# print(f'skipping fileName: {fileName}')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -305,14 +291,14 @@ def PerformChanges(frameworkDependencyDict, replaceFromToPairs=None, executable_
|
||||||
destFrameworkPath = frameworkPath.replace(replaceFrom, replaceTo)
|
destFrameworkPath = frameworkPath.replace(replaceFrom, replaceTo)
|
||||||
destFrameworkPath = ResolveExecutablePath(destFrameworkPath, executable_path)
|
destFrameworkPath = ResolveExecutablePath(destFrameworkPath, executable_path)
|
||||||
|
|
||||||
if not fileName.exists():
|
if not os.path.exists(fileName):
|
||||||
print (lib.replace(replaceFrom, replaceTo), "DOES NOT EXIST")
|
print (lib.replace(replaceFrom, replaceTo), "DOES NOT EXIST")
|
||||||
print ("COPY", frameworkPath, " -> ", destFrameworkPath)
|
print ("COPY", frameworkPath, " -> ", destFrameworkPath)
|
||||||
shutil.copytree(frameworkPath, str(destFrameworkPath))
|
shutil.copytree(frameworkPath, destFrameworkPath)
|
||||||
|
|
||||||
nameId = lib.replace(replaceFrom, replaceTo)
|
nameId = lib.replace(replaceFrom, replaceTo)
|
||||||
command = "%s %s %s" % ( cmdNameId, nameId, fileName )
|
command = "%s %s %s" % ( cmdNameId, nameId, fileName )
|
||||||
if not os.access(str(fileName), os.W_OK):
|
if not os.access(fileName, os.W_OK):
|
||||||
command = "chmod u+w %s; %s; chmod u-w %s" % (fileName, command, fileName)
|
command = "chmod u+w %s; %s; chmod u-w %s" % (fileName, command, fileName)
|
||||||
# print("\t%s" % command)
|
# print("\t%s" % command)
|
||||||
if subprocess.call( command, shell=True ) != 0:
|
if subprocess.call( command, shell=True ) != 0:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue