dotnetCorePackages: move systemToDotnetRid out of sdk

This commit is contained in:
David McFarland 2022-10-03 11:13:17 -03:00
parent d38c3c8484
commit 3fdb6c5a90
7 changed files with 17 additions and 17 deletions

View file

@ -91,7 +91,7 @@ buildDotnetModule rec {
"/p:ExtraDefineConstants=DISABLE_UPDATER"
];
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.sdk_7_0.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
executables = [
"Ryujinx.Headless.SDL2"

View file

@ -26,7 +26,7 @@ buildDotnetModule rec {
nugetDeps = ./deps.nix;
# Without this dotnet attempts to restore for Windows targets, which it cannot find the dependencies for
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.sdk_6_0.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
projectFile = "ArchiSteamFarm.sln";
executables = [ "ArchiSteamFarm" ];

View file

@ -2,13 +2,11 @@
, stdenvNoCC
, callPackage
, writeShellScript
, writeText
, srcOnly
, linkFarmFromDrvs
, symlinkJoin
, makeWrapper
, dotnetCorePackages
, dotnetPackages
, mkNugetSource
, mkNugetDeps
, nuget-to-nix
@ -167,7 +165,7 @@ stdenvNoCC.mkDerivation (args // {
in
builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags);
runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) platforms;
runtimeIds = map (system: dotnetCorePackages.systemToDotnetRid system) platforms;
in
writeShellScript "fetch-${pname}-deps" ''
set -euo pipefail

View file

@ -122,13 +122,6 @@ stdenv.mkDerivation (finalAttrs: rec {
passthru = rec {
inherit icu packages;
runtimeIdentifierMap = {
"x86_64-linux" = "linux-x64";
"aarch64-linux" = "linux-arm64";
"x86_64-darwin" = "osx-x64";
"aarch64-darwin" = "osx-arm64";
};
updateScript =
if type == "sdk" then
let
@ -141,9 +134,6 @@ stdenv.mkDerivation (finalAttrs: rec {
exec ${./update.sh} "${majorVersion}"
'' else null;
# Convert a "stdenv.hostPlatform.system" to a dotnet RID
systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
tests = {
version = testers.testVersion {
package = finalAttrs.finalPackage;

View file

@ -14,6 +14,16 @@ let
buildNetSdk = attrs: buildDotnet (attrs // { type = "sdk"; });
};
runtimeIdentifierMap = {
"x86_64-linux" = "linux-x64";
"aarch64-linux" = "linux-arm64";
"x86_64-darwin" = "osx-x64";
"aarch64-darwin" = "osx-arm64";
};
# Convert a "stdenv.hostPlatform.system" to a dotnet RID
systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
## Files in versions/ are generated automatically by update.sh ##
dotnet_3_1 = import ./versions/3.1.nix (buildAttrs // { icu = icu70; });
dotnet_5_0 = import ./versions/5.0.nix (buildAttrs // { inherit icu; });
@ -21,6 +31,8 @@ let
dotnet_7_0 = import ./versions/7.0.nix (buildAttrs // { inherit icu; });
in
rec {
inherit systemToDotnetRid;
combinePackages = attrs: callPackage (import ./combine-packages.nix attrs) {};
# EOL

View file

@ -26,7 +26,7 @@ buildDotnetModule rec {
dotnet-sdk = dotnetCorePackages.sdk_3_1;
dotnet-runtime = dotnetCorePackages.runtime_3_1;
dotnetRestoreFlags = [ "--runtime ${dotnet-sdk.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ stdenv.cc.cc.lib ];

View file

@ -34,7 +34,7 @@ buildDotnetModule rec {
patches = [
(substituteAll {
src = ./add-runtime-identifier.patch;
runtimeIdentifier = dotnet-sdk.passthru.systemToDotnetRid targetPlatform.system;
runtimeIdentifier = dotnetCorePackages.systemToDotnetRid targetPlatform.system;
})
];