diff dockerbuild.sh @ 106:76badb3a0bb3 vampy-2.1

Add mechanism to build a "standard" Linux .so using Docker
author Chris Cannam
date Tue, 05 Feb 2019 12:48:59 +0000
parents
children 169e04e81ea0
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dockerbuild.sh	Tue Feb 05 12:48:59 2019 +0000
@@ -0,0 +1,32 @@
+#!/bin/bash
+#
+# Docker required!
+
+set -eu
+
+current=$(hg id | awk '{ print $1; }')
+
+case "$current" in
+    *+) echo "WARNING: Current working copy has been modified - build will check out the last commit, which must perforce be different";;
+    *);;
+esac
+
+current=${current%%+}
+
+rm -f vampy.so
+
+cat Dockerfile.in | perl -p -e 's/\[\[REVISION\]\]/'"$current"'/' > Dockerfile
+
+dockertag="cannam/vampy-$current"
+
+sudo docker build -t "$dockertag" -f Dockerfile .
+
+container=$(sudo docker create "$dockertag")
+sudo docker cp "$container":vampy/vampy.so .
+sudo docker rm "$container"
+
+ldd vampy.so
+VAMP_PATH=".:./Example VamPy plugins" ../vamp-plugin-sdk/host/vamp-simple-host -l
+
+echo "Done!"
+