From 9e00db7b79b2deadab0dd056f117b339b9e19b63 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 31 Oct 2023 00:55:42 +0000 Subject: [PATCH] nim: invert nim1 to be a definition of nim2 --- pkgs/development/compilers/nim/default.nix | 38 +++++++++++----------- pkgs/top-level/all-packages.nix | 5 +-- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix index f0ffa4309f9f..19773ebe4999 100644 --- a/pkgs/development/compilers/nim/default.nix +++ b/pkgs/development/compilers/nim/default.nix @@ -2,8 +2,8 @@ # https://nim-lang.org/docs/nimc.html { lib, callPackage, buildPackages, stdenv, fetchurl, fetchgit, fetchFromGitHub -, makeWrapper, openssl, pcre, readline, boehmgc, sqlite, Security, nim-unwrapped -, nim-unwrapped-2, nim }: +, makeWrapper, openssl, pcre, readline, boehmgc, sqlite, Security +, nim-unwrapped-2, nim-unwrapped-1, nim }: let parseCpu = platform: @@ -74,14 +74,14 @@ let in { - nim-unwrapped = stdenv.mkDerivation (finalAttrs: { + nim-unwrapped-2 = stdenv.mkDerivation (finalAttrs: { pname = "nim-unwrapped"; - version = "1.6.14"; + version = "2.0.0"; strictDeps = true; src = fetchurl { url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz"; - hash = "sha256-0HDS8oriQA33/kpJ7OufRc1TmQaxB0gYVqCveo+oLck="; + hash = "sha256-vWEB2EADb7eOk6ad9s8/n9DCHNdUtpX/hKO0rdjtCvc="; }; buildInputs = [ boehmgc openssl pcre readline sqlite ] @@ -96,7 +96,10 @@ in { ./extra-mangling.patch # Mangle store paths of modules to prevent runtime dependence. - ] ++ lib.optional (!stdenv.hostPlatform.isWindows) ./toLocation.patch; + + ./openssl.patch + # dlopen is widely used by Python, Ruby, Perl, ... what you're really telling me here is that your OS is fundamentally broken. That might be news for you, but it isn't for me. + ]; configurePhase = let bootstrapCompiler = stdenv.mkDerivation { @@ -157,11 +160,11 @@ in { }; }); - nim-unwrapped-2 = nim-unwrapped.overrideAttrs (finalAttrs: rec { - version = "2.0.0"; + nim-unwrapped-1 = nim-unwrapped-2.overrideAttrs (finalAttrs: prevAttrs: { + version = "1.6.14"; src = fetchurl { - url = "https://nim-lang.org/download/nim-${version}.tar.xz"; - hash = "sha256-vWEB2EADb7eOk6ad9s8/n9DCHNdUtpX/hKO0rdjtCvc="; + url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz"; + hash = "sha256-0HDS8oriQA33/kpJ7OufRc1TmQaxB0gYVqCveo+oLck="; }; patches = [ @@ -173,10 +176,7 @@ in { ./extra-mangling.patch # Mangle store paths of modules to prevent runtime dependence. - - ./openssl.patch - # dlopen is widely used by Python, Ruby, Perl, ... what you're really telling me here is that your OS is fundamentally broken. That might be news for you, but it isn't for me. - ]; + ] ++ lib.optional (!stdenv.hostPlatform.isWindows) ./toLocation.patch; }); } // (let @@ -312,14 +312,14 @@ in { }; in { - nim = wrapNim { - nim' = buildPackages.nim-unwrapped; - patches = [ ./nim.cfg.patch ]; - }; - nim2 = wrapNim { nim' = buildPackages.nim-unwrapped-2; patches = [ ./nim2.cfg.patch ]; }; + nim1 = wrapNim { + nim' = buildPackages.nim-unwrapped-1; + patches = [ ./nim.cfg.patch ]; + }; + }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0f6c1e645021..a5c35be35c14 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16806,8 +16806,9 @@ with pkgs; inherit (callPackages ../development/compilers/nim { inherit (darwin) Security; } - ) nim-unwrapped nim-unwrapped-2 nim nim2; - nimPackages = recurseIntoAttrs nim.pkgs; + ) nim-unwrapped-1 nim-unwrapped-2 nim1 nim2; + nim = nim1; + nimPackages = recurseIntoAttrs nim1.pkgs; nim2Packages = recurseIntoAttrs nim2.pkgs; nrpl = callPackage ../development/tools/nrpl { };