From c7a1c9c96b668c5e50d712cde980dceee5fcd213 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 8 May 2026 07:13:40 -0500 Subject: [PATCH] [chore] tweaks to packager pieces --- Cargo.toml | 33 ++++++++++++++++++++++++++++++++- flake.nix | 1 + xyz.cochrun.lumina.yml | 13 +++++-------- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f587b05..7035efa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,7 @@ features = ["wgpu"] [package.metadata.packager] version = "0.1.0" identifier = "xyz.cochrun.lumina" -icons = ["res/icons/app.ico"] +icons = ["res/icons/app.ico" "res/icons/app.icns" "res/icons/app.svg"] resources = ["res"] category = "Video" @@ -81,6 +81,37 @@ allow_downgrades = true [package.metadata.packager.nsis] installer_icon = "res/icons/app.ico" +preinstall_section = """ +Section PreInstall + ; Check if GStreamer is already installed and skip this section + ReadRegStr $4 HKLM "SOFTWARE\\GStreamer1.0\\x86_64" "pv" + + StrCmp $4 "" 0 gstreamer_done + + Delete "$TEMP\\gstreamer1.0.exe" + DetailPrint "Downloading GStreamer" + nsis_tauri_utils::download "https://gstreamer.freedesktop.org/data/pkg/windows/1.28.2/msvc/gstreamer-1.0-msvc-x86_64-1.28.2.exe" "$TEMP\\gstreamer-1.0-msvc-x86_64-1.28.2.exe" + Pop $0 + ${If} $0 == 0 + DetailPrint "Successfully downloaded GStreamer" + ${Else} + DetailPrint "Error downloading GStreamer" + Abort "Canceling GStreamer install due to download error" + ${EndIf} + StrCpy $6 "$TEMP\\gstreamer-1.0-msvc-x86_64-1.28.2.exe" + + DetailPrint "Installing GStreamer" + ; $6 holds the path to the gstreamer installer + ExecWait "$6" $1 + ${If} $1 == 0 + DetailPrint "GStreamer successfully installed" + ${Else} + DetailPrint "Error installing GStreamer" + Abort "Cancelling GStreamer install due to installation error" + ${EndIf} + gstreamer_done: +SectionEnd +""" [profile.release] opt-level = 3 diff --git a/flake.nix b/flake.nix index c544235..9467de1 100644 --- a/flake.nix +++ b/flake.nix @@ -72,6 +72,7 @@ python313Packages.pip unzip appstream + appstream-glib libcosmicAppHook ]; diff --git a/xyz.cochrun.lumina.yml b/xyz.cochrun.lumina.yml index 39730f2..7a906bf 100644 --- a/xyz.cochrun.lumina.yml +++ b/xyz.cochrun.lumina.yml @@ -15,10 +15,7 @@ finish-args: - --share=network - --talk-name=com.system76.CosmicSettingsDaemon - --talk-name=com.system76.CosmicSettingsDaemon.* - - --filesystem=xdg-documents - - --filesystem=xdg-pictures - - --filesystem=xdg-videos - - --filesystem=xdg-dowloads + - --filesystem=home:rw - --filesystem=xdg-config/cosmic:rw - --filesystem=xdg-data/lumina:rw - --filesystem=xdg-cache/lumina:rw @@ -56,10 +53,10 @@ modules: - just build-offline # - cargo build --release - - install -Dm755 target/release/lumina -t /app/bin/lumina - - install -Dm644 res/icons/app.svg -t /app/share/icons/hicolor/scalable/apps/lumina.svg - - install -Dm644 res/xyz.cochrun.lumina.desktop -t /app/share/applications/xyz.cochrun.lumina.desktop - - install -Dm644 res/xyz.cochrun.lumina.metainfo.xml -t /app/share/metainfo/xyz.cochrun.lumina.metainfo.xml + - install -Dm755 target/release/lumina /${FLATPAK_DEST}/bin/lumina + - install -Dm644 res/icons/app.svg /${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/lumina.svg + - install -Dm644 res/${FLATPAK_ID}.desktop /${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop + - install -Dm644 res/${FLATPAK_ID}.metainfo.xml /${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml sources: # - type: git