From c63e78ff59241fed90aa4374b216d89390841919 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sat, 7 Sep 2024 19:39:01 +0100 Subject: [PATCH] dotnetCorePackages.fetchNupkg: override avalonia to include upstream fix Backport https://github.com/AvaloniaUI/Avalonia/pull/16835 to versions 11.1.0 through 11.2.0-beta1 --- .../dotnet/fetch-nupkg/overrides.nix | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix b/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix index f4bc1976e0eb5..ea1ad8af4081d 100644 --- a/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix +++ b/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix @@ -1,6 +1,8 @@ { autoPatchelfHook, dotnetCorePackages, + dos2unix, + fetchpatch, fontconfig, lib, libICE, @@ -17,6 +19,48 @@ # buildInputs = old.buildInputs or [ ] ++ [ hello ]; # }); + "Avalonia" = + package: + package.overrideAttrs ( + old: + let + inherit (old) version; + in + # Versions between 11.1.0 and 11.2.0-beta1 (inclusive) need #16835 + lib.optionalAttrs + ( + builtins.compareVersions version "11.1.0" >= 0 + && (lib.versionOlder version "11.2.0" || version == "11.2.0-beta1") + ) + { + patches = [ + (fetchpatch { + url = "https://github.com/AvaloniaUI/Avalonia/pull/16835.patch"; + hash = "sha256-gJkCOHbfsydlgjavTgVNhOSUVQ79TEr6h4ETunAZWuw="; + }) + ]; + + patchFlags = [ + "--ignore-whitespace" + "--strip=3" + ]; + + prePatch = '' + cd build + dos2unix AvaloniaBuildTasks.targets + ''; + + postPatch = '' + unix2dos AvaloniaBuildTasks.targets + cd .. + ''; + + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ + dos2unix + ]; + } + ); + "Avalonia.X11" = package: package.overrideAttrs (