comparison deploy/linux/deploy-appimage.sh @ 1915:61ef30fb141c

Slightly different tack
author Chris Cannam
date Sun, 01 Jul 2018 10:15:49 +0100
parents 12b96d6b1d66
children 55241126e0e4
comparison
equal deleted inserted replaced
1914:0bef3c4cab62 1915:61ef30fb141c
39 39
40 add_dependencies() { 40 add_dependencies() {
41 41
42 local binary="$1" 42 local binary="$1"
43 43
44 for lib in $(ldd "$binary" | egrep '=> (/usr)?(/local)?/lib/' | \ 44 echo "ldd $binary yields:"
45 ldd "$binary"
46
47 for lib in $(ldd "$binary" | grep '=> [^ ]*/lib/' | \
45 sed 's/^.*=> //' | sed 's/ .*$//'); do 48 sed 's/^.*=> //' | sed 's/ .*$//'); do
46 49
47 base=$(basename "$lib") 50 base=$(basename "$lib")
48 if grep -v '^#' sv-dependency-builds/linux/appimage/excludelist | 51 if grep -v '^#' sv-dependency-builds/linux/appimage/excludelist |
49 grep -q "^$base$" ; then 52 grep -q "^$base$" ; then
50 # echo "excluding: $lib" 53 echo "excluding: $lib"
51 continue 54 continue
52 fi 55 fi
56
57 target="$targetdir/usr/lib/$(basename $lib)"
53 58
54 mkdir -p "$targetdir/$(dirname $lib)" 59 mkdir -p "$(dirname $target)"
55 60
56 if [ ! -f "$targetdir/$lib" ]; then 61 if [ ! -f "$target" ]; then
57 62
58 cp -Lv "$lib" "$targetdir/$lib" 63 cp -Lv "$lib" "$target"
59 chmod +x "$targetdir/$lib" 64 chmod +x "$target"
60 65
61 # copy e.g. /usr/lib/pulseaudio/libpulsecommon-*.so up a 66 # # copy e.g. /usr/lib/pulseaudio/libpulsecommon-*.so up a
62 # level to something in the load path 67 # # level to something in the load path
63 last_element=$(basename $(dirname "$lib")) 68 # last_element=$(basename $(dirname "$lib"))
64 case "$last_element" in 69 # case "$last_element" in
65 lib) ;; 70 # lib) ;;
66 *-gnu) ;; 71 # *-gnu) ;;
67 *) cp -v "$targetdir/$lib" "$targetdir/$(dirname $(dirname $lib))" 72 # *) cp -v "$targetdir/$lib" "$targetdir/$(dirname $(dirname $lib))"
68 esac 73 # esac
69 74
70 add_dependencies "$lib" 75 add_dependencies "$lib"
71 76
72 fi 77 fi
73 done 78 done
74 } 79 }
75 80
76 add_dependencies "$program" 81 add_dependencies "$program"
82 add_dependencies "$checker"
83 add_dependencies "$piper"
77 84
78 cp -v "$targetdir/usr/local/lib/"* "$targetdir/usr/lib/" 85 #cp -v "$targetdir/usr/local/lib/"* "$targetdir/usr/lib/"
79 86
80 qtplugins="gif icns ico jpeg tga tiff wbmp webp cocoa minimal offscreen xcb" 87 qtplugins="gif icns ico jpeg tga tiff wbmp webp cocoa minimal offscreen xcb"
81 qtlibdirs="/usr/lib/x86_64-linux-gnu/qt5 /usr/lib/x86_64-linux-gnu/qt /usr/lib/qt5 /usr/lib/qt" 88 qtlibdirs="/usr/lib/x86_64-linux-gnu/qt5 /usr/lib/x86_64-linux-gnu/qt /usr/lib/qt5 /usr/lib/qt"
82 89
83 QTDIR=${QTDIR:-} 90 QTDIR=${QTDIR:-}
88 for plug in $qtplugins; do 95 for plug in $qtplugins; do
89 for libdir in $qtlibdirs; do 96 for libdir in $qtlibdirs; do
90 lib=$(find $libdir/plugins -name libq$plug.so -print 2>/dev/null || true) 97 lib=$(find $libdir/plugins -name libq$plug.so -print 2>/dev/null || true)
91 if [ -n "$lib" ]; then 98 if [ -n "$lib" ]; then
92 if [ -f "$lib" ]; then 99 if [ -f "$lib" ]; then
93 mkdir -p "$targetdir/$(dirname $lib)" 100 target="$targetdir/usr/lib/qt5/plugins/$(basename $lib)"
94 cp -v "$lib" "$targetdir/$lib" 101 mkdir -p "$(dirname $target)"
95 chmod +x "$targetdir/$lib" 102 cp -v "$lib" "$target"
103 chmod +x "$target"
96 add_dependencies "$lib" 104 add_dependencies "$lib"
97 break 105 break
98 fi 106 fi
99 fi 107 fi
100 done 108 done