Skip to content

Commit

Permalink
fix(bundler): use binary arch on appimage bundle script (#4194)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed May 23, 2022
1 parent 43daeaf commit 6830a73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-appimage-bundle-arch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tauri-bundler": patch
---

Use binary arch instead of `x86_64` on the AppImage bundle script.
1 change: 1 addition & 0 deletions tooling/bundler/src/bundle/linux/appimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {

// setup data to insert into shell script
let mut sh_map = BTreeMap::new();
sh_map.insert("arch", settings.target().split('-').next().unwrap());
sh_map.insert("app_name", settings.main_binary_name());
sh_map.insert("app_name_uppercase", &upcase_app_name);
sh_map.insert("appimage_filename", &appimage_filename);
Expand Down
10 changes: 5 additions & 5 deletions tooling/bundler/src/bundle/linux/templates/appimage
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -euxo pipefail

export ARCH=x86_64
export ARCH={{arch}}

mkdir -p "{{app_name}}.AppDir"
cp -r ../appimage_deb/data/usr "{{app_name}}.AppDir"
Expand All @@ -17,7 +17,7 @@ find /usr/lib* -name WebKitNetworkProcess -exec mkdir -p "$(dirname '{}')" \; -e
find /usr/lib* -name WebKitWebProcess -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true
find /usr/lib* -name libwebkit2gtkinjectedbundle.so -exec mkdir -p "$(dirname '{}')" \; -exec cp --parents '{}' "." \; || true

wget -q -4 -O AppRun https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64 || wget -q -4 -O AppRun https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-aarch64
wget -q -4 -O AppRun https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${ARCH} || wget -q -4 -O AppRun https://github.com/AppImage/AppImageKit/releases/download/12/AppRun-${ARCH}
chmod +x AppRun

cp "{{icon_path}}" .DirIcon
Expand All @@ -28,9 +28,9 @@ ln -s "usr/share/applications/{{app_name}}.desktop" "{{app_name}}.desktop"
cd ..

wget -q -4 -O linuxdeploy-plugin-gtk.sh "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
wget -q -4 -O linuxdeploy-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q -4 -O linuxdeploy-${ARCH}.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage

chmod +x linuxdeploy-plugin-gtk.sh
chmod +x linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-${ARCH}.AppImage

OUTPUT="{{appimage_filename}}" ./linuxdeploy-x86_64.AppImage --appimage-extract-and-run --appdir "{{app_name}}.AppDir" --plugin gtk --output appimage
OUTPUT="{{appimage_filename}}" ./linuxdeploy-${ARCH}.AppImage --appimage-extract-and-run --appdir "{{app_name}}.AppDir" --plugin gtk --output appimage

0 comments on commit 6830a73

Please sign in to comment.