]>
Commit | Line | Data |
---|---|---|
54207903 | 1 | #!/bin/bash |
3d2ed47b UH |
2 | ## |
3 | ## Copyright (C) 2016 Simon Peter | |
4 | ## Copyright (C) 2017 Uwe Hermann <uwe@hermann-uwe.de> | |
5 | ## This file is licensed under the terms of the MIT license. | |
6 | ## | |
54207903 | 7 | |
3d2ed47b UH |
8 | # Bundle PulseView and its dependencies as an AppImage for x86_64 Linux. |
9 | # Note: This assumes the full sigrok stack has been installed into $PREFIX. | |
54207903 | 10 | |
3d2ed47b | 11 | PREFIX=$HOME/sr |
54207903 | 12 | |
a8115a71 UH |
13 | APPIMAGEKIT_OUTDIR=$HOME/AppImageKit/out |
14 | ||
54207903 | 15 | ARCH=x86_64 |
16 | ||
a8115a71 UH |
17 | ######################################################################## |
18 | # You usually don't have to change anything below this line | |
19 | ######################################################################## | |
20 | ||
3d2ed47b UH |
21 | APP=PulseView |
22 | LOWERAPP=${APP,,} | |
23 | ||
a8115a71 UH |
24 | export STATIC_FILES=`pwd`/contrib |
25 | ||
26 | # Add $APPIMAGEKIT_OUTDIR so we can find all the binaries there. | |
27 | export PATH=$APPIMAGEKIT_OUTDIR:$PATH | |
28 | ||
3d2ed47b UH |
29 | A="./$APP/$APP.AppDir" |
30 | mkdir -p $A/usr/bin $A/usr/lib $A/usr/share | |
54207903 | 31 | cd ./$APP |
32 | ||
9cacd19e | 33 | . $STATIC_FILES/functions.sh |
54207903 | 34 | |
35 | ######################################################################## | |
3d2ed47b | 36 | # Get build products from $PREFIX |
54207903 | 37 | ######################################################################## |
38 | ||
54207903 | 39 | cd $APP.AppDir/ |
40 | ||
3d2ed47b | 41 | cp $PREFIX/bin/pulseview usr/bin/ |
54207903 | 42 | chmod a+x usr/bin/* |
3d2ed47b UH |
43 | cp $PREFIX/lib/lib*.so* usr/lib/ |
44 | cp -r $PREFIX/share/libsigrokdecode usr/share/ | |
45 | cp -r $PREFIX/share/sigrok-firmware usr/share/ | |
54207903 | 46 | |
47 | # Reduce binary size | |
48 | strip usr/bin/* | |
49 | strip usr/lib/* | |
50 | ||
51 | ######################################################################## | |
52 | # AppRun is the main launcher that gets executed when AppImage is run | |
53 | ######################################################################## | |
54 | ||
a8115a71 | 55 | cp $APPIMAGEKIT_OUTDIR/AppRun . |
54207903 | 56 | |
57 | ######################################################################## | |
58 | # Copy desktop and icon file to AppDir for AppRun to pick them up | |
59 | ######################################################################## | |
60 | ||
9cacd19e UH |
61 | cp $STATIC_FILES/pulseview.desktop . |
62 | cp $STATIC_FILES/sigrok-logo-notext.png . | |
54207903 | 63 | |
54207903 | 64 | ######################################################################## |
65 | # Copy in the dependencies that cannot be assumed to be available | |
66 | # on all target systems | |
67 | ######################################################################## | |
68 | ||
54207903 | 69 | copy_deps |
70 | ||
9b458ff9 UH |
71 | # Get all Qt5 plugins (won't be copied automatically). |
72 | QT5PLUGINS=/usr/lib/x86_64-linux-gnu/qt5/plugins # Host (+ AppRun) path. | |
73 | mkdir -p .$QT5PLUGINS | |
74 | cp -r $QT5PLUGINS/accessible .$QT5PLUGINS | |
75 | cp -r $QT5PLUGINS/generic .$QT5PLUGINS | |
76 | cp -r $QT5PLUGINS/iconengines .$QT5PLUGINS | |
77 | cp -r $QT5PLUGINS/imageformats .$QT5PLUGINS | |
78 | cp -r $QT5PLUGINS/platforminputcontexts .$QT5PLUGINS | |
79 | cp -r $QT5PLUGINS/platforms .$QT5PLUGINS | |
80 | ||
54207903 | 81 | ######################################################################## |
82 | # Delete stuff that should not go into the AppImage | |
83 | ######################################################################## | |
84 | ||
54207903 | 85 | move_lib |
86 | mv ./usr/lib/x86_64-linux-gnu/* usr/lib/ | |
87 | rm -r ./usr/lib/x86_64-linux-gnu/ | |
88 | ||
e163385a UH |
89 | delete_blacklisted |
90 | ||
3d2ed47b UH |
91 | # Remove some incorrectly/unintentionally copied files. |
92 | rm -r ./home | |
93 | ||
54207903 | 94 | ######################################################################## |
95 | # Determine the version of the app; also include needed glibc version | |
96 | ######################################################################## | |
97 | ||
3d2ed47b | 98 | VER1="NIGHTLY" |
54207903 | 99 | GLIBC_NEEDED=$(glibc_needed) |
100 | VERSION=$VER1.glibc$GLIBC_NEEDED | |
101 | echo $VERSION | |
102 | ||
103 | ######################################################################## | |
104 | # Patch away absolute paths; it would be nice if they were relative | |
105 | ######################################################################## | |
106 | ||
8fa1956a | 107 | find usr/ -type f -executable -exec sed -i -e "s|/usr|././|g" {} \; |
54207903 | 108 | |
109 | ######################################################################## | |
110 | # AppDir complete | |
111 | # Now packaging it as an AppImage | |
112 | ######################################################################## | |
113 | ||
114 | cd .. | |
115 | ||
837d376b UH |
116 | VERSION=$VERSION $APPIMAGEKIT_OUTDIR/appimagetool ./$APP.AppDir/ |
117 | mkdir -p ../out/ || true | |
118 | mv *.AppImage* ../out/ |