Fix memleak
[appimagekit/gsi.git] / build-appdir.sh
blobdf727d4002745603557c7478370ebbb9dbaff5cc
1 #!/bin/bash
3 set -e
4 set -x
6 # preparations
7 mkdir -p appdirs/
9 #######################################################################
11 # build AppImageTool AppDir
12 APPIMAGETOOL_APPDIR=appdirs/appimagetool.AppDir
14 rm -rf "$APPIMAGETOOL_APPDIR" || true
15 mkdir -p "$APPIMAGETOOL_APPDIR"/usr/{bin,lib/appimagekit}
16 cp -f install_prefix/usr/bin/appimagetool "$APPIMAGETOOL_APPDIR"/usr/bin
18 cp ../resources/AppRun "$APPIMAGETOOL_APPDIR"
19 cp install_prefix/usr/bin/appimagetool "$APPIMAGETOOL_APPDIR"/usr/bin/
20 cp install_prefix/usr/lib/appimagekit/mksquashfs "$APPIMAGETOOL_APPDIR"/usr/lib/appimagekit/
21 cp $(which desktop-file-validate) "$APPIMAGETOOL_APPDIR"/usr/bin/
22 cp $(which zsyncmake) "$APPIMAGETOOL_APPDIR"/usr/bin/
24 cp -f /usr/bin/file "$APPIMAGETOOL_APPDIR"/usr/bin
26 cp ../resources/appimagetool.desktop "$APPIMAGETOOL_APPDIR"
27 cp ../resources/appimagetool.svg "$APPIMAGETOOL_APPDIR"/appimagetool.svg
28 ln -s "$APPIMAGETOOL_APPDIR"/appimagetool.svg "$APPIMAGETOOL_APPDIR"/.DirIcon
29 mkdir -p "$APPIMAGETOOL_APPDIR"/usr/share/metainfo
30 cp ../resources/usr/share/metainfo/appimagetool.appdata.xml "$APPIMAGETOOL_APPDIR"/usr/share/metainfo/
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 else
42 cp /usr/lib/libffi.so.5 "$APPIMAGETOOL_APPDIR"/usr/lib/