ScanSlicer/docs/appimage.md

110 lines
3.1 KiB
Markdown
Raw Normal View History

2026-03-04 11:11:11 +00:00
# AppImage Build Guide
ScanSlicer includes a full AppImage packaging workflow under `packaging/appimage/`.
## Files
- `packaging/appimage/AppImageBuilder.yml`: AppDir recipe and AppImage config
- `packaging/appimage/build-appimage.sh`: local build script
- `packaging/appimage/build-appimage-docker.sh`: containerized build wrapper
- `packaging/appimage/Dockerfile`: AppImage build environment
2026-03-04 14:59:01 +00:00
- `LICENSE`: project GPLv3 license bundled with AppImage releases
- `THIRD_PARTY_NOTICES`: bundled dependency notice file for AppImage releases
2026-03-04 11:11:11 +00:00
- desktop entry file in `packaging/appimage/`
- application icon file in `packaging/appimage/`
## Local Build
Prerequisites:
- `uv`
- `appimage-builder` (or custom binary via `APPIMAGE_BUILDER_BIN`)
Command:
```bash
bash packaging/appimage/build-appimage.sh
```
What the script does:
1. Exports runtime requirements (with hashes) from `uv.lock` to `appimage/build/requirements.txt`
2026-03-04 11:11:11 +00:00
2. Builds wheel into `appimage/build/`
3. Sets:
2026-03-04 11:11:11 +00:00
- `SCANSLICER_ROOT`
- `SCANSLICER_APPDIR`
- `SCANSLICER_REQUIREMENTS`
- `SCANSLICER_WHEEL`
4. Runs `appimage-builder` with `AppImageBuilder.yml`
5. Moves `.AppImage` and `.zsync` artifacts to `appimage/dist/`
2026-03-04 11:11:11 +00:00
## Dockerized Build
Prerequisite:
- Docker
2026-03-04 14:59:01 +00:00
The Docker build image pins a specific `appimage-builder` version so release
builds use a stable packaging toolchain.
2026-03-04 11:11:11 +00:00
Command:
```bash
bash packaging/appimage/build-appimage-docker.sh
```
What it does:
1. Builds an image from `packaging/appimage/Dockerfile`
2. Runs the local AppImage build script inside the container
3. Applies host UID/GID ownership to generated `appimage/` outputs
Optional environment variables:
- `APPIMAGE_DOCKER_IMAGE` (default: `scanslicer-appimage-builder`)
- `HOST_UID` and `HOST_GID`
## Recipe Notes
`AppImageBuilder.yml` currently:
- Uses Ubuntu Noble apt sources
- Bundles Python and runtime shared libs
- Removes bundled Qt system libs to prefer PySide wheel Qt runtime
- Installs Python dependencies (hash-verified) and project wheel into AppDir `/usr`
2026-03-04 11:11:11 +00:00
- Injects desktop entry and icon assets during `after_bundle`
2026-03-04 14:59:01 +00:00
- Copies `LICENSE` and `THIRD_PARTY_NOTICES` into `usr/share/doc/scanslicer/`
2026-03-04 11:11:11 +00:00
Runtime environment variables set in AppDir include:
- `PYTHONHOME`
- `PYTHONNOUSERSITE`
- `QT_PLUGIN_PATH`
- `LD_LIBRARY_PATH`
- `PATH`
## Output
Expected output artifact location:
- `appimage/dist/ScanSlicer-<version>-x86_64.AppImage`
Intermediate build files are kept under `appimage/build/`.
2026-03-04 14:59:01 +00:00
## Release Checklist
Before publishing an AppImage:
1. Build from a committed state that has a matching source tag or commit you
will publish.
2. Verify `uv.lock` is committed so the bundled Python dependency set is
reproducible from source.
3. Confirm the AppImage contains `usr/share/doc/scanslicer/LICENSE` and
`usr/share/doc/scanslicer/THIRD_PARTY_NOTICES`.
4. Publish the AppImage together with the corresponding source code for that
exact release.
5. Review `THIRD_PARTY_NOTICES` whenever dependency versions change, especially
the PySide6 / Qt runtime stack.
6. If you change the pinned `appimage-builder` version, rerun a full AppImage
smoke test before publishing.