forked from AppImage/AppImageKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-appdir.sh
48 lines (38 loc) · 1.76 KB
/
build-appdir.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
set -x
#######################################################################
# build AppImageTool AppDir
APPIMAGETOOL_APPDIR=appdirs/appimagetool.AppDir
rm -rf "$APPIMAGETOOL_APPDIR" || true
# Run make install only for the 'appimagetool.AppImage' component to deploy appimagetools files to
# the $APPIMAGETOOL_APPDIR
DESTDIR="$APPIMAGETOOL_APPDIR" cmake -DCOMPONENT=appimagetool -P cmake_install.cmake
mkdir -p "$APPIMAGETOOL_APPDIR"/usr/lib/appimagekit/
# Copy AppDir specific files
cp ../resources/AppRun "$APPIMAGETOOL_APPDIR"
cp install_prefix/usr/lib/appimagekit/mksquashfs "$APPIMAGETOOL_APPDIR"/usr/lib/appimagekit/
# prefer binaries from /deps, if available
export PATH=/deps/bin:"$PATH"
cp $(which desktop-file-validate) "$APPIMAGETOOL_APPDIR"/usr/bin/
cp $(which zsyncmake) "$APPIMAGETOOL_APPDIR"/usr/bin/
cp ../resources/appimagetool.desktop "$APPIMAGETOOL_APPDIR"
cp ../resources/appimagetool.png "$APPIMAGETOOL_APPDIR"/appimagetool.png
cp "$APPIMAGETOOL_APPDIR"/appimagetool.png "$APPIMAGETOOL_APPDIR"/.DirIcon
if [ -d /deps/ ]; then
# deploy glib
mkdir -p "$APPIMAGETOOL_APPDIR"/usr/lib/
cp /deps/lib/lib*.so* "$APPIMAGETOOL_APPDIR"/usr/lib/
# libffi is a runtime dynamic dependency
# see this thread for more information on the topic:
# https://mail.gnome.org/archives/gtk-devel-list/2012-July/msg00062.html
if [ "$ARCH" == "x86_64" ]; then
cp /usr/lib64/libffi.so.5 "$APPIMAGETOOL_APPDIR"/usr/lib/
elif [ "$ARCH" == "i686" ]; then
cp /usr/lib/libffi.so.5 "$APPIMAGETOOL_APPDIR"/usr/lib/
elif [ "$ARCH" == "armhf" ] || [ "$ARCH" == "aarch64" ]; then
cp /deps/lib/libffi.so.6 "$APPIMAGETOOL_APPDIR"/usr/lib/
else
echo "WARNING: unknown architecture, not bundling libffi"
fi
fi