changeset 2116:f69819b5c248

Experimental Docker deb package build
author Chris Cannam
date Wed, 21 Nov 2018 11:25:43 +0000
parents 708ae77f5b78
children 36058862e1ce
files deploy/linux/build-and-test-appimage.sh deploy/linux/build-and-test-deb.sh deploy/linux/docker/Dockerfile_appimage.in deploy/linux/docker/Dockerfile_deb.in deploy/linux/docker/Dockerfile_test_deb.in
diffstat 5 files changed, 110 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/deploy/linux/build-and-test-appimage.sh	Fri Nov 16 14:32:41 2018 +0000
+++ b/deploy/linux/build-and-test-appimage.sh	Wed Nov 21 11:25:43 2018 +0000
@@ -33,9 +33,9 @@
 
 container=$(sudo docker create "$dockertag")
 
-sudo docker cp "$container":output.tar "$outdir"
+sudo docker cp "$container":output-appimage.tar "$outdir"
 sudo docker rm "$container"
 
-( cd "$outdir" ; tar xf output.tar && rm -f output.tar )
+( cd "$outdir" ; tar xf output-appimage.tar && rm -f output-appimage.tar )
 
 sudo docker build -f "$dockerdir"/Dockerfile_test_appimage.gen "$dockerdir"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/build-and-test-deb.sh	Wed Nov 21 11:25:43 2018 +0000
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# Docker required
+
+set -eu
+
+current=$(hg id | awk '{ print $1; }')
+release=$(perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h)
+
+case "$current" in
+    *+) echo "ERROR: Current working copy has been modified - unmodified copy required so we know we can check it out separately and obtain the same contents"; exit 2;;
+    *);;
+esac
+
+echo
+echo "Building Debian deb archive from revision $current..."
+
+dockerdir=deploy/linux/docker
+
+cat "$dockerdir"/Dockerfile_deb.in | \
+    perl -p -e "s/\[\[REVISION\]\]/$current/g" | \
+    perl -p -e "s/\[\[RELEASE\]\]/$release/g" > \
+         "$dockerdir"/Dockerfile_deb.gen
+
+cat "$dockerdir"/Dockerfile_test_deb.in | \
+    perl -p -e "s/\[\[REVISION\]\]/$current/g" | \
+    perl -p -e "s/\[\[RELEASE\]\]/$release/g" > \
+         "$dockerdir"/Dockerfile_test_deb.gen
+
+dockertag="cannam/sonic-visualiser-deb-$current"
+
+sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile_deb.gen "$dockerdir"
+
+outdir="$dockerdir/output"
+mkdir -p "$outdir"
+
+container=$(sudo docker create "$dockertag")
+
+sudo docker cp "$container":output-deb.tar "$outdir"
+sudo docker rm "$container"
+
+( cd "$outdir" ; tar xf output-deb.tar && rm -f output-deb.tar )
+
+sudo docker build -f "$dockerdir"/Dockerfile_test_deb.gen "$dockerdir"
--- a/deploy/linux/docker/Dockerfile_appimage.in	Fri Nov 16 14:32:41 2018 +0000
+++ b/deploy/linux/docker/Dockerfile_appimage.in	Wed Nov 21 11:25:43 2018 +0000
@@ -66,4 +66,4 @@
 RUN make -j3
 
 RUN deploy/linux/deploy-appimage.sh
-RUN tar cvf output.tar *.AppImage && cp output.tar ..
+RUN tar cvf output-appimage.tar *.AppImage && cp output-appimage.tar ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/Dockerfile_deb.in	Wed Nov 21 11:25:43 2018 +0000
@@ -0,0 +1,57 @@
+# This pulls the latest versions of capnp & SV from repos - so you
+# will need to defeat the Docker cache by destroying the container
+# each time you want to update it
+#
+FROM ubuntu:14.04
+MAINTAINER Chris Cannam <cannam@all-day-breakfast.com>
+RUN apt-get update && \
+    apt-get install -y \
+    software-properties-common \
+    build-essential \
+    libbz2-dev \
+    libfftw3-dev \
+    libfishsound1-dev \
+    libid3tag0-dev \
+    liblo-dev \
+    liblrdf0-dev \
+    libmad0-dev \
+    liboggz2-dev \
+    libpulse-dev \
+    libasound2-dev \
+    libjack-dev \
+    libsamplerate-dev \
+    libsndfile-dev \
+    libsord-dev \
+    libxml2-utils \
+    libgl1-mesa-dev \
+    raptor-utils \
+    librubberband-dev \
+    portaudio19-dev \
+    qt5-default libqt5svg5-dev \
+    git \
+    mercurial \
+    curl wget \
+    mlton \
+    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 -r[[REVISION]] https://code.soundsoftware.ac.uk/hg/sonic-visualiser
+
+RUN git clone https://github.com/sandstorm-io/capnproto
+WORKDIR capnproto
+RUN git checkout v0.6.1
+WORKDIR c++
+RUN autoreconf -i && ./configure && make -j3 && make install
+
+WORKDIR ../../sonic-visualiser
+RUN ./configure
+RUN make -j3
+
+RUN deploy/linux/deploy-deb.sh [[RELEASE]]cc1-1 amd64
+RUN tar cvf output-deb.tar *.deb && cp output-deb.tar ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/docker/Dockerfile_test_deb.in	Wed Nov 21 11:25:43 2018 +0000
@@ -0,0 +1,6 @@
+FROM ubuntu:18.04
+RUN apt-get update
+ADD output/sonic-visualiser_[[RELEASE]]_amd64.deb SV.AppImage
+RUN apt install sonic-visualiser*.deb
+RUN /usr/bin/sonic-visualiser --version
+