···2526 nugetDeps = ./deps.nix;
2728- # Without this dotnet attempts to restore for Windows targets, which it cannot find the dependencies for
29- dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.sdk_6_0.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
30-31 projectFile = "ArchiSteamFarm.sln";
32 executables = [ "ArchiSteamFarm" ];
33
···2, stdenvNoCC
3, callPackage
4, writeShellScript
5-, writeText
6, srcOnly
7, linkFarmFromDrvs
8, symlinkJoin
9, makeWrapper
10, dotnetCorePackages
11-, dotnetPackages
12, mkNugetSource
13, mkNugetDeps
14, nuget-to-nix
···61 # Libraries that need to be available at runtime should be passed through this.
62 # These get wrapped into `LD_LIBRARY_PATH`.
63, runtimeDeps ? [ ]
0006465 # Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks.
66 # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details.
···73, buildType ? "Release"
74 # If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet
75, selfContainedBuild ? false
0076 # The dotnet SDK to use.
77, dotnet-sdk ? dotnetCorePackages.sdk_6_0
78 # The dotnet runtime to use.
···9091 inherit (callPackage ./hooks {
92 inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType;
000093 }) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook;
9495 localDeps =
···114 # this contains all the nuget packages that are implicitly referenced by the dotnet
115 # build system. having them as separate deps allows us to avoid having to regenerate
116 # a packages dependencies when the dotnet-sdk version changes
117- sdkDeps = mkNugetDeps {
118- name = "dotnet-sdk-${dotnet-sdk.version}-deps";
119- nugetDeps = dotnet-sdk.passthru.packages;
120- };
121122 sdkSource = mkNugetSource {
123 name = "dotnet-sdk-${dotnet-sdk.version}-source";
···152 # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping
153 dontWrapGApps = args.dontWrapGApps or true;
15400155 passthru = {
156 inherit nuget-source;
157158 fetch-deps =
159 let
160- # Derivations may set flags such as `--runtime <rid>` based on the host platform to avoid restoring/building nuget dependencies they dont have or dont need.
161- # This introduces an issue; In this script we loop over all platforms from `meta` and add the RID flag for it, as to fetch all required dependencies.
162- # The script would inherit the RID flag from the derivation based on the platform building the script, and set the flag for any iteration we do over the RIDs.
163- # That causes conflicts. To circumvent it we remove all occurances of the flag.
164- flags =
165- let
166- hasRid = flag: lib.any (v: v) (map (rid: lib.hasInfix rid flag) (lib.attrValues dotnet-sdk.runtimeIdentifierMap));
167- in
168- builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags);
169-170- runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) platforms;
171 in
172 writeShellScript "fetch-${pname}-deps" ''
173 set -euo pipefail
···2, stdenvNoCC
3, callPackage
4, writeShellScript
05, srcOnly
6, linkFarmFromDrvs
7, symlinkJoin
8, makeWrapper
9, dotnetCorePackages
010, mkNugetSource
11, mkNugetDeps
12, nuget-to-nix
···59 # Libraries that need to be available at runtime should be passed through this.
60 # These get wrapped into `LD_LIBRARY_PATH`.
61, runtimeDeps ? [ ]
62+ # The dotnet runtime ID. If null, fetch-deps will gather dependencies for all
63+ # platforms in meta.platforms which are supported by the sdk.
64+, runtimeId ? null
6566 # Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks.
67 # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details.
···74, buildType ? "Release"
75 # If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet
76, selfContainedBuild ? false
77+ # Whether to explicitly enable UseAppHost when building
78+, useAppHost ? true
79 # The dotnet SDK to use.
80, dotnet-sdk ? dotnetCorePackages.sdk_6_0
81 # The dotnet runtime to use.
···9394 inherit (callPackage ./hooks {
95 inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType;
96+ runtimeId =
97+ if runtimeId != null
98+ then runtimeId
99+ else dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system;
100 }) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook;
101102 localDeps =
···121 # this contains all the nuget packages that are implicitly referenced by the dotnet
122 # build system. having them as separate deps allows us to avoid having to regenerate
123 # a packages dependencies when the dotnet-sdk version changes
124+ sdkDeps = dotnet-sdk.packages;
000125126 sdkSource = mkNugetSource {
127 name = "dotnet-sdk-${dotnet-sdk.version}-source";
···156 # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping
157 dontWrapGApps = args.dontWrapGApps or true;
158159+ inherit selfContainedBuild useAppHost;
160+161 passthru = {
162 inherit nuget-source;
163164 fetch-deps =
165 let
166+ flags = dotnetFlags ++ dotnetRestoreFlags;
167+ runtimeIds =
168+ if runtimeId != null
169+ then [ runtimeId ]
170+ else map (system: dotnetCorePackages.systemToDotnetRid system) platforms;
000000171 in
172 writeShellScript "fetch-${pname}-deps" ''
173 set -euo pipefail
···16 local -r maxCpuFlag="1"
17 fi
1819- for project in ${testProjectFile[@]-}; do
20 env "LD_LIBRARY_PATH=@libraryPath@" \
21 dotnet test "$project" \
22 -maxcpucount:$maxCpuFlag \
···16 local -r maxCpuFlag="1"
17 fi
1819+ for project in ${testProjectFile[@]-${projectFile[@]}}; do
20 env "LD_LIBRARY_PATH=@libraryPath@" \
21 dotnet test "$project" \
22 -maxcpucount:$maxCpuFlag \