aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--GNUmakefile5
-rwxr-xr-xvis-single.sh14
3 files changed, 20 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 103b097..63eab3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
/dependency
/vis
/vis-menu
+/vis-single
*.css
*.gcda
*.gcno
diff --git a/GNUmakefile b/GNUmakefile
index dba2952..052c300 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -185,4 +185,9 @@ standalone: clean
CFLAGS="-I$(DEPS_INC) --static -Wl,--as-needed" LDFLAGS="-L$(DEPS_LIB)" CC=musl-gcc
PATH=$(DEPS_BIN):$$PATH $(MAKE)
+single: standalone
+ cp vis-single.sh vis-single
+ strip vis
+ tar c vis lua/ | gzip -9 >> vis-single
+
.PHONY: standalone local dependencies-common dependencies-local dependencies-clean
diff --git a/vis-single.sh b/vis-single.sh
new file mode 100755
index 0000000..b6ff69e
--- /dev/null
+++ b/vis-single.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+VISTMP="$(mktemp -d -p "${TMPDIR:-/tmp}" .vis-XXXXXX)"
+trap 'rm -rf "$VISTMP"' EXIT INT QUIT TERM HUP
+
+sed '1,/^__TAR_GZ_ARCHIVE_BELOW__$/d' "$0" | gzip -d | tar xC "$VISTMP"
+
+"$VISTMP/vis" "$@"
+
+exit $?
+
+__TAR_GZ_ARCHIVE_BELOW__