refactor(bundler): use linuxdeploy instead of appimagetool, closes #1986 (#2437)

This commit is contained in:
Lucas Fernandes Nogueira 2021-08-15 17:09:55 -03:00 committed by GitHub
parent 12642a1ad4
commit 397710b2c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 41 additions and 37 deletions

View File

@ -8,7 +8,7 @@
"getPublishedVersion": "cargo search ${ pkgFile.pkg.package.name } --limit 1 | sed -nE \"s/^[^\\\"]*\\\"//; s/\\\".*//1p\"",
"prepublish": [
"sudo apt-get update",
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev",
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf",
"cargo install cargo-audit --features=fix",
{
"command": "cargo generate-lockfile",

5
.changes/linuxdeploy.md Normal file
View File

@ -0,0 +1,5 @@
---
"tauri-bundler": patch
---
Use `linuxdeploy` instead of `appimagetool` for `AppImage` bundling.

View File

@ -35,7 +35,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

View File

@ -37,7 +37,7 @@ jobs:
run: |
python -m pip install --upgrade pip
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0 libappindicator3-dev xvfb
sudo apt-get install -y webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf xvfb
wget https://github.com/sharkdp/hyperfine/releases/download/v1.11.0/hyperfine_1.11.0_amd64.deb
sudo dpkg -i hyperfine_1.11.0_amd64.deb
pip install memory_profiler

View File

@ -69,7 +69,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: yarn install for cli
working-directory: tauri/tooling/cli.js
run: yarn

View File

@ -24,7 +24,7 @@ jobs:
- name: install webkit2gtk
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- uses: actions-rs/toolchain@v1
with:
@ -151,7 +151,7 @@ jobs:
- name: install webkit2gtk
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- uses: actions-rs/toolchain@v1
with:

View File

@ -76,7 +76,7 @@ jobs:
- name: install webkit2gtk
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
# Rust
- name: generate rust docs

View File

@ -37,7 +37,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: cache rust bin
id: cache_rust_bin
uses: actions/cache@v1

View File

@ -35,7 +35,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
@ -100,7 +100,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: clippy check
uses: actions-rs/clippy-check@v1
with:

View File

@ -37,7 +37,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
@ -161,7 +161,7 @@ jobs:
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

View File

@ -45,7 +45,7 @@ jobs:
if: (github.event.inputs.platform || 'ubuntu') == 'ubuntu'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- run: yarn
working-directory: tooling/cli.js
- run: yarn build
@ -86,7 +86,7 @@ jobs:
# if: (github.event.inputs.platform || 'ubuntu') == 'ubuntu'
# run: |
# sudo apt-get update
# sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
# sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
# - run: yarn
# working-directory: tooling/create-tauri-app
# - run: yarn build

View File

@ -90,7 +90,7 @@ jobs:
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- uses: actions-rs/cargo@v1
with:

View File

@ -43,7 +43,7 @@ jobs:
- name: install webkit2gtk
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
# Rust
- name: generate rust docs

View File

@ -28,7 +28,9 @@ $ sudo apt update && sudo apt install libwebkit2gtk-4.0-dev \
wget \
libssl-dev \
libgtk-3-dev \
squashfs-tools
libappindicator3-dev \
patchelf \
librsvg2-dev
```
</TabItem>
@ -42,7 +44,9 @@ $ sudo pacman -Syy && sudo pacman -S webkit2gtk \
openssl \
appmenu-gtk-module \
gtk3 \
squashfs-tools \
libappindicator-gtk3 \
patchelf \
librsvg \
libvips
```
@ -54,13 +58,20 @@ $ sudo dnf check-update && sudo dnf install webkit2gtk3-devel.x86_64 \
openssl-devel \
curl \
wget \
squashfs-tools \
libappindicator-gtk3 \ #
patchelf \
librsvg2-devel \
&& sudo dnf group install "C Development Tools and Libraries"
```
</TabItem>
</Tabs>
### Optional dependencies:
- `libappindicator`: needed to use the system tray feature.
- `patchelf` and `librsvg`: needed to bundle `AppImage`.
## 2. Node.js Runtime and Package Manager&nbsp;<Icon title="control-skip-forward" color="warning"/>
### Node.js (npm included)

View File

@ -20,14 +20,6 @@ use std::{
/// Bundles the project.
/// Returns a vector of PathBuf that shows where the AppImage was created.
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
// prerequisite: check if mksquashfs (part of squashfs-tools) is installed
Command::new("mksquashfs")
.arg("-version")
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.status()
.expect("mksquashfs is not installed. Please install squashfs-tools and try again.");
// generate the deb binary name
let arch = match settings.binary_arch() {
"x86" => "i386",

View File

@ -22,14 +22,10 @@ ln -s "usr/share/applications/{{app_name}}.desktop" "{{app_name}}.desktop"
cd ..
mksquashfs "{{app_name}}.AppDir" "{{app_name}}.squashfs" -root-owned -noappend
wget -q -4 -O linuxdeploy-plugin-gtk.sh "https://raw.githubusercontent.com/linuxdeploy/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 appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || wget -q -4 -O appimagetool https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
chmod +x appimagetool
if lsmod | grep -q fuse; then
./appimagetool "{{app_name}}.AppDir" "{{appimage_filename}}"
else
./appimagetool --appimage-extract
./squashfs-root/AppRun "{{app_name}}.AppDir" "{{appimage_filename}}"
rm -rf ./squashfs-root
fi
chmod +x linuxdeploy-plugin-gtk.sh
chmod +x linuxdeploy-x86_64.AppImage
OUTPUT="{{appimage_filename}}" ./linuxdeploy-x86_64.AppImage --appdir "{{app_name}}.AppDir" --plugin gtk --output appimage