-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild-appimage.sh
executable file
·62 lines (43 loc) · 1.49 KB
/
build-appimage.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /bin/bash
set -euxo pipefail
# use RAM disk if possible
if [ "${CI:-}" == "" ] && [ -d /docker-ramdisk ]; then
TEMP_BASE=/docker-ramdisk
else
TEMP_BASE=/tmp
fi
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" linuxdeploy-plugin-appimage-build-XXXXXX)
cleanup() {
if [ -d "$BUILD_DIR" ]; then
rm -rf "$BUILD_DIR"
fi
}
trap cleanup EXIT
# store repo root as variable
REPO_ROOT=$(readlink -f $(dirname $(dirname "$0")))
OLD_CWD=$(readlink -f .)
pushd "$BUILD_DIR"
case "$ARCH" in
x86_64|i386|aarch64|armhf)
;;
*)
echo "Architecture not supported: $ARCH" 1>&2
exit 1
;;
esac
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j$(nproc)
make install DESTDIR=AppDir
AIK_ARCH="$ARCH"
[ "$ARCH" == "i386" ] && AIK_ARCH="i686"
bash "$REPO_ROOT"/ci/build-bundle.sh
mv linuxdeploy-plugin-appimage-bundle AppDir
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
chmod +x linuxdeploy-"$ARCH".AppImage
export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy-plugin-appimage|continuous|linuxdeploy-plugin-appimage-$ARCH.AppImage"
# deploy linuxdeploy-plugin-appimage
./linuxdeploy-"$ARCH".AppImage --appimage-extract-and-run \
--appdir AppDir -d "$REPO_ROOT"/resources/linuxdeploy-plugin-appimage.desktop \
-i "$REPO_ROOT"/resources/linuxdeploy-plugin-appimage.svg
AppDir/AppRun --appdir AppDir
mv linuxdeploy-plugin-appimage*.AppImage* "$OLD_CWD"/