about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/nu/nuget/package.nix
blob: 6bf41690a2eadb550e3a27bbd0af9b8ad0f147bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ stdenv, fetchFromGitHub, makeWrapper, mono, lib }:

stdenv.mkDerivation (attrs: {
  pname = "Nuget";
  version = "6.6.1.2";

  src = fetchFromGitHub {
    owner = "mono";
    repo = "linux-packaging-nuget";
    rev = "upstream/${attrs.version}.bin";
    sha256 = "sha256-9/dSeVshHbpYIgGE/8OzrB4towrWVB3UxDi8Esmbu7Y=";
  };

  nativeBuildInputs = [
    makeWrapper
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/lib/${attrs.pname}
    cp -r . $out/lib/${attrs.pname}/

    mkdir -p $out/bin
    makeWrapper \
      "${mono}/bin/mono" \
      "$out/bin/nuget" \
      --add-flags "$out/lib/${attrs.pname}/nuget.exe"

    runHook postInstall
  '';

  meta = with lib; {
    description = "A package manager for the .NET platform";
    homepage = "https://www.mono-project.com/";
    longDescription = ''
      NuGet is the package manager for the .NET platform.
      This derivation bundles the Mono NuGet CLI, which is mostly used by
      older projects based on .NET Framework.

      Newer .NET projects can use the dotnet CLI, which has most of this
      packages functionality built-in.
    '';
    # https://learn.microsoft.com/en-us/nuget/resources/nuget-faq#what-is-the-license-for-nuget-exe-
    license = licenses.mit;
    sourceProvenance = [ sourceTypes.binaryBytecode ];
    maintainers = [ maintainers.mdarocha ];
    inherit (mono.meta) platforms;
  };
})