Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

86 lines
2.3 KiB
Nix

{
autoPatchelfHook,
dotnetCorePackages,
fontconfig,
lib,
libICE,
libSM,
libX11,
stdenv,
writeText,
}:
{
# e.g.
# "Package.Id" =
# package:
# package.overrideAttrs (old: {
# buildInputs = old.buildInputs or [ ] ++ [ hello ];
# });
"Avalonia" =
package:
package.overrideAttrs (
old:
let
# These versions have a runtime error when built with `dotnet publish --no-build`
# When attempting to draw a window, Avalonia will throw "No precompiled XAML found"
#
# Introduced in https://github.com/AvaloniaUI/Avalonia/pull/13840
# Fixed by https://github.com/AvaloniaUI/Avalonia/pull/16835
affectedVersions = [
"11.1.0-beta1"
"11.1.0-beta2"
"11.1.0-rc1"
"11.1.0-rc2"
"11.1.0"
"11.1.1"
"11.1.2-rc1"
"11.1.2"
"11.1.3"
"11.2.0-beta1"
];
in
lib.optionalAttrs (builtins.elem old.version affectedVersions) {
postPatch = ''
substituteInPlace {build,buildTransitive}/AvaloniaBuildTasks.targets \
--replace-fail 'BeforeTargets="CopyFilesToOutputDirectory;BuiltProjectOutputGroup"' \
'BeforeTargets="CopyFilesToOutputDirectory;BuiltProjectOutputGroup;ComputeResolvedFilesToPublishList"'
'';
}
);
"Avalonia.X11" =
package:
package.overrideAttrs (
old:
lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) {
setupHook = writeText "setupHook.sh" ''
prependToVar dotnetRuntimeDeps \
"${lib.getLib libICE}" \
"${lib.getLib libSM}" \
"${lib.getLib libX11}"
'';
}
);
"SkiaSharp.NativeAssets.Linux" =
package:
package.overrideAttrs (
old:
lib.optionalAttrs stdenv.hostPlatform.isLinux {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ autoPatchelfHook ];
buildInputs = old.buildInputs or [ ] ++ [ fontconfig ];
preInstall = old.preInstall or "" + ''
cd runtimes
for platform in *; do
[[ $platform == "${dotnetCorePackages.systemToDotnetRid stdenv.hostPlatform.system}" ]] ||
rm -r "$platform"
done
cd - >/dev/null
'';
}
);
}