diff options
Diffstat (limited to 'pkgs/build-support/dotnet/make-nuget-source/default.nix')
-rw-r--r-- | pkgs/build-support/dotnet/make-nuget-source/default.nix | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/pkgs/build-support/dotnet/make-nuget-source/default.nix b/pkgs/build-support/dotnet/make-nuget-source/default.nix index a23a143ab246..48de65e8a881 100644 --- a/pkgs/build-support/dotnet/make-nuget-source/default.nix +++ b/pkgs/build-support/dotnet/make-nuget-source/default.nix @@ -6,10 +6,9 @@ }: let - nuget-source = stdenvNoCC.mkDerivation rec { + nuget-source = stdenvNoCC.mkDerivation { inherit name; - meta.description = description; nativeBuildInputs = [ python3 ]; buildCommand = '' @@ -18,17 +17,22 @@ let # use -L to follow symbolic links. When `projectReferences` is used in # buildDotnetModule, one of the deps will be a symlink farm. find -L ${lib.concatStringsSep " " deps} -type f -name '*.nupkg' -exec \ - cp --no-clobber '{}' $out/lib ';' + ln -s '{}' -t $out/lib ';' # Generates a list of all licenses' spdx ids, if available. # Note that this currently ignores any license provided in plain text (e.g. "LICENSE.txt") python ${./extract-licenses-from-nupkgs.py} $out/lib > $out/share/licenses ''; + + meta.description = description; } // { # We need data from `$out` for `meta`, so we have to use overrides as to not hit infinite recursion. - meta.licence = let - depLicenses = lib.splitString "\n" (builtins.readFile "${nuget-source}/share/licenses"); - in (lib.flatten (lib.forEach depLicenses (spdx: - lib.optionals (spdx != "") (lib.getLicenseFromSpdxId spdx) - ))); + meta = nuget-source.meta // { + licenses = let + # TODO: avoid IFD + depLicenses = lib.splitString "\n" (builtins.readFile "${nuget-source}/share/licenses"); + in lib.flatten (lib.forEach depLicenses (spdx: + lib.optionals (spdx != "") (lib.getLicenseFromSpdxId spdx) + )); + }; }; in nuget-source |