diff --git a/pkgs/by-name/nu/nuget/package.nix b/pkgs/by-name/nu/nuget/package.nix new file mode 100644 index 000000000000..ff262c68ff64 --- /dev/null +++ b/pkgs/by-name/nu/nuget/package.nix @@ -0,0 +1,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 ]; + platforms = [ "x86_64-linux" ]; + }; +}) diff --git a/pkgs/development/tools/build-managers/msbuild/default.nix b/pkgs/development/tools/build-managers/msbuild/default.nix index 83cdcead353f..1b561470af79 100644 --- a/pkgs/development/tools/build-managers/msbuild/default.nix +++ b/pkgs/development/tools/build-managers/msbuild/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch, makeWrapper, glibcLocales, mono, dotnetPackages, unzip, dotnetCorePackages, writeText, roslyn }: +{ lib, stdenv, fetchurl, fetchpatch, makeWrapper, glibcLocales, mono, nuget, unzip, dotnetCorePackages, writeText, roslyn }: let @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ - dotnetPackages.Nuget + nuget glibcLocales ]; diff --git a/pkgs/top-level/dotnet-packages.nix b/pkgs/top-level/dotnet-packages.nix index 661603b2ba1f..89fba136259e 100644 --- a/pkgs/top-level/dotnet-packages.nix +++ b/pkgs/top-level/dotnet-packages.nix @@ -10,12 +10,14 @@ , mono , overrides ? {} , boogie +, nuget }: let self = dotnetPackages // overrides; dotnetPackages = with self; { # ALIASES FOR MOVED PACKAGES Boogie = boogie; + Nuget = nuget; # BINARY PACKAGES @@ -168,27 +170,6 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { outputFiles = [ "*" ]; }; - Nuget = buildDotnetPackage rec { - pname = "Nuget"; - version = "6.3.1.1"; - - src = fetchFromGitHub { - owner = "mono"; - repo = "linux-packaging-nuget"; - rev = "upstream/${version}.bin"; - sha256 = "sha256-D7F4B23HK5ElY68PYKVDsyi8OF0DLqqUqQzj5CpMfkc="; - }; - - # configurePhase breaks the binary and results in - # `File does not contain a valid CIL image.` - dontConfigure = true; - dontBuild = true; - dontPlacateNuget = true; - - outputFiles = [ "*" ]; - exeFiles = [ "nuget.exe" ]; - }; - Paket = fetchNuGet { pname = "Paket"; version = "5.179.1";