# HG changeset patch # User Chris Cannam # Date 1530111428 -3600 # Node ID f8f3fa1b12865134d68256954a2e04f90ca58382 # Parent e288e2f5914e643e2c942d05cd7a18b9f4252e9a Recursive dependencies diff -r e288e2f5914e -r f8f3fa1b1286 deploy/linux/deploy-appimage.sh --- a/deploy/linux/deploy-appimage.sh Wed Jun 27 14:17:01 2018 +0100 +++ b/deploy/linux/deploy-appimage.sh Wed Jun 27 15:57:08 2018 +0100 @@ -22,10 +22,19 @@ cp "$program" "$checker" "$piper" "$targetdir"/usr/bin/ -for lib in $(ldd "$program" | grep '=> /usr/lib/' | sed 's/^.*=> //' | sed 's/ .*$//'); do - mkdir -p "$targetdir/$(dirname $lib)" - cp -L "$lib" "$targetdir/$lib" -done +add_dependencies() { + local binary="$1" + for lib in $(ldd "$binary" | grep '=> /usr/lib/' | sed 's/^.*=> //' | sed 's/ .*$//' | grep -v 'libc.so' | grep -v 'libm.so'); do + mkdir -p "$targetdir/$(dirname $lib)" + if [ ! -f "$targetdir/$lib" ]; then + cp -Lv "$lib" "$targetdir/$lib" + chmod +x "$targetdir/$lib" + add_dependencies "$lib" + fi + done +} + +add_dependencies "$program" cp "$program.desktop" "$targetdir/"