# Flatpak manifest for LightCraft, ready for a Flathub submission. # # Flatpak builds run offline, so the crate sources must be vendored first. From the repo root: # # curl -fsSLO https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/cargo/flatpak-cargo-generator.py # python3 flatpak-cargo-generator.py Cargo.lock -o packaging/linux/flatpak/cargo-sources.json # flatpak-builder --user --install --force-clean build-flatpak packaging/linux/flatpak/ai.storyteller.lightcraft.yml # flatpak run ai.storyteller.lightcraft # # For Flathub, replace the `dir` source with a `git` source pinned to a release tag and commit. # # ai.storyteller.lightcraft.bundle.yml (same directory) builds the .flatpak attached to every # release from the prebuilt binaries. Keep runtime-version and finish-args identical in both # (packaging-lint checks this). id: ai.storyteller.lightcraft runtime: org.freedesktop.Platform runtime-version: '25.08' sdk: org.freedesktop.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.rust-stable command: lightcraft finish-args: # Display: Wayland first; X11 only when no Wayland compositor is running. - --socket=wayland - --socket=fallback-x11 # X11 shared memory (MIT-SHM). Without it the X11 fallback is slow or fails. - --share=ipc # GPU access for the wgpu renderer (Vulkan, or GL as a fallback). - --device=dri # The library lives in ~/Pictures/LightCraft Library by default, and imports usually come from # Pictures. Open/Save dialogs go through the file-chooser portal (rfd's xdg-portal backend) and # drag-and-drop through the document portal, so picked folders elsewhere work without broad # filesystem access. - --filesystem=xdg-pictures # Deliberately not granted: home/host filesystem access, and network. The network is only for # the optional SAM 3 model download (AI Object/Describe masks, docs/ai-masks.md); without it # that download fails with an error and everything else works. Users who want it run # `flatpak override --user --share=network ai.storyteller.lightcraft`. build-options: append-path: /usr/lib/sdk/rust-stable/bin modules: - name: lightcraft buildsystem: simple build-options: env: CARGO_HOME: /run/build/lightcraft/cargo CARGO_NET_OFFLINE: 'true' build-commands: - cargo --offline build --release --locked -p lightcraft -p lightcraft-cli - install -Dm755 target/release/lightcraft /app/bin/lightcraft - install -Dm755 target/release/lightcraft-cli /app/bin/lightcraft-cli - install -Dm644 packaging/linux/ai.storyteller.lightcraft.desktop /app/share/applications/ai.storyteller.lightcraft.desktop - install -Dm644 packaging/linux/ai.storyteller.lightcraft.mime.xml /app/share/mime/packages/ai.storyteller.lightcraft.xml - mkdir -p /app/share/icons && cp -R assets/app-icon/hicolor /app/share/icons/ - >- version=$(awk '/^\[/{p=($0=="[workspace.package]");next} p&&$1=="version"{gsub(/[" ]/,"",$3);print $3;exit}' Cargo.toml); install -d /app/share/metainfo; sed -e "s/@VERSION@/$version/" -e "s/@DATE@/$(date -u +%Y-%m-%d)/" packaging/linux/ai.storyteller.lightcraft.metainfo.xml.in > /app/share/metainfo/ai.storyteller.lightcraft.metainfo.xml sources: - type: dir path: ../../.. skip: - target - dist - corpus - build-flatpak - .flatpak-builder - cargo-sources.json