1{
2 lib,
3 python3,
4 stdenvNoCC,
5}:
6
7{
8 name,
9 description ? "",
10 deps ? [ ],
11 ...
12}@args:
13
14stdenvNoCC.mkDerivation (
15 lib.recursiveUpdate
16 {
17 inherit name;
18
19 nativeBuildInputs = [ python3 ];
20
21 buildCommand = ''
22 mkdir -p $out/{lib,share}
23
24 # use -L to follow symbolic links. When `projectReferences` is used in
25 # buildDotnetModule, one of the deps will be a symlink farm.
26 find -L ${lib.concatStringsSep " " deps} -type f -name '*.nupkg' -exec \
27 ln -s '{}' -t $out/lib ';'
28
29 # Generates a list of all licenses' spdx ids, if available.
30 # Note that this currently ignores any license provided in plain text (e.g. "LICENSE.txt")
31 python ${./extract-licenses-from-nupkgs.py} $out/lib > $out/share/licenses
32 '';
33
34 meta.description = description;
35 }
36 (
37 removeAttrs args [
38 "name"
39 "description"
40 "deps"
41 ]
42 )
43)