diff --git a/pkgs/test/dotnet/cross-target/default.nix b/pkgs/test/dotnet/cross-target/default.nix new file mode 100644 index 000000000000..be1595d27216 --- /dev/null +++ b/pkgs/test/dotnet/cross-target/default.nix @@ -0,0 +1,47 @@ +{ + lib, + dotnet-sdk, + dotnetCorePackages, + stdenv, +}: + +let + sdks = { + inherit (dotnetCorePackages) + sdk_10_0 + sdk_9_0 + sdk_8_0 + ; + }; + + mkTest = + dotnet-sdk_target: + + stdenv.mkDerivation { + name = "dotnet-cross-target-${dotnet-sdk_target.version}-test"; + + nativeBuildInputs = [ + (dotnetCorePackages.combinePackages [ + dotnet-sdk + dotnet-sdk_target + ]) + ] + ++ dotnet-sdk_target.packages; + + unpackPhase = '' + runHook preUnpack + mkdir test + cd test + ${dotnet-sdk_target}/bin/dotnet new console --no-restore + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + dotnet run > $out + runHook postInstall + ''; + }; + +in +lib.recurseIntoAttrs (lib.mapAttrs (_: mkTest) sdks) diff --git a/pkgs/test/dotnet/default.nix b/pkgs/test/dotnet/default.nix index 601cf5c15e4e..6191ea5c5c3d 100644 --- a/pkgs/test/dotnet/default.nix +++ b/pkgs/test/dotnet/default.nix @@ -6,4 +6,5 @@ structured-attrs = lib.recurseIntoAttrs (callPackage ./structured-attrs { }); final-attrs = lib.recurseIntoAttrs (callPackage ./final-attrs { }); nuget-deps = lib.recurseIntoAttrs (callPackage ./nuget-deps { }); + cross-target = callPackage ./cross-target { }; }