Skip to content

Commit a0b2398

Browse files
committed
Really fix AppImage build
1 parent 9876371 commit a0b2398

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

ci/build-appimage.sh

+1-27
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,9 @@ case "$ARCH" in
3434
;;
3535
esac
3636

37-
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
38-
39-
make -j$(nproc)
40-
41-
make install DESTDIR=AppDir
42-
43-
AIK_ARCH="$ARCH"
44-
[ "$ARCH" == "i386" ] && AIK_ARCH="i686"
45-
4637
bash "$REPO_ROOT"/ci/build-bundle.sh
4738

48-
mv linuxdeploy-plugin-appimage-bundle AppDir/
49-
50-
# cannot use a simple symlink because the AppRun script in appimagetool does not use bash and cannot use $BASH_SOURCE
51-
# therefore, a symlink would alter $0, causing the script to detect the wrong path
52-
# we use a similar script here to avoid this AppImage from depending on bash
53-
cat > AppDir/usr/bin/appimagetool <<\EOF
54-
#! /bin/bash
55-
set -euo pipefail
56-
57-
this_dir="$(readlink -f "$(dirname "$0")")"
58-
59-
# make appimagetool prefer the bundled mksquashfs
60-
export PATH="$this_dir"/usr/bin:"$PATH"
61-
62-
exec "$this_dir"/../../linuxdeploy-plugin-appimage-bundle/usr/bin/appimagetool "$@"
63-
64-
EOF
65-
chmod +x AppDir/usr/bin/appimagetool
39+
mv linuxdeploy-plugin-appimage-bundle AppDir
6640

6741
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
6842
chmod +x linuxdeploy-"$ARCH".AppImage

ci/build-bundle.sh

+13-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of=appimagetool-"$AIK_ARCH".App
5858

5959
./appimagetool-"$AIK_ARCH".AppImage --appimage-extract
6060
mv squashfs-root/ linuxdeploy-plugin-appimage-bundle/appimagetool-prefix/
61-
ln -s ../../appimagetool-prefix/AppRun linuxdeploy-plugin-appimage-bundle/usr/bin/appimagetool
61+
62+
# cannot use a simple symlink because the AppRun script in appimagetool does not use bash and cannot use $BASH_SOURCE
63+
# therefore, a symlink would alter $0, causing the script to detect the wrong path
64+
# we use a similar script here to avoid this AppImage from depending on bash
65+
cat > linuxdeploy-plugin-appimage-bundle/usr/bin/appimagetool <<\EOF
66+
#! /bin/bash
67+
set -euo pipefail
68+
69+
this_dir="$(readlink -f "$(dirname "$0")")"
70+
71+
exec "$this_dir"/../../appimagetool-prefix/AppRun "$@"
72+
EOF
73+
chmod +x linuxdeploy-plugin-appimage-bundle/usr/bin/appimagetool
6274

6375
mv linuxdeploy-plugin-appimage-bundle "$OLD_CWD"

0 commit comments

Comments
 (0)