From cc7868d21ea46d832bb422985140cb824b9fe8d6 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 2 Jun 2018 20:38:38 -0400 Subject: mac build + build debugging --- .travis.yml | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3016bb94..b5979890 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,11 @@ matrix: sudo: required env: BUILD=windows if: tag =~ ^v[0-9.]+$ OR branch != master + - language: generic + os: osx + sudo: required + env: BUILD=osx + if: tag =~ ^v[0-9.]+$ OR branch != master branches: except: - /^dev-build-/ @@ -30,6 +35,15 @@ cache: pip install: - | set -e + if [ "$DEBUG_BUILD" = "$BUILD" ]; then + mkdir .ssh + echo -e "${SSH_KEY}" > .ssh/id_rsa + chmod -R go-rwx .ssh + mkfifo fifo + ( while :; do cat fifo | /bin/bash -i 2>&1 | nc -l 127.0.0.1 9999 > fifo; done) & + echo "opening debuging connection" + travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd + fi if [ -n "$BUILD" ]; then # Need this for inkex.py and friends wget -q https://inkscape.org/en/gallery/item/11254/inkscape-0.92.2.tar.bz2 @@ -97,6 +111,44 @@ install: wine c:\\Python\\python.exe c:\\Python\\scripts\\pip.exe install -r requirements.txt set +x + elif [ "$BUILD" = "osx" ]; then + brew update + brew outdated python || brew upgrade python + + # brew told me to do this + mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages + + # the 3 in pygobject3 signifies gtk3, not python3 + brew install pygobject3 gtk+3 + + # for msgfmt + #brew install gettext + brew link gettext --force + + export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/ + + export PATH="/usr/local/opt/python/libexec/bin:$PATH" + + pip install virtualenv + virtualenv --system-site-packages venv + + # add in brew's site-packages + echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/homebrew.pth + + # add in pygobject's site-packages + #echo 'import site; site.addsitedir("/usr/local/Cellar/pygobject/2.28.7_1/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/pygobject.pth + + source venv/bin/activate + + # for embroidermodder/libembroidery + brew install swig + + # for qmake + brew install qt + export PATH="/usr/local/opt/qt/bin:$PATH" + + pip install -r requirements.txt + pip install pyinstaller elif [ -n "$LINT" ]; then pip install flake8 fi @@ -108,7 +160,7 @@ script: if [ -n "$LINT" ]; then flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder - elif [ "$BUILD" = "linux" ]; then + elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then ( cd embroidermodder/experimental qmake swigpython.pro -- cgit v1.2.3 From 6ec2f54150ae17a7a33da46f0e6524f2b11b320d Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 2 Jun 2018 23:04:31 -0400 Subject: _libembroidery fix --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b5979890..9c3e3787 100644 --- a/.travis.yml +++ b/.travis.yml @@ -122,15 +122,14 @@ install: brew install pygobject3 gtk+3 # for msgfmt - #brew install gettext brew link gettext --force export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/ export PATH="/usr/local/opt/python/libexec/bin:$PATH" - pip install virtualenv - virtualenv --system-site-packages venv + pip2 install virtualenv + virtualenv -p python2 --system-site-packages venv # add in brew's site-packages echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/homebrew.pth @@ -165,6 +164,10 @@ script: cd embroidermodder/experimental qmake swigpython.pro make + if [ "$BUILD" = "osx" ]; then + ln -s _libembroidery.dylib python/binding/_libembroidery.so + install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib + fi ) make dist elif [ "$BUILD" = "windows" ]; then -- cgit v1.2.3 From ba11af474128bf877eccd393a7c4028feea15e42 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 09:59:41 -0400 Subject: don't install python3 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9c3e3787..44bd86f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,7 +113,7 @@ install: set +x elif [ "$BUILD" = "osx" ]; then brew update - brew outdated python || brew upgrade python + #brew outdated python || brew upgrade python # brew told me to do this mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages @@ -128,7 +128,7 @@ install: export PATH="/usr/local/opt/python/libexec/bin:$PATH" - pip2 install virtualenv + pip install virtualenv virtualenv -p python2 --system-site-packages venv # add in brew's site-packages -- cgit v1.2.3 From 225e727f61fb676a97c9da522869d2847ac9148a Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 11:26:22 -0400 Subject: set -x --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 44bd86f8..2122a3d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -156,6 +156,7 @@ before_script: script: - | set -e + set -x if [ -n "$LINT" ]; then flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder -- cgit v1.2.3 From 54cfa44b3ac556a663b7c4ffd4ed43f20615c4f4 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 11:35:36 -0400 Subject: move debug --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2122a3d6..e9a2d289 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,15 +35,6 @@ cache: pip install: - | set -e - if [ "$DEBUG_BUILD" = "$BUILD" ]; then - mkdir .ssh - echo -e "${SSH_KEY}" > .ssh/id_rsa - chmod -R go-rwx .ssh - mkfifo fifo - ( while :; do cat fifo | /bin/bash -i 2>&1 | nc -l 127.0.0.1 9999 > fifo; done) & - echo "opening debuging connection" - travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd - fi if [ -n "$BUILD" ]; then # Need this for inkex.py and friends wget -q https://inkscape.org/en/gallery/item/11254/inkscape-0.92.2.tar.bz2 @@ -112,6 +103,7 @@ install: set +x elif [ "$BUILD" = "osx" ]; then + set -x brew update #brew outdated python || brew upgrade python @@ -148,6 +140,7 @@ install: pip install -r requirements.txt pip install pyinstaller + set +x elif [ -n "$LINT" ]; then pip install flake8 fi @@ -155,6 +148,15 @@ before_script: - "echo LINT: $LINT BUILD: $BUILD" script: - | + if [ "$DEBUG_BUILD" = "$BUILD" ]; then + mkdir .ssh + echo -e "${SSH_KEY}" > .ssh/id_rsa + chmod -R go-rwx .ssh + mkfifo fifo + ( while :; do cat fifo | /bin/bash -i 2>&1 | nc -l 127.0.0.1 9999 > fifo; done) & + echo "opening debuging connection" + travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd + fi set -e set -x if [ -n "$LINT" ]; then -- cgit v1.2.3 From 74c48a867e3556f7f6d1b79701d897809dfa7aae Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 11:55:29 -0400 Subject: debug --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9a2d289..a7334656 100644 --- a/.travis.yml +++ b/.travis.yml @@ -157,13 +157,12 @@ script: echo "opening debuging connection" travis_wait 60 ssh -o StrictHostKeyChecking=no -i .ssh/id_rsa -N -R 9999:localhost:9999 debug@lex.gd fi - set -e - set -x if [ -n "$LINT" ]; then flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then ( + set -x cd embroidermodder/experimental qmake swigpython.pro make @@ -171,7 +170,8 @@ script: ln -s _libembroidery.dylib python/binding/_libembroidery.so install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib fi - ) + set +x + ) make dist elif [ "$BUILD" = "windows" ]; then # work around some bug... pyinstaller? shapely? not sure. -- cgit v1.2.3 From fd6ae02fb3c0f003e08c66858366689a9e9f9f36 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 12:35:14 -0400 Subject: stop failing --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a7334656..b69d9514 100644 --- a/.travis.yml +++ b/.travis.yml @@ -144,6 +144,7 @@ install: elif [ -n "$LINT" ]; then pip install flake8 fi + set +e before_script: - "echo LINT: $LINT BUILD: $BUILD" script: -- cgit v1.2.3 From f8141ed7dfd2b6900e482e92b85240d5378461e6 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 13:00:23 -0400 Subject: try pushd/popd --- .travis.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index b69d9514..f59fc396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -144,7 +144,6 @@ install: elif [ -n "$LINT" ]; then pip install flake8 fi - set +e before_script: - "echo LINT: $LINT BUILD: $BUILD" script: @@ -162,18 +161,16 @@ script: flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then - ( - set -x - cd embroidermodder/experimental - qmake swigpython.pro - make - if [ "$BUILD" = "osx" ]; then - ln -s _libembroidery.dylib python/binding/_libembroidery.so - install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib - fi - set +x - ) + pushd embroidermodder/experimental + qmake swigpython.pro + make + if [ "$BUILD" = "osx" ]; then + ln -s _libembroidery.dylib python/binding/_libembroidery.so + install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib + fi + set +x make dist + popd elif [ "$BUILD" = "windows" ]; then # work around some bug... pyinstaller? shapely? not sure. cp $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos_c.dll') $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos.dll') -- cgit v1.2.3 From 93d92322c9f66c24dfb247728ea686196dc325e4 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 13:38:37 -0400 Subject: work around travis fail --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index f59fc396..6630a4ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -161,7 +161,11 @@ script: flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then + # it looks like one of travis's cd hooks fails + set +e pushd embroidermodder/experimental + set -e + qmake swigpython.pro make if [ "$BUILD" = "osx" ]; then -- cgit v1.2.3 From 977d16d342c7b5de9764d0a44259fed8ae74191c Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 15:17:45 -0400 Subject: dammit, travis --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6630a4ee..39b11b4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -161,20 +161,22 @@ script: flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics --exclude=embroidermodder flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=embroidermodder elif [ "$BUILD" = "linux" -o "$BUILD" = "osx" ]; then - # it looks like one of travis's cd hooks fails - set +e + # something in travis's machinery breaks on OSX + [ "$BUILD" = "osx" ] && set +e + pushd embroidermodder/experimental - set -e qmake swigpython.pro make + if [ "$BUILD" = "osx" ]; then ln -s _libembroidery.dylib python/binding/_libembroidery.so install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib fi - set +x - make dist + popd + + make dist elif [ "$BUILD" = "windows" ]; then # work around some bug... pyinstaller? shapely? not sure. cp $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos_c.dll') $(winepath 'C:\Python\lib\site-packages\shapely\DLLs\geos.dll') -- cgit v1.2.3 From fe0f8e83d9e7678418925c75b8d3fda732b9ee07 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 3 Jun 2018 15:29:48 -0400 Subject: don't debug lint runs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 39b11b4f..180020eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -148,7 +148,7 @@ before_script: - "echo LINT: $LINT BUILD: $BUILD" script: - | - if [ "$DEBUG_BUILD" = "$BUILD" ]; then + if [ -n "$BUILD" -a "$DEBUG_BUILD" = "$BUILD" ]; then mkdir .ssh echo -e "${SSH_KEY}" > .ssh/id_rsa chmod -R go-rwx .ssh -- cgit v1.2.3 From 5b5188ef9918d196173a4a543532c497140e639c Mon Sep 17 00:00:00 2001 From: globalcow Date: Sat, 9 Jun 2018 21:45:14 +0200 Subject: Change all Python references to homebrew --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 180020eb..8ae903c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -171,7 +171,7 @@ script: if [ "$BUILD" = "osx" ]; then ln -s _libembroidery.dylib python/binding/_libembroidery.so - install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/opt/python2/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib + install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/Python python/binding/_libembroidery.dylib fi popd -- cgit v1.2.3 From 91aaf404e64b98ec5dbdf4e19beb9b16da4204f5 Mon Sep 17 00:00:00 2001 From: globalcow Date: Tue, 31 Jul 2018 14:53:15 +0200 Subject: Add --windowed argument to pyinstaller for OS X --- bin/build-dist | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/build-dist b/bin/build-dist index 79c89838..3b82e882 100755 --- a/bin/build-dist +++ b/bin/build-dist @@ -22,6 +22,12 @@ pyinstaller_args+="--hidden-import gi.repository.Gtk " # mac and windows build seem to miss wx import pyinstaller_args+="--hidden-import wx " +# We need to use the precompiled bootloader linked with graphical Mac OS X +# libraries if we develop a GUI application for Mac: +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + pyinstaller_args+="--windowed " +fi + # This lets pyinstaller see inkex.py, etc. pyinstaller_args+="-p inkscape-0.92.3/share/extensions " -- cgit v1.2.3 From 9bb9f877639ba6c6cc6cd9c680f3198d2f61950e Mon Sep 17 00:00:00 2001 From: globalcow Date: Wed, 1 Aug 2018 11:30:59 +0200 Subject: Skip some unnecessary lines in mac build --- .travis.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index b74f220d..a5841ba5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,26 +111,12 @@ install: export GI_TYPELIB_PATH=/usr/local/lib/girepository-1.0/ - export PATH="/usr/local/opt/python/libexec/bin:$PATH" - pip install virtualenv virtualenv -p python2 --system-site-packages venv - # add in brew's site-packages - echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/homebrew.pth - - # add in pygobject's site-packages - #echo 'import site; site.addsitedir("/usr/local/Cellar/pygobject/2.28.7_1/lib/python2.7/site-packages")' >> venv/lib/python2.7/site-packages/pygobject.pth - + # activate virtual environment source venv/bin/activate - # for embroidermodder/libembroidery - brew install swig - - # for qmake - brew install qt - export PATH="/usr/local/opt/qt/bin:$PATH" - pip install -r requirements.txt pip install pyinstaller set +x -- cgit v1.2.3 From f674ccd4e9029a26f20efcd135356549a16c3c1c Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 1 Aug 2018 13:00:03 -0400 Subject: remove inkstitch.app --- bin/build-dist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/build-dist b/bin/build-dist index 3b82e882..a96b7506 100755 --- a/bin/build-dist +++ b/bin/build-dist @@ -51,6 +51,11 @@ mkdir dist/bin mv dist/inkstitch/* dist/bin mv dist/bin dist/inkstitch +# on Mac, pyinstaller creates a .app version as well, but we don't need that +if [ "$TRAVIS_OS_NAME" = "osx" ]; then + rm -rf dist/inkstitch.app/ +fi + # Inkscape doesn't let us run native binaries as extensions(?!). Instead we # add this stub script which executes the binary that pyinstaller creates. cp stub.py dist/inkstitch.py -- cgit v1.2.3 From 666e1f08c3d442a85a20d8f057a0cd0eaee8be91 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 1 Aug 2018 17:24:29 -0400 Subject: use more friendly OS name 'osx' for tarball file name --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 326af11e..52ac919f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ EXTENSIONS:=inkstitch # This gets the branch name or the name of the tag VERSION:=$(TRAVIS_BRANCH) -OS:=$(shell uname) +OS:=$(TRAVIS_OS_NAME) ARCH:=$(shell uname -m) dist: distclean locales @@ -17,7 +17,7 @@ dist: distclean locales if [ "$$BUILD" = "windows" ]; then \ cd dist; zip -r ../inkstitch-$(VERSION)-win32.zip *; \ else \ - cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH).tar.gz *; \ + cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH).tar.gz *; \ fi distclean: -- cgit v1.2.3 From b8dc82570641eb5117d46980186c207b30e44223 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 1 Aug 2018 20:43:31 -0400 Subject: try using GetScreenRect() instead --- lib/extensions/params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/extensions/params.py b/lib/extensions/params.py index 58fedd6b..1b8f2589 100644 --- a/lib/extensions/params.py +++ b/lib/extensions/params.py @@ -424,7 +424,7 @@ class SettingsFrame(wx.Frame): self.simulate_window.stop() self.simulate_window.load(stitch_plan=stitch_plan) else: - my_rect = self.GetRect() + my_rect = self.GetScreenRect() simulator_pos = my_rect.GetTopRight() simulator_pos.x += 5 -- cgit v1.2.3