buildDotnetModule: allow lockFile path to be set in nugetDeps
This allows fetch-deps to find the lock-file for roslyn.
This commit is contained in:
parent
cbf0490176
commit
9c16cea2bb
@ -112,7 +112,11 @@ let
|
|||||||
if (nugetDeps != null) then
|
if (nugetDeps != null) then
|
||||||
if lib.isDerivation nugetDeps
|
if lib.isDerivation nugetDeps
|
||||||
then nugetDeps
|
then nugetDeps
|
||||||
else mkNugetDeps { inherit name; nugetDeps = import nugetDeps; }
|
else mkNugetDeps {
|
||||||
|
inherit name;
|
||||||
|
nugetDeps = import nugetDeps;
|
||||||
|
sourceFile = nugetDeps;
|
||||||
|
}
|
||||||
else throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script.";
|
else throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script.";
|
||||||
|
|
||||||
# contains the actual package dependencies
|
# contains the actual package dependencies
|
||||||
@ -138,6 +142,8 @@ let
|
|||||||
name = "${name}-nuget-source";
|
name = "${name}-nuget-source";
|
||||||
paths = [ dependenciesSource sdkSource ];
|
paths = [ dependenciesSource sdkSource ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nugetDepsFile = _nugetDeps.sourceFile;
|
||||||
in
|
in
|
||||||
stdenvNoCC.mkDerivation (args // {
|
stdenvNoCC.mkDerivation (args // {
|
||||||
nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [
|
nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [
|
||||||
@ -180,8 +186,8 @@ stdenvNoCC.mkDerivation (args // {
|
|||||||
# Note that toString is necessary here as it results in the path at
|
# Note that toString is necessary here as it results in the path at
|
||||||
# eval time (i.e. to the file in your local Nixpkgs checkout) rather
|
# eval time (i.e. to the file in your local Nixpkgs checkout) rather
|
||||||
# than the Nix store path of the path after it's been imported.
|
# than the Nix store path of the path after it's been imported.
|
||||||
if lib.isPath nugetDeps && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDeps)
|
if lib.isPath nugetDepsFile && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDepsFile)
|
||||||
then toString nugetDeps
|
then toString nugetDepsFile
|
||||||
else ''$(mktemp -t "${pname}-deps-XXXXXX.nix")'';
|
else ''$(mktemp -t "${pname}-deps-XXXXXX.nix")'';
|
||||||
in
|
in
|
||||||
writeShellScript "fetch-${pname}-deps" ''
|
writeShellScript "fetch-${pname}-deps" ''
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ linkFarmFromDrvs, fetchurl }:
|
{ linkFarmFromDrvs, fetchurl }:
|
||||||
{ name, nugetDeps }:
|
{ name, nugetDeps, sourceFile ? null }:
|
||||||
linkFarmFromDrvs "${name}-nuget-deps" (nugetDeps {
|
linkFarmFromDrvs "${name}-nuget-deps" (nugetDeps {
|
||||||
fetchNuGet = { pname, version, sha256
|
fetchNuGet = { pname, version, sha256
|
||||||
, url ? "https://www.nuget.org/api/v2/package/${pname}/${version}" }:
|
, url ? "https://www.nuget.org/api/v2/package/${pname}/${version}" }:
|
||||||
@ -7,4 +7,6 @@ linkFarmFromDrvs "${name}-nuget-deps" (nugetDeps {
|
|||||||
name = "${pname}.${version}.nupkg";
|
name = "${pname}.${version}.nupkg";
|
||||||
inherit url sha256;
|
inherit url sha256;
|
||||||
};
|
};
|
||||||
})
|
}) // {
|
||||||
|
inherit sourceFile;
|
||||||
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
, buildDotnetModule
|
, buildDotnetModule
|
||||||
, dotnetCorePackages
|
, dotnetCorePackages
|
||||||
, unzip
|
, unzip
|
||||||
|
, mkNugetDeps
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildDotnetModule rec {
|
buildDotnetModule rec {
|
||||||
@ -21,7 +22,11 @@ buildDotnetModule rec {
|
|||||||
|
|
||||||
projectFile = [ "src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj" ];
|
projectFile = [ "src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj" ];
|
||||||
|
|
||||||
nugetDeps = ./extended-deps.nix;
|
nugetDeps = mkNugetDeps {
|
||||||
|
name = "${pname}-deps";
|
||||||
|
nugetDeps = import ./extended-deps.nix;
|
||||||
|
sourceFile = ./deps.nix;
|
||||||
|
};
|
||||||
|
|
||||||
dontDotnetFixup = true;
|
dontDotnetFixup = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user