build-dotnet: make passthru.packages a derivation
This commit is contained in:
parent
06e4d89943
commit
507eff880d
|
@ -112,10 +112,7 @@ let
|
|||
# this contains all the nuget packages that are implicitly referenced by the dotnet
|
||||
# build system. having them as separate deps allows us to avoid having to regenerate
|
||||
# a packages dependencies when the dotnet-sdk version changes
|
||||
sdkDeps = mkNugetDeps {
|
||||
name = "dotnet-sdk-${dotnet-sdk.version}-deps";
|
||||
nugetDeps = dotnet-sdk.passthru.packages;
|
||||
};
|
||||
sdkDeps = dotnet-sdk.packages;
|
||||
|
||||
sdkSource = mkNugetSource {
|
||||
name = "dotnet-sdk-${dotnet-sdk.version}-source";
|
||||
|
|
|
@ -24,6 +24,7 @@ assert if type == "sdk" then packages != null else true;
|
|||
, testers
|
||||
, runCommand
|
||||
, writeShellScript
|
||||
, mkNugetDeps
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -40,6 +41,12 @@ let
|
|||
runtime = ".NET Runtime ${version}";
|
||||
sdk = ".NET SDK ${version}";
|
||||
};
|
||||
|
||||
packageDeps = mkNugetDeps {
|
||||
name = "${pname}-${version}-deps";
|
||||
nugetDeps = packages;
|
||||
};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: rec {
|
||||
inherit pname version;
|
||||
|
@ -120,7 +127,8 @@ stdenv.mkDerivation (finalAttrs: rec {
|
|||
'';
|
||||
|
||||
passthru = rec {
|
||||
inherit icu packages;
|
||||
inherit icu;
|
||||
packages = packageDeps;
|
||||
|
||||
updateScript =
|
||||
if type == "sdk" then
|
||||
|
|
|
@ -28,10 +28,6 @@ let
|
|||
inherit sha256;
|
||||
};
|
||||
|
||||
sdkSource = linkFarmFromDrvs "nuget-sdk-packages" (
|
||||
dotnetSdk.passthru.packages { inherit fetchNuGet; }
|
||||
);
|
||||
|
||||
nugetSource = linkFarmFromDrvs "nuget-packages" (
|
||||
import ./deps.nix { inherit fetchNuGet; }
|
||||
);
|
||||
|
@ -51,8 +47,6 @@ stdenv.mkDerivation rec {
|
|||
pname = "github-runner";
|
||||
version = "2.300.0";
|
||||
|
||||
inherit sdkSource;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "actions";
|
||||
repo = "runner";
|
||||
|
@ -124,7 +118,7 @@ stdenv.mkDerivation rec {
|
|||
# Restore the dependencies
|
||||
dotnet restore src/ActionsRunner.sln \
|
||||
--runtime "${runtimeId}" \
|
||||
--source "${sdkSource}" \
|
||||
--source "${dotnetSdk.packages}" \
|
||||
--source "${nugetSource}"
|
||||
|
||||
runHook postConfigure
|
||||
|
@ -353,7 +347,7 @@ stdenv.mkDerivation rec {
|
|||
'') (lib.attrValues runtimeIds)}
|
||||
|
||||
printf "\n* Make %s file\n" "$(basename "$deps_file")"
|
||||
nuget-to-nix "$workdir/nuget_pkgs" "${sdkSource}" > "$deps_file"
|
||||
nuget-to-nix "$workdir/nuget_pkgs" "${dotnetSdk.packages}" > "$deps_file"
|
||||
printf "\n* Dependency file writen to %s" "$deps_file"
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue