summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2019-04-20 21:55:26 -0400
committerLex Neva <github.com@lexneva.name>2019-04-20 22:11:27 -0400
commit2c6adea15068ff828344c034142b74883fe6a9ae (patch)
treeca20a64a5073393f17bbc6fe3d40f8e5b1b78bca
parentd61b99891285ff879cbacdb8e23f9c025efc6a09 (diff)
refactor 'make dist' archive creation into a shell script
-rw-r--r--Makefile31
-rwxr-xr-xbin/build-distribution-archives27
-rwxr-xr-xbin/build-python (renamed from bin/build-dist)0
3 files changed, 29 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 2171d4f4..3cae9299 100644
--- a/Makefile
+++ b/Makefile
@@ -1,35 +1,8 @@
-EXTENSIONS:=inkstitch
-
-# This gets the branch name or the name of the tag
-VERSION:=$(subst /,-,$(TRAVIS_BRANCH))
-OS:=$(TRAVIS_OS_NAME)
-ARCH:=$(shell uname -m)
dist: locales inx
- bin/build-dist $(EXTENSIONS)
+ bin/build-python
bin/build-electron
- cp -a images/examples dist/inkstitch
- cp -a palettes dist/inkstitch
- cp -a symbols dist/inkstitch
- cp -a fonts dist/inkstitch
- cp -a icons dist/inkstitch/bin
- cp -a locales dist/inkstitch/bin
- cp -a 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; \
- if [ "$$BUILD" = "windows" ]; then \
- cd dist; zip -r ../inkstitch-$(VERSION)-win32-$$lang.zip *; cd ..; \
- else \
- cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH)-$$lang.tar.gz *; cd ..; \
- fi; \
- done
+ bin/build-distribution-archives
distclean:
rm -rf build dist inx locales *.spec *.tar.gz *.zip electron/node_modules electron/dist
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-dist b/bin/build-python
index c740c782..c740c782 100755
--- a/bin/build-dist
+++ b/bin/build-python