tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
0
fork
atom
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
dotnetCorePackages: move systemToDotnetRid out of sdk
David McFarland
3 years ago
3fdb6c5a
d38c3c84
+17
-17
7 changed files
expand all
collapse all
unified
split
pkgs
applications
emulators
ryujinx
default.nix
misc
ArchiSteamFarm
default.nix
build-support
dotnet
build-dotnet-module
default.nix
development
compilers
dotnet
build-dotnet.nix
default.nix
dotnet-modules
python-language-server
default.nix
games
BeatSaberModManager
default.nix
+1
-1
pkgs/applications/emulators/ryujinx/default.nix
···
91
91
"/p:ExtraDefineConstants=DISABLE_UPDATER"
92
92
];
93
93
94
94
-
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.sdk_7_0.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
94
94
+
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
95
95
96
96
executables = [
97
97
"Ryujinx.Headless.SDL2"
+1
-1
pkgs/applications/misc/ArchiSteamFarm/default.nix
···
26
26
nugetDeps = ./deps.nix;
27
27
28
28
# Without this dotnet attempts to restore for Windows targets, which it cannot find the dependencies for
29
29
-
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.sdk_6_0.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
29
29
+
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
30
30
31
31
projectFile = "ArchiSteamFarm.sln";
32
32
executables = [ "ArchiSteamFarm" ];
+1
-3
pkgs/build-support/dotnet/build-dotnet-module/default.nix
···
2
2
, stdenvNoCC
3
3
, callPackage
4
4
, writeShellScript
5
5
-
, writeText
6
5
, srcOnly
7
6
, linkFarmFromDrvs
8
7
, symlinkJoin
9
8
, makeWrapper
10
9
, dotnetCorePackages
11
11
-
, dotnetPackages
12
10
, mkNugetSource
13
11
, mkNugetDeps
14
12
, nuget-to-nix
···
167
165
in
168
166
builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags);
169
167
170
170
-
runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) platforms;
168
168
+
runtimeIds = map (system: dotnetCorePackages.systemToDotnetRid system) platforms;
171
169
in
172
170
writeShellScript "fetch-${pname}-deps" ''
173
171
set -euo pipefail
-10
pkgs/development/compilers/dotnet/build-dotnet.nix
···
122
122
passthru = rec {
123
123
inherit icu packages;
124
124
125
125
-
runtimeIdentifierMap = {
126
126
-
"x86_64-linux" = "linux-x64";
127
127
-
"aarch64-linux" = "linux-arm64";
128
128
-
"x86_64-darwin" = "osx-x64";
129
129
-
"aarch64-darwin" = "osx-arm64";
130
130
-
};
131
131
-
132
125
updateScript =
133
126
if type == "sdk" then
134
127
let
···
140
133
pushd pkgs/development/compilers/dotnet
141
134
exec ${./update.sh} "${majorVersion}"
142
135
'' else null;
143
143
-
144
144
-
# Convert a "stdenv.hostPlatform.system" to a dotnet RID
145
145
-
systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
146
136
147
137
tests = {
148
138
version = testers.testVersion {
+12
pkgs/development/compilers/dotnet/default.nix
···
14
14
buildNetSdk = attrs: buildDotnet (attrs // { type = "sdk"; });
15
15
};
16
16
17
17
+
runtimeIdentifierMap = {
18
18
+
"x86_64-linux" = "linux-x64";
19
19
+
"aarch64-linux" = "linux-arm64";
20
20
+
"x86_64-darwin" = "osx-x64";
21
21
+
"aarch64-darwin" = "osx-arm64";
22
22
+
};
23
23
+
24
24
+
# Convert a "stdenv.hostPlatform.system" to a dotnet RID
25
25
+
systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
26
26
+
17
27
## Files in versions/ are generated automatically by update.sh ##
18
28
dotnet_3_1 = import ./versions/3.1.nix (buildAttrs // { icu = icu70; });
19
29
dotnet_5_0 = import ./versions/5.0.nix (buildAttrs // { inherit icu; });
···
21
31
dotnet_7_0 = import ./versions/7.0.nix (buildAttrs // { inherit icu; });
22
32
in
23
33
rec {
34
34
+
inherit systemToDotnetRid;
35
35
+
24
36
combinePackages = attrs: callPackage (import ./combine-packages.nix attrs) {};
25
37
26
38
# EOL
+1
-1
pkgs/development/dotnet-modules/python-language-server/default.nix
···
26
26
dotnet-sdk = dotnetCorePackages.sdk_3_1;
27
27
dotnet-runtime = dotnetCorePackages.runtime_3_1;
28
28
29
29
-
dotnetRestoreFlags = [ "--runtime ${dotnet-sdk.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
29
29
+
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
30
30
31
31
nativeBuildInputs = [ autoPatchelfHook ];
32
32
buildInputs = [ stdenv.cc.cc.lib ];
+1
-1
pkgs/games/BeatSaberModManager/default.nix
···
34
34
patches = [
35
35
(substituteAll {
36
36
src = ./add-runtime-identifier.patch;
37
37
-
runtimeIdentifier = dotnet-sdk.passthru.systemToDotnetRid targetPlatform.system;
37
37
+
runtimeIdentifier = dotnetCorePackages.systemToDotnetRid targetPlatform.system;
38
38
})
39
39
];
40
40