mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-17 06:06:13 +03:00
makeNugetSource: fix meta.description being overwritten, misc cleanup
This commit is contained in:
parent
778a256ee9
commit
5ef866783f
@ -6,10 +6,9 @@
|
||||
}:
|
||||
|
||||
let
|
||||
nuget-source = stdenvNoCC.mkDerivation rec {
|
||||
nuget-source = stdenvNoCC.mkDerivation {
|
||||
inherit name;
|
||||
|
||||
meta.description = description;
|
||||
nativeBuildInputs = [ python3 ];
|
||||
|
||||
buildCommand = ''
|
||||
@ -24,11 +23,16 @@ let
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user