[chore]: more work for packaging flatpaks
Some checks failed
/ clippy (push) Failing after 6m53s
/ test (push) Failing after 7m2s

This commit is contained in:
Chris Cochrun 2026-05-05 09:49:00 -05:00
parent b72b115bcc
commit a713907e49
5 changed files with 13318 additions and 10 deletions

3
.gitignore vendored
View file

@ -19,4 +19,5 @@ result
flatpak-cargo-generator.py
.flatpak-builder/
flatpak-out/
cosmic-flatpak-runtime/
cosmic-flatpak-runtime/
flatpak-builder-tools/

13285
cargo-sources.json Normal file

File diff suppressed because one or more lines are too long

View file

@ -66,6 +66,10 @@
cargo-watch
samply
flatpak-builder
python3
python313Packages.aiohttp
python313Packages.tomlkit
python313Packages.pip
libcosmicAppHook
];

View file

@ -3,7 +3,7 @@ verbose := "-v"
file := "~/dev/lumina-iced/test_presentation.lisp"
sdk-version := "25.08"
export RUSTC_WRAPPER := "sccache"
# export RUSTC_WRAPPER := "sccache"
# export RUST_LOG := "debug"
default:
@ -12,6 +12,8 @@ build:
cargo build
build-release:
cargo build --release
build-offline:
cargo build --release --offline
run:
cargo run -- {{verbose}} {{ui}}
run-release:
@ -42,7 +44,8 @@ alias rf := run-file
alias c := clean
flatpak-setup: flatpak-install-sdk
##### Sets up flatpak to be able to build the lumina flatpak using all the latest pieces
flatpak-setup: flatpak-install-sdk install-flatpak-builder-tools
git -C "cosmic-flatpak-runtime" pull || git clone https://github.com/pop-os/cosmic-flatpak-runtime.git "cosmic-flatpak-runtime"
cd cosmic-flatpak-runtime
flatpak-builder --install --user --force-clean build-dir cosmic-flatpak-runtime/com.system76.Cosmic.Sdk.json
@ -52,9 +55,24 @@ flatpak-install-sdk:
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --noninteractive --user flathub \
org.freedesktop.Platform//{{ sdk-version }} \
org.freedesktop.Platform.Locale//{{ sdk-version }} \
org.freedesktop.Sdk//{{ sdk-version }} \
org.freedesktop.Sdk.Locale//{{ sdk-version }} \
org.freedesktop.Sdk.Docs//{{ sdk-version }} \
org.freedesktop.Sdk.Debug//{{ sdk-version }} \
org.freedesktop.Sdk.Extension.rust-stable//{{ sdk-version }} \
org.freedesktop.Sdk.Extension.rust-nightly//{{ sdk-version }} \
org.freedesktop.Sdk.Extension.llvm22//{{ sdk-version }}
install-flatpak-builder-tools:
rm -rf flatpak-builder-tools
git clone https://github.com/flatpak/flatpak-builder-tools --branch master --depth 1
# pip install aiohttp tomlkit # Would be needed without nix
flatpak-gen-manifest: install-flatpak-builder-tools
python3 flatpak-builder-tools/cargo/flatpak-cargo-generator.py Cargo.lock -o cargo-sources.json
flatpak-build:
flatpak-builder --install --user --force-clean build-dir xyz.cochrun.lumina.yml
alias fb := flatpak-build
alias fs := flatpak-setup

View file

@ -3,7 +3,8 @@ runtime: org.freedesktop.Platform
runtime-version: '25.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.rust-nightly
- org.freedesktop.Sdk.Extension.llvm22
base: com.system76.Cosmic.BaseApp
command: lumina -i
finish-args:
@ -21,16 +22,15 @@ modules:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/lumina/cargo
CARGO_NET_OFFLINE: 'true'
# CARGO_NET_OFFLINE: 'true'
build-commands:
- cargo --offline fetch --manifest-path Cargo.toml
- cargo build --offline --release
- just build-offline
# - cargo build --release
- install -Dm0755 target/release/lumina /app/bin/lumina
- install -Dm0644 res/xyz.cochrun.lumina.desktop /app/share/applications/xyz.cochrun.lumina.desktop
- install -Dm0644 res/xyz.cochrun.lumina.metainfo.xml /app/share/appdata/xyz.cochrun.lumina.metainfo.xml
- install -Dm0644 res/icons/lumina.svg /app/share/icons/hicolor/scalable/apps/xyz.cochrun.lumina.svg
- install -Dm0644 res/icons/app.svg /app/share/icons/hicolor/scalable/apps/lumina.svg
sources:
# - type: git
@ -40,4 +40,4 @@ modules:
- type: dir
path: .
# - cargo-sources.json
- cargo-sources.json