comparison 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
comparison
equal deleted inserted replaced
1897:3601e46f21f4 1898:8ce9fd471188
23 cp "$program" "$checker" "$piper" "$targetdir"/usr/bin/ 23 cp "$program" "$checker" "$piper" "$targetdir"/usr/bin/
24 24
25 ldd /usr/lib/x86_64-linux-gnu/libpulse.so.0 || true 25 ldd /usr/lib/x86_64-linux-gnu/libpulse.so.0 || true
26 26
27 add_dependencies() { 27 add_dependencies() {
28
28 local binary="$1" 29 local binary="$1"
29 for lib in $(ldd "$binary" | egrep '=> (/usr)?/lib/' | sed 's/^.*=> //' | sed 's/ .*$//' | grep -v 'libc.so' | grep -v 'libm.so'); do 30
31 for lib in $(ldd "$binary" | egrep '=> (/usr)?(/local)?/lib/' | \
32 sed 's/^.*=> //' | sed 's/ .*$//' | \
33 grep -v 'libc.so' | grep -v 'libm.so'); do
34
30 mkdir -p "$targetdir/$(dirname $lib)" 35 mkdir -p "$targetdir/$(dirname $lib)"
36
31 if [ ! -f "$targetdir/$lib" ]; then 37 if [ ! -f "$targetdir/$lib" ]; then
38
32 cp -Lv "$lib" "$targetdir/$lib" 39 cp -Lv "$lib" "$targetdir/$lib"
33 chmod +x "$targetdir/$lib" 40 chmod +x "$targetdir/$lib"
41
42 # copy e.g. /usr/lib/pulseaudio/libpulsecommon-*.so up a
43 # level to something in the load path
44 last_element=$(basename $(dirname "$lib"))
45 case "$last_element" in
46 lib) ;;
47 *-gnu) ;;
48 *) cp -v "$targetdir/$lib" "$targetdir/$(dirname $(dirname $lib))"
49 esac
50
34 add_dependencies "$lib" 51 add_dependencies "$lib"
52
35 fi 53 fi
36 done 54 done
37 } 55 }
38 56
39 add_dependencies "$program" 57 add_dependencies "$program"