buildDotnetModule: nuget source cleanup
There used to be a few issues with the way we generate the nuget source: * The derivation generated for the deps would have "nuget-deps" in them twice: /nix/store/...-foo-1.0-nuget-deps-nuget-deps * We always tried to generate the dependencies for "projectReferences" even when it wasn't set, causing a warning. This fixes those issues :)
This commit is contained in:
parent
38419c65ce
commit
f69de108fb
|
@ -74,13 +74,16 @@ let
|
||||||
inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType;
|
inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType;
|
||||||
}) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook;
|
}) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook;
|
||||||
|
|
||||||
_nugetDeps = mkNugetDeps { name = "${name}-nuget-deps"; nugetDeps = import nugetDeps; };
|
localDeps = if (projectReferences != [])
|
||||||
_localDeps = linkFarmFromDrvs "${name}-local-nuget-deps" projectReferences;
|
then linkFarmFromDrvs "${name}-project-references" projectReferences
|
||||||
|
else null;
|
||||||
|
|
||||||
|
_nugetDeps = mkNugetDeps { inherit name; nugetDeps = import nugetDeps; };
|
||||||
|
|
||||||
nuget-source = mkNugetSource {
|
nuget-source = mkNugetSource {
|
||||||
name = "${args.pname}-nuget-source";
|
name = "${name}-nuget-source";
|
||||||
description = "A Nuget source with the dependencies for ${args.pname}";
|
description = "A Nuget source with the dependencies for ${name}";
|
||||||
deps = [ _nugetDeps _localDeps ];
|
deps = [ _nugetDeps ] ++ lib.optional (localDeps != null) localDeps;
|
||||||
};
|
};
|
||||||
|
|
||||||
in stdenvNoCC.mkDerivation (args // {
|
in stdenvNoCC.mkDerivation (args // {
|
||||||
|
@ -103,6 +106,8 @@ in stdenvNoCC.mkDerivation (args // {
|
||||||
dontWrapGApps = args.dontWrapGApps or true;
|
dontWrapGApps = args.dontWrapGApps or true;
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
inherit nuget-source;
|
||||||
|
|
||||||
fetch-deps = writeScript "fetch-${pname}-deps" ''
|
fetch-deps = writeScript "fetch-${pname}-deps" ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "''${BASH_SOURCE[0]}")"
|
cd "$(dirname "''${BASH_SOURCE[0]}")"
|
||||||
|
|
Loading…
Reference in a new issue