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.
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.
13 APPIMAGEKIT_OUTDIR
=$HOME/AppImageKit
/out
19 ########################################################################
20 # You usually don't have to change anything below this line
21 ########################################################################
26 export STATIC_FILES
=`pwd`/contrib
28 # Add $APPIMAGEKIT_OUTDIR so we can find all the binaries there.
29 export PATH
=$APPIMAGEKIT_OUTDIR:$PATH
31 A
="./$APP/$APP.AppDir"
32 mkdir
-p $A/usr
/bin
$A/usr
/lib
$A/usr
/share
35 .
$STATIC_FILES/functions.sh
37 ########################################################################
38 # Get build products from $PREFIX
39 ########################################################################
43 cp $PREFIX/bin
/pulseview usr
/bin
/
45 cp $PREFIX/lib
/lib
*.so
* usr
/lib
/
46 cp -r $PREFIX/share
/libsigrokdecode usr
/share
/
47 cp -r $PREFIX/share
/sigrok-firmware usr
/share
/
48 cp -r $PREFIX/share
/applications usr
/share
/
49 cp -r $PREFIX/share
/icons usr
/share
/
50 cp -r $PREFIX/share
/metainfo usr
/share
/
51 cp -r $PREFIX/share
/mime usr
/share
/
57 ########################################################################
58 # AppRun is the main launcher that gets executed when AppImage is run
59 ########################################################################
61 cp $APPIMAGEKIT_OUTDIR/AppRun .
63 ########################################################################
64 # Copy desktop and icon file to AppDir for AppRun to pick them up
65 ########################################################################
67 cp usr
/share
/applications
/*.desktop .
68 cp usr
/share
/icons
/hicolor
/48x48
/apps
/pulseview.png .
70 ########################################################################
71 # Copy in the dependencies that cannot be assumed to be available
72 # on all target systems
73 ########################################################################
77 # Get all Qt5 plugins (won't be copied automatically).
78 QT5PLUGINS
=/usr
/lib
/x86_64-linux-gnu
/qt
5/plugins
# Host (+ AppRun) path.
80 cp -r $QT5PLUGINS/accessible .
$QT5PLUGINS
81 cp -r $QT5PLUGINS/generic .
$QT5PLUGINS
82 cp -r $QT5PLUGINS/iconengines .
$QT5PLUGINS
83 cp -r $QT5PLUGINS/imageformats .
$QT5PLUGINS
84 cp -r $QT5PLUGINS/platforminputcontexts .
$QT5PLUGINS
85 cp -r $QT5PLUGINS/platforms .
$QT5PLUGINS
87 # Get some additional dependencies of the Qt5 plugins.
88 ldd .
$QT5PLUGINS/platforms
/libqxcb.so |
grep "=>" |
awk '{print $3}' |
xargs -I '{}' cp -v '{}' .
/usr
/lib || true
89 ldd .
$QT5PLUGINS/imageformats
/libqsvg.so |
grep "=>" |
awk '{print $3}' |
xargs -I '{}' cp -v '{}' .
/usr
/lib || true
92 cp /usr
/lib
/x86_64-linux-gnu
/libpython
$PYVER* .
/usr
/lib
93 mkdir
-p .
/usr
/share
/pyshared
94 cp -r /usr
/lib
/python
$PYVER/* .
/usr
/share
/pyshared
# AppRun expects this path.
96 cp -r .
/usr
/share
/pyshared
/plat-x86_64-linux-gnu
/* .
/usr
/share
/pyshared
98 ########################################################################
99 # Delete stuff that should not go into the AppImage
100 ########################################################################
103 mv .
/usr
/lib
/x86_64-linux-gnu
/* usr
/lib
/
104 rm -r .
/usr
/lib
/x86_64-linux-gnu
/
108 # Remove some incorrectly/unintentionally copied files.
111 ########################################################################
112 # Determine the version of the app; also include needed glibc version
113 ########################################################################
116 GLIBC_NEEDED
=$
(glibc_needed
)
117 VERSION
=$VER1.glibc
$GLIBC_NEEDED
120 ########################################################################
121 # Patch away absolute paths; it would be nice if they were relative
122 ########################################################################
124 find usr
/ -type f
-executable -exec sed -i -e "s|/usr|././|g" {} \
;
126 ########################################################################
128 # Now packaging it as an AppImage
129 ########################################################################
133 VERSION
=$VERSION $APPIMAGEKIT_OUTDIR/appimagetool .
/$APP.AppDir
/
134 mkdir
-p ..
/out
/ || true
135 mv *.AppImage
* ..
/out
/