mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
dotnetCorePackages.mkNugetDeps: support loading JSON lockfiles
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
{ symlinkJoin
|
||||
, fetchurl
|
||||
, stdenvNoCC
|
||||
, lib
|
||||
, unzip
|
||||
, patchNupkgs
|
||||
, nugetPackageHook
|
||||
, fetchNupkg
|
||||
{
|
||||
symlinkJoin,
|
||||
lib,
|
||||
fetchNupkg,
|
||||
}:
|
||||
lib.makeOverridable(
|
||||
{ name
|
||||
, nugetDeps ? import sourceFile
|
||||
, sourceFile ? null
|
||||
, installable ? false
|
||||
lib.makeOverridable (
|
||||
{
|
||||
name,
|
||||
nugetDeps ? null,
|
||||
sourceFile ? null,
|
||||
installable ? false,
|
||||
}:
|
||||
(symlinkJoin {
|
||||
name = "${name}-nuget-deps";
|
||||
paths = nugetDeps {
|
||||
fetchNuGet = args: fetchNupkg (args // { inherit installable; });
|
||||
};
|
||||
}) // {
|
||||
inherit sourceFile;
|
||||
paths =
|
||||
let
|
||||
loadDeps =
|
||||
if nugetDeps != null then
|
||||
nugetDeps
|
||||
else if lib.hasSuffix ".nix" sourceFile then
|
||||
assert (lib.isPath sourceFile);
|
||||
import sourceFile
|
||||
else
|
||||
{ fetchNuGet }: builtins.map fetchNuGet (lib.importJSON sourceFile);
|
||||
in
|
||||
loadDeps {
|
||||
fetchNuGet = args: fetchNupkg (args // { inherit installable; });
|
||||
};
|
||||
})
|
||||
// {
|
||||
inherit sourceFile;
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user