···25252626 nugetDeps = ./deps.nix;
27272828- # Without this dotnet attempts to restore for Windows targets, which it cannot find the dependencies for
2929- dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.sdk_6_0.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
3030-3128 projectFile = "ArchiSteamFarm.sln";
3229 executables = [ "ArchiSteamFarm" ];
3330
···22, stdenvNoCC
33, callPackage
44, writeShellScript
55-, writeText
65, srcOnly
76, linkFarmFromDrvs
87, symlinkJoin
98, makeWrapper
109, dotnetCorePackages
1111-, dotnetPackages
1210, mkNugetSource
1311, mkNugetDeps
1412, nuget-to-nix
···6159 # Libraries that need to be available at runtime should be passed through this.
6260 # These get wrapped into `LD_LIBRARY_PATH`.
6361, runtimeDeps ? [ ]
6262+ # The dotnet runtime ID. If null, fetch-deps will gather dependencies for all
6363+ # platforms in meta.platforms which are supported by the sdk.
6464+, runtimeId ? null
64656566 # Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks.
6667 # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details.
···7374, buildType ? "Release"
7475 # If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet
7576, selfContainedBuild ? false
7777+ # Whether to explicitly enable UseAppHost when building
7878+, useAppHost ? true
7679 # The dotnet SDK to use.
7780, dotnet-sdk ? dotnetCorePackages.sdk_6_0
7881 # The dotnet runtime to use.
···90939194 inherit (callPackage ./hooks {
9295 inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType;
9696+ runtimeId =
9797+ if runtimeId != null
9898+ then runtimeId
9999+ else dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system;
93100 }) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook;
9410195102 localDeps =
···114121 # this contains all the nuget packages that are implicitly referenced by the dotnet
115122 # build system. having them as separate deps allows us to avoid having to regenerate
116123 # a packages dependencies when the dotnet-sdk version changes
117117- sdkDeps = mkNugetDeps {
118118- name = "dotnet-sdk-${dotnet-sdk.version}-deps";
119119- nugetDeps = dotnet-sdk.passthru.packages;
120120- };
124124+ sdkDeps = dotnet-sdk.packages;
121125122126 sdkSource = mkNugetSource {
123127 name = "dotnet-sdk-${dotnet-sdk.version}-source";
···152156 # gappsWrapperArgs gets included when wrapping for dotnet, as to avoid double wrapping
153157 dontWrapGApps = args.dontWrapGApps or true;
154158159159+ inherit selfContainedBuild useAppHost;
160160+155161 passthru = {
156162 inherit nuget-source;
157163158164 fetch-deps =
159165 let
160160- # 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.
161161- # 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.
162162- # 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.
163163- # That causes conflicts. To circumvent it we remove all occurances of the flag.
164164- flags =
165165- let
166166- hasRid = flag: lib.any (v: v) (map (rid: lib.hasInfix rid flag) (lib.attrValues dotnet-sdk.runtimeIdentifierMap));
167167- in
168168- builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags);
169169-170170- runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) platforms;
166166+ flags = dotnetFlags ++ dotnetRestoreFlags;
167167+ runtimeIds =
168168+ if runtimeId != null
169169+ then [ runtimeId ]
170170+ else map (system: dotnetCorePackages.systemToDotnetRid system) platforms;
171171 in
172172 writeShellScript "fetch-${pname}-deps" ''
173173 set -euo pipefail
···1616 local -r maxCpuFlag="1"
1717 fi
18181919- for project in ${testProjectFile[@]-}; do
1919+ for project in ${testProjectFile[@]-${projectFile[@]}}; do
2020 env "LD_LIBRARY_PATH=@libraryPath@" \
2121 dotnet test "$project" \
2222 -maxcpucount:$maxCpuFlag \