diff deploy/linux/deploy-appimage.sh @ 1898:8ce9fd471188 appimage

Further appdir layout fixes
author Chris Cannam
date Thu, 28 Jun 2018 11:48:12 +0100
parents fb9a63059d25
children 4b772833fe1c
line wrap: on
line diff
--- a/deploy/linux/deploy-appimage.sh	Thu Jun 28 11:44:50 2018 +0100
+++ b/deploy/linux/deploy-appimage.sh	Thu Jun 28 11:48:12 2018 +0100
@@ -25,13 +25,31 @@
 ldd /usr/lib/x86_64-linux-gnu/libpulse.so.0 || true
 
 add_dependencies() {
+
     local binary="$1"
-    for lib in $(ldd "$binary" | egrep '=> (/usr)?/lib/' | sed 's/^.*=> //' | sed 's/ .*$//' | grep -v 'libc.so' | grep -v 'libm.so'); do
+
+    for lib in $(ldd "$binary" | egrep '=> (/usr)?(/local)?/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"
+
+            # copy e.g. /usr/lib/pulseaudio/libpulsecommon-*.so up a
+            # level to something in the load path
+            last_element=$(basename $(dirname "$lib"))
+            case "$last_element" in
+                lib) ;;
+                *-gnu) ;;
+                *) cp -v "$targetdir/$lib" "$targetdir/$(dirname $(dirname $lib))"
+            esac
+            
             add_dependencies "$lib"
+            
         fi
     done
 }