about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2023-12-06 17:17:47 +0100
committerYt <raphael@megzari.com>2023-12-15 01:23:21 +0000
commit5ef866783f04770bb0cc088075eb090627a4f7d4 (patch)
tree52b81a3c288b5529902855320056d3bc792ef1a0
parent778a256ee9838bd19985611edf5bf17605ef1f57 (diff)
downloadnixlib-5ef866783f04770bb0cc088075eb090627a4f7d4.tar
nixlib-5ef866783f04770bb0cc088075eb090627a4f7d4.tar.gz
nixlib-5ef866783f04770bb0cc088075eb090627a4f7d4.tar.bz2
nixlib-5ef866783f04770bb0cc088075eb090627a4f7d4.tar.lz
nixlib-5ef866783f04770bb0cc088075eb090627a4f7d4.tar.xz
nixlib-5ef866783f04770bb0cc088075eb090627a4f7d4.tar.zst
nixlib-5ef866783f04770bb0cc088075eb090627a4f7d4.zip
makeNugetSource: fix meta.description being overwritten, misc cleanup
-rw-r--r--pkgs/build-support/dotnet/make-nuget-source/default.nix18
1 files changed, 11 insertions, 7 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..ddc2e7b52dbb 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 = ''
@@ -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