about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/nim/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
committerAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
commit50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch)
treef2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/development/compilers/nim/default.nix
parent4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff)
parentcfc75eec4603c06503ae750f88cf397e00796ea8 (diff)
downloadnixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/nim/default.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/nim/default.nix59
1 files changed, 8 insertions, 51 deletions
diff --git a/nixpkgs/pkgs/development/compilers/nim/default.nix b/nixpkgs/pkgs/development/compilers/nim/default.nix
index f18671242130..f0ffa4309f9f 100644
--- a/nixpkgs/pkgs/development/compilers/nim/default.nix
+++ b/nixpkgs/pkgs/development/compilers/nim/default.nix
@@ -3,7 +3,7 @@
 
 { lib, callPackage, buildPackages, stdenv, fetchurl, fetchgit, fetchFromGitHub
 , makeWrapper, openssl, pcre, readline, boehmgc, sqlite, Security, nim-unwrapped
-, nim-unwrapped-2, nimble-unwrapped, nim }:
+, nim-unwrapped-2, nim }:
 
 let
   parseCpu = platform:
@@ -163,6 +163,7 @@ in {
       url = "https://nim-lang.org/download/nim-${version}.tar.xz";
       hash = "sha256-vWEB2EADb7eOk6ad9s8/n9DCHNdUtpX/hKO0rdjtCvc=";
     };
+
     patches = [
       ./NIM_CONFIG_DIR.patch
       # Override compiler configuration via an environmental variable
@@ -172,48 +173,14 @@ 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.
     ];
   });
 
-  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 +295,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 +314,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 ];
   };
+
 })