Skip to content

Pattern AppImage

m-wells edited this page Jan 30, 2026 · 2 revisions

AppImage Packages

Example: rpi-imager

AppImages are self-contained Linux applications. We extract and repackage them for system integration.

Template

arch=('x86_64')
depends=('fuse2' 'zlib')
options=('!strip')

source=("App-${pkgver}.AppImage::https://example.com/releases/App-${pkgver}.AppImage")

prepare() {
    chmod +x "App-${pkgver}.AppImage"
    "./App-${pkgver}.AppImage" --appimage-extract
}

package() {
    # Install AppImage
    install -Dm755 "App-${pkgver}.AppImage" "$pkgdir/opt/$pkgname/app.AppImage"

    # Wrapper script
    install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<'EOF'
#!/bin/bash
exec /opt/pkgname/app.AppImage "$@"
EOF

    # Desktop integration (extracted from AppImage)
    install -Dm644 "squashfs-root/app.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
    install -Dm644 "squashfs-root/app.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
}

Characteristics

  • arch=('x86_64') - AppImages are architecture-specific
  • options=('!strip') - Don't strip the AppImage binary
  • Requires fuse2 for execution
  • Extract .desktop and icons with --appimage-extract

Privilege Elevation

For apps requiring root (like disk imaging tools), use pkexec:

#!/bin/bash
pkexec --disable-internal-agent /opt/pkgname/app.AppImage "$@"

Version Checking

check_example() {
    local latest=$(curl -s "https://api.github.com/repos/org/repo/releases/latest" \
        | jq -r '.tag_name | ltrimstr("v")')
    perform_update "example" "$latest"
}

Clone this wiki locally