Skip to content

Commit 0246205

Browse files
fix(bundler): cache appimage bundle tools (#4790)
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.studio>
1 parent 596fa08 commit 0246205

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.changes/cache-appimage-tools.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-bundler": patch
3+
---
4+
5+
Avoid re-downloading AppImage build tools on every build.
6+

tooling/bundler/src/bundle/linux/templates/appimage

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ find /usr/lib* -name WebKitNetworkProcess -exec mkdir -p "$(dirname '{}')" \; -e
4747
find /usr/lib* -name WebKitWebProcess -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
4848
find /usr/lib* -name libwebkit2gtkinjectedbundle.so -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
4949

50-
wget -q -4 -N -O "{{tauri_tools_path}}/AppRun" https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -N -O "{{tauri_tools_path}}/AppRun" https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH}
51-
chmod +x "{{tauri_tools_path}}/AppRun"
50+
( cd "{{tauri_tools_path}}" && ( wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -N https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH} ) )
51+
chmod +x "{{tauri_tools_path}}/AppRun-${ARCH}"
5252

5353
# We need AppRun to be installed as {{app_name}}.AppDir/AppRun.
5454
# Otherwise the linuxdeploy scripts will default to symlinking our main bin instead and will crash on trying to launch.
55-
cp "{{tauri_tools_path}}/AppRun" .
55+
cp "{{tauri_tools_path}}/AppRun-${ARCH}" AppRun
5656

5757
cp "{{icon_path}}" .DirIcon
5858
ln -s "{{icon_path}}" "{{app_name}}.png"
@@ -63,18 +63,18 @@ cd ..
6363

6464
if [[ "$APPIMAGE_BUNDLE_GSTREAMER" != "0" ]]; then
6565
gst_plugin="--plugin gstreamer"
66-
wget -q -4 -N -O linuxdeploy-plugin-gstreamer.sh "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gstreamer/master/linuxdeploy-plugin-gstreamer.sh"
66+
wget -q -4 -N "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gstreamer/master/linuxdeploy-plugin-gstreamer.sh"
6767
chmod +x linuxdeploy-plugin-gstreamer.sh
6868
else
6969
gst_plugin=""
7070
fi
7171

72-
wget -q -4 -N -O "{{tauri_tools_path}}/linuxdeploy-plugin-gtk.sh" https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
73-
wget -q -4 -N -O "{{tauri_tools_path}}/linuxdeploy-${ARCH}.AppImage" https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-${linuxdeploy_arch}.AppImage
72+
( cd "{{tauri_tools_path}}" && wget -q -4 -N https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh )
73+
( cd "{{tauri_tools_path}}" && wget -q -4 -N https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-${linuxdeploy_arch}.AppImage )
7474

7575
chmod +x "{{tauri_tools_path}}/linuxdeploy-plugin-gtk.sh"
76-
chmod +x "{{tauri_tools_path}}/linuxdeploy-${ARCH}.AppImage"
76+
chmod +x "{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage"
7777

78-
dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of="{{tauri_tools_path}}/linuxdeploy-${ARCH}.AppImage"
78+
dd if=/dev/zero bs=1 count=3 seek=8 conv=notrunc of="{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage"
7979

80-
OUTPUT="{{appimage_filename}}" "{{tauri_tools_path}}/linuxdeploy-${ARCH}.AppImage" --appimage-extract-and-run --appdir "{{app_name}}.AppDir" --plugin gtk ${gst_plugin} --output appimage
80+
OUTPUT="{{appimage_filename}}" "{{tauri_tools_path}}/linuxdeploy-${linuxdeploy_arch}.AppImage" --appimage-extract-and-run --appdir "{{app_name}}.AppDir" --plugin gtk ${gst_plugin} --output appimage

0 commit comments

Comments
 (0)