annotate deploy/linux/deploy-appimage.sh @ 1883:033fcd33e125 appimage

Experimental AppImage package
author Chris Cannam
date Tue, 26 Jun 2018 18:02:21 +0100
parents
children f8f3fa1b1286
rev   line source
Chris@1883 1 #!/bin/bash
Chris@1883 2
Chris@1883 3 set -eu
Chris@1883 4
Chris@1883 5 program=sonic-visualiser
Chris@1883 6 checker=vamp-plugin-load-checker
Chris@1883 7 piper=piper-vamp-simple-server
Chris@1883 8
Chris@1883 9 targetdir="${program}.AppDir"
Chris@1883 10
Chris@1883 11 echo "Target dir is $targetdir"
Chris@1883 12
Chris@1883 13 if [ -d "$targetdir" ]; then
Chris@1883 14 echo "Target directory exists, not overwriting"
Chris@1883 15 exit
Chris@1883 16 fi
Chris@1883 17
Chris@1883 18 mkdir "$targetdir"
Chris@1883 19
Chris@1883 20 mkdir -p "$targetdir"/usr/bin
Chris@1883 21 mkdir -p "$targetdir"/usr/lib
Chris@1883 22
Chris@1883 23 cp "$program" "$checker" "$piper" "$targetdir"/usr/bin/
Chris@1883 24
Chris@1883 25 for lib in $(ldd "$program" | grep '=> /usr/lib/' | sed 's/^.*=> //' | sed 's/ .*$//'); do
Chris@1883 26 mkdir -p "$targetdir/$(dirname $lib)"
Chris@1883 27 cp -L "$lib" "$targetdir/$lib"
Chris@1883 28 done
Chris@1883 29
Chris@1883 30 cp "$program.desktop" "$targetdir/"
Chris@1883 31
Chris@1883 32 cp "icons/sv-icon.svg" "$targetdir/"
Chris@1883 33
Chris@1883 34 cp sv-dependency-builds/linux/appimage/AppRun-x86_64 "$targetdir/AppRun"
Chris@1883 35 chmod +x "$targetdir/AppRun"
Chris@1883 36
Chris@1883 37 ARCH=x86_64 sv-dependency-builds/linux/appimage/appimagetool-x86_64.AppImage "$targetdir"
Chris@1883 38