changeset 300:7dd6795af5e6

Start updating build stuff for 1.5
author Chris Cannam
date Thu, 25 May 2017 14:17:53 +0100
parents c9be1a6f7d74
children 929e37acf0d9
files deploy/linux/deploy-deb.sh deploy/linux/docker/Dockerfile_v1.5_ubuntu1604 deploy/linux/docker/build.sh deploy/linux/fix-lintian-bits.sh
diffstat 4 files changed, 100 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/deploy/linux/deploy-deb.sh	Thu May 25 11:31:17 2017 +0100
+++ b/deploy/linux/deploy-deb.sh	Thu May 25 14:17:53 2017 +0100
@@ -1,6 +1,6 @@
 #!/bin/bash
 # 
-# Run this from the build root
+# Run this from the build root (with sudo, I think)
 
 usage() {
     echo
@@ -20,6 +20,8 @@
     usage
 fi
 
+set -eu
+
 program=sonic-annotator
 depdir=deploy/linux
 
@@ -54,5 +56,5 @@
 
 bash "$depdir"/fix-lintian-bits.sh "$targetdir"
 
-sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
+dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/Dockerfile_v1.5_ubuntu1604	Thu May 25 14:17:53 2017 +0100
@@ -0,0 +1,48 @@
+FROM ubuntu:16.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN apt-get update && \
+    apt-get install -y \
+    build-essential \
+    libbz2-dev \
+    libfftw3-dev \
+    libfishsound1-dev \
+    libid3tag0-dev \
+    liblo-dev \
+    liblrdf0-dev \
+    libmad0-dev \
+    liboggz2-dev \
+    libpulse-dev \
+    libsamplerate-dev \
+    libsndfile-dev \
+    libsord-dev \
+    libxml2-utils \
+    portaudio19-dev \
+    qt5-default libqt5svg5-dev \
+    raptor-utils \
+    librubberband-dev \
+    git \
+    mercurial \
+    curl wget \
+    yajl-tools \
+    autoconf automake libtool lintian
+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 hg clone -rsonic-annotator-1.5 https://code.soundsoftware.ac.uk/hg/sonic-annotator
+RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-plugin-sdk
+RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-test-plugin
+WORKDIR vamp-plugin-sdk
+RUN ./configure
+RUN make -j3
+RUN mkdir ~/vamp
+RUN cp examples/vamp-example-plugins.so ~/vamp/
+WORKDIR ../vamp-test-plugin
+RUN make -f Makefile.linux
+RUN cp vamp-test-plugin.so ~/vamp/
+WORKDIR ../sonic-annotator
+RUN ./configure
+RUN make -j3
+RUN deploy/linux/deploy-deb.sh 1.5 amd64
+RUN tar cvf output.tar *.deb && cp output.tar ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/build.sh	Thu May 25 14:17:53 2017 +0100
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+version=$(perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h | sed 's/-//g')
+
+dockerdir=./deploy/linux/docker
+if [ ! -d "$dockerdir" ]; then
+    echo "Run this script from the build root"
+    exit 2
+fi
+
+platform="$1"
+
+if [ -z "$platform" ] || [ -n "$2" ]; then
+    echo "Usage: $0 <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/sonic-annotator-$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"
--- a/deploy/linux/fix-lintian-bits.sh	Thu May 25 11:31:17 2017 +0100
+++ b/deploy/linux/fix-lintian-bits.sh	Thu May 25 14:17:53 2017 +0100
@@ -4,6 +4,8 @@
 
 [ -d "$dir" ] || exit 1
 
+set -eu
+
 strip "$dir"/usr/bin/*
 
 sz=`du -sx --exclude DEBIAN "$dir" | awk '{ print $1; }'`
@@ -11,6 +13,6 @@
 
 find "$dir" -name \*~ -exec rm \{\} \;
 
-sudo chown -R root.root "$dir"/*
+chown -R root.root "$dir"/*
 
-sudo chmod -R g-w "$dir"/*
+chmod -R g-w "$dir"/*