From 7901ce6aefbc0654ce5f690921f79a55bdba2a05 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 29 Sep 2023 19:28:32 +0100 Subject: [PATCH] Remove Nimble from Nim wrapper --- pkgs/development/compilers/nim/default.nix | 53 ++-------------------- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix index f18671242130..ee4d01d27b95 100644 --- a/pkgs/development/compilers/nim/default.nix +++ b/pkgs/development/compilers/nim/default.nix @@ -175,45 +175,8 @@ in { ]; }); - nimble-unwrapped = stdenv.mkDerivation rec { - pname = "nimble-unwrapped"; - version = "0.14.2"; - strictDeps = true; - - src = fetchFromGitHub { - owner = "nim-lang"; - repo = "nimble"; - rev = "v${version}"; - hash = "sha256-8b5yKvEl7c7wA/8cpdaN2CSvawQJzuRce6mULj3z/mI="; - }; - - depsBuildBuild = [ nim-unwrapped ]; - buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin Security; - - nimFlags = [ "--cpu:${nimHost.cpu}" "--os:${nimHost.os}" "-d:release" ]; - - buildPhase = '' - runHook preBuild - HOME=$NIX_BUILD_TOP nim c $nimFlags src/nimble - runHook postBuild - ''; - - installPhase = '' - runHook preBuild - install -Dt $out/bin src/nimble - runHook postBuild - ''; - - meta = with lib; { - description = "Package manager for the Nim programming language"; - homepage = "https://github.com/nim-lang/nimble"; - license = licenses.bsd3; - maintainers = with maintainers; [ ehmry ]; - mainProgram = "nimble"; - }; - }; } // (let - wrapNim = { nim', nimble', patches }: + wrapNim = { nim', patches }: let targetPlatformConfig = stdenv.targetPlatform.config; self = stdenv.mkDerivation (finalAttrs: { @@ -328,20 +291,11 @@ in { $wrapperArgs ln -s $out/bin/${targetPlatformConfig}-testament $out/bin/testament - '' + lib.strings.optionalString (nimble' != null) '' - makeWrapper \ - ${nimble'}/bin/nimble $out/bin/${targetPlatformConfig}-nimble \ - --suffix PATH : $out/bin - ln -s $out/bin/${targetPlatformConfig}-nimble $out/bin/nimble - '' + '' runHook postInstall ''; - passthru = { - nim = nim'; - nimble = nimble'; - }; + passthru = { nim = nim'; }; meta = nim'.meta // { description = nim'.meta.description @@ -356,13 +310,12 @@ in { nim = wrapNim { nim' = buildPackages.nim-unwrapped; - nimble' = buildPackages.nimble-unwrapped; patches = [ ./nim.cfg.patch ]; }; nim2 = wrapNim { nim' = buildPackages.nim-unwrapped-2; - nimble' = null; patches = [ ./nim2.cfg.patch ]; }; + })