-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathbuild-appimage.sh
More file actions
executable file
·57 lines (41 loc) · 1.47 KB
/
build-appimage.sh
File metadata and controls
executable file
·57 lines (41 loc) · 1.47 KB
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
#! /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
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
# qemu is not happy about the AppImage type 2 magic bytes, so we need to "fix" that
dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of=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
find AppDir
AppDir/AppRun --appdir AppDir
mv linuxdeploy-plugin-appimage*.AppImage* "$OLD_CWD"/