Commit Graph

9 Commits

Author SHA1 Message Date
Raphael Robatsch
928d66083e mkNugetSource: Allow passing arbitrary stdenv.mkDerivation attrs
This allows things such as

    mkNugetSource {
        name = "foo-nuget-source";
        deps = [ ... ];
        meta = {
            hydraPlatforms = [ ];
        };
    }
2024-01-02 20:27:20 +01:00
Raphael Robatsch
5fb3301dad mkNugetSource: Remove meta.licenses attribute
- It's useless. The correct attribute name would be `license` and not
  `licenses`. Meaning setting this never did anything useful.
- It used IFD in its implementation, meaning to know what the licenses
  of a nuget source are, you first had to build that nuget source. This
  defeats the point of having license checks in the first place.
- IFD is not allowed by the nixpkgs CI and build farm anyway.
2024-01-02 11:21:19 +01:00
Sandro Jäckel
bf81cded7d makeNugetSource: symlink files instead of copying them
this reduces the closure size of the resulting derivation drastically
2023-12-15 01:23:21 +00:00
Sandro Jäckel
5ef866783f makeNugetSource: fix meta.description being overwritten, misc cleanup 2023-12-15 01:23:21 +00:00
Raphael Robatsch
0d29814880 mkNugetSource: Also copy .nupkg files from subdirectories
Previously only .nupkg files directly in the deps directory were copied.
This is a regression because it breaks `projectReferences = [ ... ];` in
buildDotnetModule.
2023-05-26 16:18:07 +02:00
Raphael Robatsch
d347b0400c mkNugetSource: remove mono from build closure
A directory full of *.nupkg files is a valid nuget source. We do not need mono
and the Nuget command line tool to create this structure. This has two
advantages:

- Nuget is currently broken due to a kernel bug affecting mono (#229476).
  Replacing the mkNugetSource implementation allows affected users on 6.1+
  kernels compile .NET core packages again.
- It removes mono from the build closure of .NET core packages. .NET core
  builds should not depend on .NET framework tools like mono.

There is no equivalent of the `nuget init` command in .NET core. The closest
command is `dotnet nuget push`, which just copies the *.nupkg files around
anyway, just like this PR does with `cp`.

`nuget init` used to extract the *.nuspec files from the nupkgs, this new
implementation doesn't. .NET core doesn't care, but it makes the license
extraction more difficult. What was previously done with find/grep/xml2 is now
a python script (extract-licenses-from-nupkgs.py).
2023-05-05 18:38:06 +00:00
Felix Buehler
bc3d5934d7 treewide: use lib.optionals 2023-02-14 19:11:59 +01:00
=
38419c65ce mkNugetSource: fix bug in metadata generation
This improves the metadata generation, previously it would take any
"license" entry from the nuspec, and tried to match it to an spdx ID from
"lib.licenses".

Sometimes however licenses are provided in plain-text, which we
obviously cannot cleanly resolve. This resulted in in useless information
("LICENSE.txt") being written to "meta.license".
2022-04-30 18:24:48 -07:00
Moises Nessim
81998d0a1d Add writeFSharp and makeFSharpWriter functions to writers
Uses fsharp interactive (fsi) to run fsx script

Expose mkNugetSource and mkNugetDeps functions

Use them in writers.writeFSharp and buildDotnetModule

Add tests
2022-02-28 17:40:43 -05:00