From 1501286bab1330eb6bd135fc18edd6226572cf51 Mon Sep 17 00:00:00 2001 From: rohanssrao Date: Sat, 30 Nov 2024 20:53:10 -0500 Subject: [PATCH] lumafly: use dotnet sdk 9 as sdk 7 has been marked insecure (cherry picked from commit 3f89fb0eace4b9c6214ac29e96268278c0929e27) --- pkgs/by-name/lu/lumafly/package.nix | 42 +++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/lu/lumafly/package.nix b/pkgs/by-name/lu/lumafly/package.nix index 24e45cb087083..910ab26ab4bfe 100644 --- a/pkgs/by-name/lu/lumafly/package.nix +++ b/pkgs/by-name/lu/lumafly/package.nix @@ -9,6 +9,7 @@ icoutils, copyDesktopItems, makeDesktopItem, + writeScript, }: buildDotnetModule rec { pname = "lumafly"; @@ -17,18 +18,33 @@ buildDotnetModule rec { src = fetchFromGitHub { owner = "TheMulhima"; repo = "lumafly"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-GVPMAwxbq9XlKjMKd9G5yUol42f+6lSyHukN7NMCVDA="; }; + # Use .NET 9.0 since 7.0 is EOL + dotnetFlags = [ "-p:TargetFramework=net9.0" ]; + projectFile = "Lumafly/Lumafly.csproj"; nugetDeps = ./deps.nix; - dotnet-sdk = dotnetCorePackages.sdk_7_0; + dotnet-sdk = dotnetCorePackages.sdk_9_0; + dotnet-runtime = dotnetCorePackages.sdk_9_0; selfContainedBuild = true; + passthru.updateScript = writeScript "update-lumafly" '' + #!/usr/bin/env nix-shell + #!nix-shell --pure -i bash -p bash nix nix-update git cacert + set -eo pipefail + + prev_version=$(nix eval --raw -f. lumafly.version) + nix-update lumafly + [[ $(nix eval --raw -f. lumafly.version) == "$prev_version" ]] || + $(nix-build . -A lumafly.fetch-deps --no-out-link) + ''; + runtimeDeps = [ zlib icu @@ -40,21 +56,25 @@ buildDotnetModule rec { copyDesktopItems ]; + executables = [ "Lumafly" ]; + postFixup = '' # Icon for the desktop file icotool -x $src/Lumafly/Assets/Lumafly.ico install -D Lumafly_1_32x32x32.png $out/share/icons/hicolor/32x32/apps/lumafly.png ''; - desktopItems = [(makeDesktopItem { - desktopName = "Lumafly"; - name = "lumafly"; - exec = "Lumafly"; - icon = "lumafly"; - comment = meta.description; - type = "Application"; - categories = [ "Game" ]; - })]; + desktopItems = [ + (makeDesktopItem { + desktopName = "Lumafly"; + name = "lumafly"; + exec = "Lumafly"; + icon = "lumafly"; + comment = "A cross platform mod manager for Hollow Knight written in Avalonia"; + type = "Application"; + categories = [ "Game" ]; + }) + ]; meta = { description = "A cross platform mod manager for Hollow Knight written in Avalonia";