Add downloads badge
[appimagekit/gsi.git] / build-appdir.sh
blob51cce0dd9cd7e5b871d9c0a21101d40e20d645bd
1 #!/bin/bash
3 set -e
4 set -x
7 #######################################################################
9 # build AppImageTool AppDir
10 APPIMAGETOOL_APPDIR=appdirs/appimagetool.AppDir
12 rm -rf "$APPIMAGETOOL_APPDIR" || true
14 # Run make install only for the 'appimagetool.AppImage' component to deploy appimagetools files to
15 # the $APPIMAGETOOL_APPDIR
16 DESTDIR="$APPIMAGETOOL_APPDIR" cmake -DCOMPONENT=appimagetool -P cmake_install.cmake
18 mkdir -p "$APPIMAGETOOL_APPDIR"/usr/lib/appimagekit/
20 # Copy AppDir specific files
21 cp ../resources/AppRun "$APPIMAGETOOL_APPDIR"
22 cp install_prefix/usr/lib/appimagekit/mksquashfs "$APPIMAGETOOL_APPDIR"/usr/lib/appimagekit/
23 # prefer binaries from /deps, if available
24 export PATH=/deps/bin:"$PATH"
25 cp $(which desktop-file-validate) "$APPIMAGETOOL_APPDIR"/usr/bin/
26 cp $(which zsyncmake) "$APPIMAGETOOL_APPDIR"/usr/bin/
28 cp ../resources/appimagetool.desktop "$APPIMAGETOOL_APPDIR"
29 cp ../resources/appimagetool.svg "$APPIMAGETOOL_APPDIR"/appimagetool.svg
30 ln -s "$APPIMAGETOOL_APPDIR"/appimagetool.svg "$APPIMAGETOOL_APPDIR"/.DirIcon
32 if [ -d /deps/ ]; then
33 # deploy glib
34 mkdir -p "$APPIMAGETOOL_APPDIR"/usr/lib/
35 cp /deps/lib/lib*.so* "$APPIMAGETOOL_APPDIR"/usr/lib/
36 # libffi is a runtime dynamic dependency
37 # see this thread for more information on the topic:
38 # https://mail.gnome.org/archives/gtk-devel-list/2012-July/msg00062.html
39 if [ "$ARCH" == "x86_64" ]; then
40 cp /usr/lib64/libffi.so.5 "$APPIMAGETOOL_APPDIR"/usr/lib/
41 elif [ "$ARCH" == "i686" ]; then
42 cp /usr/lib/libffi.so.5 "$APPIMAGETOOL_APPDIR"/usr/lib/
43 elif [ "$ARCH" == "armhf" ] || [ "$ARCH" == "aarch64" ]; then
44 cp /deps/lib/libffi.so.6 "$APPIMAGETOOL_APPDIR"/usr/lib/
45 else
46 echo "WARNING: unknown architecture, not bundling libffi"