Skip to content

Commit 35d354b

Browse files
committed
Resolve circular dependency between linuxdeploy and this plugin
1 parent fe5e429 commit 35d354b

File tree

2 files changed

+63
-9
lines changed

2 files changed

+63
-9
lines changed

ci/build-appimage.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,12 @@ make install DESTDIR=AppDir
4343
AIK_ARCH="$ARCH"
4444
[ "$ARCH" == "i386" ] && AIK_ARCH="i686"
4545

46-
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
47-
chmod +x linuxdeploy-"$ARCH".AppImage
48-
49-
# bundle appimagetool
50-
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-"$AIK_ARCH".AppImage
46+
bash "$REPO_ROOT"/ci/build-bundle.sh
5147

52-
chmod +x appimagetool-"$AIK_ARCH".AppImage
48+
mv linuxdeploy-plugin-appimage-bundle AppDir
5349

54-
./appimagetool-"$AIK_ARCH".AppImage --appimage-extract
55-
mv squashfs-root/ AppDir/appimagetool-prefix/
56-
ln -s ../../appimagetool-prefix/AppRun AppDir/usr/bin/appimagetool
50+
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
51+
chmod +x linuxdeploy-"$ARCH".AppImage
5752

5853
export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy-plugin-appimage|continuous|linuxdeploy-plugin-appimage-$ARCH.AppImage"
5954

ci/build-bundle.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#! /bin/bash
2+
3+
set -euxo pipefail
4+
5+
# use RAM disk if possible
6+
if [ "${CI:-}" == "" ] && [ -d /docker-ramdisk ]; then
7+
TEMP_BASE=/docker-ramdisk
8+
else
9+
TEMP_BASE=/tmp
10+
fi
11+
12+
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" linuxdeploy-plugin-appimage-build-XXXXXX)
13+
14+
cleanup() {
15+
if [ -d "$BUILD_DIR" ]; then
16+
rm -rf "$BUILD_DIR"
17+
fi
18+
}
19+
20+
trap cleanup EXIT
21+
22+
# store repo root as variable
23+
REPO_ROOT="$(readlink -f "$(dirname "$(dirname "$0")")")"
24+
OLD_CWD="$(readlink -f .)"
25+
26+
pushd "$BUILD_DIR"
27+
28+
case "$ARCH" in
29+
x86_64|armhf|aarch64)
30+
AIK_ARCH="$ARCH"
31+
;;
32+
i386)
33+
AIK_ARCH="i686"
34+
;;
35+
*)
36+
echo "Architecture not supported: $ARCH" 1>&2
37+
exit 1
38+
;;
39+
esac
40+
41+
cmake -G Ninja "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo "${EXTRA_CMAKE_ARGS[@]}"
42+
43+
nprocs="$(nproc)"
44+
[[ "$nprocs" -gt 2 ]] && nprocs="$(nproc --ignore=1)"
45+
46+
ninja -v -j"$nprocs"
47+
48+
env DESTDIR=linuxdeploy-plugin-appimage-bundle ninja -v install
49+
50+
# linuxdeploy-plugin-appimage-bundle appimagetool
51+
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-"$AIK_ARCH".AppImage
52+
53+
chmod +x appimagetool-"$AIK_ARCH".AppImage
54+
55+
./appimagetool-"$AIK_ARCH".AppImage --appimage-extract
56+
mv squashfs-root/ linuxdeploy-plugin-appimage-bundle/appimagetool-prefix/
57+
ln -s ../../appimagetool-prefix/AppRun linuxdeploy-plugin-appimage-bundle/usr/bin/appimagetool
58+
59+
mv linuxdeploy-plugin-appimage-bundle "$OLD_CWD"

0 commit comments

Comments
 (0)