57 lines
2.4 KiB
YAML
57 lines
2.4 KiB
YAML
# 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.
|
|
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:
|
|
- --share=ipc
|
|
- --socket=wayland
|
|
- --socket=fallback-x11
|
|
- --device=dri
|
|
# Open/Save dialogs use the file-chooser portal (rfd), and drag-and-drop uses the document
|
|
# portal, so broad filesystem access isn't needed. Pictures is granted for opening files by
|
|
# path from the command line.
|
|
- --filesystem=xdg-pictures
|
|
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
|
|
- install -Dm755 target/release/lightcraft /app/bin/lightcraft
|
|
- 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
|