changeset 1898:8ce9fd471188 appimage

Further appdir layout fixes
author Chris Cannam
date Thu, 28 Jun 2018 11:48:12 +0100
parents 3601e46f21f4
children 1c2661987b61
files deploy/linux/deploy-appimage.sh
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
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
 }