From e06e63d44caeb72061a2e59e6efc40bee034d680 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 10 Apr 2019 23:38:43 -0400 Subject: add build machinery for electron --- bin/build-electron | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 bin/build-electron (limited to 'bin') diff --git a/bin/build-electron b/bin/build-electron new file mode 100755 index 00000000..f63223ac --- /dev/null +++ b/bin/build-electron @@ -0,0 +1,13 @@ +#!/bin/bash + +cd electron + +if [ "$BUILD" = "windows" ]; then + NPM="wine 'C:\node\npm'" +else + NPM="npm" +fi + +$NPM install +$NPM update +$NPM run package -- cgit v1.2.3 From 22eabd00c1f407f1793191e34d2df4cb97e858cf Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 11 Apr 2019 00:05:36 -0400 Subject: fix windows npm invocation --- bin/build-electron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/build-electron b/bin/build-electron index f63223ac..032a7fee 100755 --- a/bin/build-electron +++ b/bin/build-electron @@ -3,7 +3,7 @@ cd electron if [ "$BUILD" = "windows" ]; then - NPM="wine 'C:\node\npm'" + NPM="wine cmd /c 'C:\node\npm.cmd'" else NPM="npm" fi -- cgit v1.2.3 From aae92ceca51469292f9ea2ab4386e963e6a33716 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Thu, 11 Apr 2019 00:22:08 -0400 Subject: refix windows --- bin/build-electron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/build-electron b/bin/build-electron index 032a7fee..ccf98b14 100755 --- a/bin/build-electron +++ b/bin/build-electron @@ -3,7 +3,7 @@ cd electron if [ "$BUILD" = "windows" ]; then - NPM="wine cmd /c 'C:\node\npm.cmd'" + NPM="wine cmd /c C:\\node\\npm.cmd" else NPM="npm" fi -- cgit v1.2.3 From 0d54c828d0477db8666ff24d451591d9f7fdcf57 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 12 Apr 2019 01:41:14 -0400 Subject: use docker for windows --- bin/build-electron | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/build-electron b/bin/build-electron index ccf98b14..1c0c6e58 100755 --- a/bin/build-electron +++ b/bin/build-electron @@ -1,13 +1,14 @@ #!/bin/bash -cd electron - if [ "$BUILD" = "windows" ]; then - NPM="wine cmd /c C:\\node\\npm.cmd" + docker run --rm \ + -e ELECTRON_CACHE=$HOME/.cache/electron \ + -v ${PWD}/electron:/project \ + -v ~/.cache/electron:/root/.cache/electron \ + electronuserland/builder:wine \ + /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn run dist" else - NPM="npm" + cd electron + yarn install + yarn run dist fi - -$NPM install -$NPM update -$NPM run package -- cgit v1.2.3 From f85395b9a6e318406cbac12d639944173ab8a898 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 12 Apr 2019 15:29:00 -0400 Subject: use docker for linux too and npm for mac --- bin/build-electron | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/build-electron b/bin/build-electron index 1c0c6e58..b4887268 100755 --- a/bin/build-electron +++ b/bin/build-electron @@ -1,6 +1,6 @@ #!/bin/bash -if [ "$BUILD" = "windows" ]; then +if [ "$BUILD" = "windows" -o "$BUILD" = "linux" ]; then docker run --rm \ -e ELECTRON_CACHE=$HOME/.cache/electron \ -v ${PWD}/electron:/project \ @@ -9,6 +9,6 @@ if [ "$BUILD" = "windows" ]; then /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn run dist" else cd electron - yarn install - yarn run dist + npm install + npm run dist fi -- cgit v1.2.3 From a87694dc61d7e90f63efb05666e7fd308f447652 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Fri, 12 Apr 2019 15:38:54 -0400 Subject: get the right architecture --- bin/build-electron | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/build-electron b/bin/build-electron index b4887268..d8ce78b8 100755 --- a/bin/build-electron +++ b/bin/build-electron @@ -1,12 +1,18 @@ #!/bin/bash if [ "$BUILD" = "windows" -o "$BUILD" = "linux" ]; then + if [ "$BUILD" = "windows" ]; then + args="-w --ia32" + else + args="-l --x64" + fi + docker run --rm \ -e ELECTRON_CACHE=$HOME/.cache/electron \ -v ${PWD}/electron:/project \ -v ~/.cache/electron:/root/.cache/electron \ electronuserland/builder:wine \ - /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn run dist" + /bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn run dist ${args}" else cd electron npm install -- cgit v1.2.3 From 2c6adea15068ff828344c034142b74883fe6a9ae Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 20 Apr 2019 21:55:26 -0400 Subject: refactor 'make dist' archive creation into a shell script --- bin/build-dist | 61 ----------------------------------------- bin/build-distribution-archives | 27 ++++++++++++++++++ bin/build-python | 61 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 61 deletions(-) delete mode 100755 bin/build-dist create mode 100755 bin/build-distribution-archives create mode 100755 bin/build-python (limited to 'bin') diff --git a/bin/build-dist b/bin/build-dist deleted file mode 100755 index c740c782..00000000 --- a/bin/build-dist +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -set -e - -site_packages="$(python -c "import os; print(os.path.dirname(os.__file__) + '/site-packages')")" - -if [ "$TRAVIS_OS_NAME" = "linux" -a "$BUILD" != "windows" ]; then - # pyinstaller misses these two - pyinstaller_args+="--add-binary /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so:. " - pyinstaller_args+="--add-binary /usr/lib/x86_64-linux-gnu/libproxy.so.1:. " -fi - -# This one's tricky. ink/stitch doesn't actually _use_ gi.repository.Gtk, -# but it does use GTK (through wxPython). pyinstaller has some special -# logic to handle GTK apps that is engaged when you import -# gi.repository.Gtk that pulls in things like themes, icons, etc. Without -# that, the Params dialog is unthemed and barely usable. This hidden -# import option is actually the only reason we had to install python-gi -# above! -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/share/extensions " - -# output useful debugging info that helps us trace library dependency issues -pyinstaller_args+="--log-level DEBUG " - -if [ "$BUILD" = "windows" ]; then - wine c:\\Python\\scripts\\pyinstaller.exe $pyinstaller_args inkstitch.py -else - # without the LD_LIBRARY_PATH, it seems that pyinstaller can't find all of - # wxpython's shared libraries - LD_LIBRARY_PATH="${site_packages}/wx" pyinstaller $pyinstaller_args --strip inkstitch.py; -fi - -# pyinstaller put a whole mess of libraries under dist/inkstitch. We'd like -# to put some more user-accessible stuff like examples and palettes in -# folders under inkstitch/ (see ../Makefile) so let's move the pyinstaller -# stuff into its own dir. -shopt -s dotglob -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 diff --git a/bin/build-distribution-archives b/bin/build-distribution-archives new file mode 100755 index 00000000..1015d246 --- /dev/null +++ b/bin/build-distribution-archives @@ -0,0 +1,27 @@ +# TRAVIS_BRANCH is the branch name or the name of the tag. +VERSION="$(echo ${TRAVIS_BRANCH} | tr / -)" +OS="${TRAVIS_OS_NAME}" +ARCH="$(uname -m)" + +cp -a images/examples palettes symbols fonts dist/inkstitch +cp -a icons locales print dist/inkstitch/bin + +if [ "$BUILD" = "osx" ]; then + cp -a electron/dist/mac dist/inkstitch/electron +else + cp -a electron/dist/*-unpacked dist/inkstitch/electron +fi + +for d in inx/*; do + lang=${d%.*} + lang=${lang#*/} + cp $d/*.inx dist + + cd dist + if [ "$BUILD" = "windows" ]; then + zip -r ../inkstitch-${VERSION}-win32-${lang}.zip * + else + tar zcf ../inkstitch-${VERSION}-${OS}-${ARCH}-$lang.tar.gz * + fi + cd .. +done \ No newline at end of file diff --git a/bin/build-python b/bin/build-python new file mode 100755 index 00000000..c740c782 --- /dev/null +++ b/bin/build-python @@ -0,0 +1,61 @@ +#!/bin/bash + +set -e + +site_packages="$(python -c "import os; print(os.path.dirname(os.__file__) + '/site-packages')")" + +if [ "$TRAVIS_OS_NAME" = "linux" -a "$BUILD" != "windows" ]; then + # pyinstaller misses these two + pyinstaller_args+="--add-binary /usr/lib/x86_64-linux-gnu/gio/modules/libgiolibproxy.so:. " + pyinstaller_args+="--add-binary /usr/lib/x86_64-linux-gnu/libproxy.so.1:. " +fi + +# This one's tricky. ink/stitch doesn't actually _use_ gi.repository.Gtk, +# but it does use GTK (through wxPython). pyinstaller has some special +# logic to handle GTK apps that is engaged when you import +# gi.repository.Gtk that pulls in things like themes, icons, etc. Without +# that, the Params dialog is unthemed and barely usable. This hidden +# import option is actually the only reason we had to install python-gi +# above! +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/share/extensions " + +# output useful debugging info that helps us trace library dependency issues +pyinstaller_args+="--log-level DEBUG " + +if [ "$BUILD" = "windows" ]; then + wine c:\\Python\\scripts\\pyinstaller.exe $pyinstaller_args inkstitch.py +else + # without the LD_LIBRARY_PATH, it seems that pyinstaller can't find all of + # wxpython's shared libraries + LD_LIBRARY_PATH="${site_packages}/wx" pyinstaller $pyinstaller_args --strip inkstitch.py; +fi + +# pyinstaller put a whole mess of libraries under dist/inkstitch. We'd like +# to put some more user-accessible stuff like examples and palettes in +# folders under inkstitch/ (see ../Makefile) so let's move the pyinstaller +# stuff into its own dir. +shopt -s dotglob +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