changeset 491:124752918a1b vamp-plugin-sdk-v2.7

Add Docker build scripts
author Chris Cannam
date Fri, 24 Feb 2017 15:45:50 +0000
parents 703da7b180e8
children fb3e0ca3e700
files build/docker/Dockerfile_v2.7_ubuntu1404 build/docker/Dockerfile_v2.7_ubuntu1604 build/docker/build.sh
diffstat 3 files changed, 95 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/docker/Dockerfile_v2.7_ubuntu1404	Fri Feb 24 15:45:50 2017 +0000
@@ -0,0 +1,26 @@
+FROM ubuntu:14.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN apt-get update && \
+    apt-get install -y \
+    build-essential \
+    libsndfile-dev \
+    git \
+    mercurial
+RUN gcc --version
+RUN apt-get clean && rm -rf /var/lib/apt/lists/*
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8  
+ENV LANGUAGE en_US:en  
+ENV LC_ALL en_US.UTF-8
+RUN git clone --branch vamp-plugin-sdk-v2.7 https://github.com/c4dm/vamp-plugin-sdk
+RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-test-plugin
+WORKDIR vamp-plugin-sdk
+RUN ./configure && make
+WORKDIR ../vamp-test-plugin
+RUN make -f Makefile.linux
+WORKDIR ../vamp-plugin-sdk
+RUN test/run-test-plugin-regression.sh
+RUN mkdir vamp-plugin-sdk-2.7-binaries-amd64-gcc4-linux
+RUN cp libvamp-sdk.a libvamp-hostsdk.a host/vamp-simple-host rdf/generator/vamp-rdf-template-generator vamp-plugin-sdk-2.7-binaries-amd64-gcc4-linux
+RUN tar cvzf vamp-plugin-sdk-2.7-binaries-amd64-gcc4-linux.tar.gz vamp-plugin-sdk-2.7-binaries-amd64-gcc4-linux
+RUN tar cvf output.tar *.tar.gz && cp output.tar ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/docker/Dockerfile_v2.7_ubuntu1604	Fri Feb 24 15:45:50 2017 +0000
@@ -0,0 +1,26 @@
+FROM ubuntu:16.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN apt-get update && \
+    apt-get install -y \
+    build-essential \
+    libsndfile-dev \
+    git \
+    mercurial
+RUN gcc --version
+RUN apt-get clean && rm -rf /var/lib/apt/lists/*
+RUN locale-gen en_US.UTF-8
+ENV LANG en_US.UTF-8  
+ENV LANGUAGE en_US:en  
+ENV LC_ALL en_US.UTF-8
+RUN git clone --branch vamp-plugin-sdk-v2.7 https://github.com/c4dm/vamp-plugin-sdk
+RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-test-plugin
+WORKDIR vamp-plugin-sdk
+RUN ./configure && make
+WORKDIR ../vamp-test-plugin
+RUN make -f Makefile.linux
+WORKDIR ../vamp-plugin-sdk
+RUN test/run-test-plugin-regression.sh
+RUN mkdir vamp-plugin-sdk-2.7-binaries-amd64-gcc5-linux
+RUN cp libvamp-sdk.a libvamp-hostsdk.a host/vamp-simple-host rdf/generator/vamp-rdf-template-generator vamp-plugin-sdk-2.7-binaries-amd64-gcc5-linux
+RUN tar cvzf vamp-plugin-sdk-2.7-binaries-amd64-gcc5-linux.tar.gz vamp-plugin-sdk-2.7-binaries-amd64-gcc5-linux
+RUN tar cvf output.tar *.tar.gz && cp output.tar ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/docker/build.sh	Fri Feb 24 15:45:50 2017 +0000
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+dockerdir=./build/docker
+if [ ! -d "$dockerdir" ]; then
+    echo "Run this script from the build root"
+    exit 2
+fi
+
+version="$1"
+platform="$2"
+
+if [ -z "$platform" ] || [ -z "$version" ] || [ -n "$3" ]; then
+    echo "Usage: $0 <version> <platform>"
+    echo "where <platform> matches the suffix of the Docker file, e.g. ubuntu1604"
+    exit 2
+fi
+
+set -eu
+
+echo "Building for version $version, platform $platform"
+dockerfile="Dockerfile_v${version}_${platform}"
+
+if [ ! -f "$dockerdir/$dockerfile" ]; then
+    echo "No matching docker file $dockerfile found in $dockerdir"
+    exit 1
+fi
+
+dockertag="cannam/vamp-plugin-sdk-$platform"
+
+sudo docker build -t "$dockertag" -f "$dockerdir/$dockerfile" "$dockerdir"
+
+outdir="$dockerdir/output"
+mkdir -p "$outdir"
+
+container=$(sudo docker create "$dockertag")
+sudo docker cp "$container":output.tar "$outdir"
+sudo docker rm "$container"
+
+( cd "$outdir" ; tar xf output.tar && rm -f output.tar )
+
+echo
+echo "Done, output directory contains:"
+ls -ltr "$outdir"