about summary refs log tree commit diff
path: root/pkgs/development/compilers/nim
diff options
context:
space:
mode:
authorEuan T <euantorano@users.noreply.github.com>2018-05-20 14:33:22 +0100
committerJörg Thalheim <Mic92@users.noreply.github.com>2018-05-20 14:33:22 +0100
commit95b1827682dc30ff1ccffb4f46c197289cea3e1c (patch)
treefa1ecfae6edcac07b69a374fe1c07c0aa30f2b87 /pkgs/development/compilers/nim
parentbeef7ae1b389b15505c6283b420dd05561928cbe (diff)
downloadnixlib-95b1827682dc30ff1ccffb4f46c197289cea3e1c.tar
nixlib-95b1827682dc30ff1ccffb4f46c197289cea3e1c.tar.gz
nixlib-95b1827682dc30ff1ccffb4f46c197289cea3e1c.tar.bz2
nixlib-95b1827682dc30ff1ccffb4f46c197289cea3e1c.tar.lz
nixlib-95b1827682dc30ff1ccffb4f46c197289cea3e1c.tar.xz
nixlib-95b1827682dc30ff1ccffb4f46c197289cea3e1c.tar.zst
nixlib-95b1827682dc30ff1ccffb4f46c197289cea3e1c.zip
nim: 0.17.2 -> 0.18.0 (#40556)
* Nim 0.17.2 -> 0.18.0

* Add missing dependencies for Nim 0.18.0

Solved GC and SFML-related test failures.
Attempting to download nimble packages.

* Fix tzdata test

* Fix tworkingdir test

* Replace outdated nodejs

* Disable non-runnable tests
Diffstat (limited to 'pkgs/development/compilers/nim')
-rw-r--r--pkgs/development/compilers/nim/default.nix47
1 files changed, 39 insertions, 8 deletions
diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix
index a49b1b824394..de383410b9c6 100644
--- a/pkgs/development/compilers/nim/default.nix
+++ b/pkgs/development/compilers/nim/default.nix
@@ -1,12 +1,14 @@
-{ stdenv, lib, fetchurl, makeWrapper, nodejs, openssl, pcre, readline, sqlite }:
+# based on https://github.com/nim-lang/Nim/blob/v0.18.0/.travis.yml
+
+{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim-8_x, openssl, pcre, readline, sqlite, boehmgc, sfml, tzdata, coreutils }:
 
 stdenv.mkDerivation rec {
   name = "nim-${version}";
-  version = "0.17.2";
+  version = "0.18.0";
 
   src = fetchurl {
     url = "https://nim-lang.org/download/${name}.tar.xz";
-    sha256 = "1gc2xk3ygmz9y4pm75pligssgw995a7gvnfpy445fjpw4d81pzxa";
+    sha256 = "45c74adb35f08dfa9add1112ae17330e5d902ebb4a36e7046caee8b79e6f3bd0";
   };
 
   doCheck = true;
@@ -18,6 +20,7 @@ stdenv.mkDerivation rec {
     "-lpcre"
     "-lreadline"
     "-lsqlite3"
+    "-lgc"
   ];
 
   # 1. nodejs is only needed for tests
@@ -25,12 +28,12 @@ stdenv.mkDerivation rec {
   #    used for bootstrapping, but koch insists on moving the nim compiler around
   #    as part of building it, so it cannot be read-only
 
-  buildInputs  = [
-    makeWrapper nodejs
-    openssl pcre readline sqlite
+  buildInputs = [
+    makeWrapper nodejs-slim-8_x tzdata coreutils
+    openssl pcre readline sqlite boehmgc sfml
   ];
 
-  buildPhase   = ''
+  buildPhase = ''
     sh build.sh
     ./bin/nim c koch
     ./koch boot  -d:release \
@@ -48,7 +51,35 @@ stdenv.mkDerivation rec {
       --suffix PATH : ${lib.makeBinPath [ stdenv.cc ]}
   '';
 
-  checkPhase = "./koch tests";
+  postPatch =
+    let disableTest = ''sed -i '1i discard \"\"\"\n  disabled: true\n\"\"\"\n\n' '';
+        disableCompile = ''sed -i -e 's/^/#/' '';
+    in ''
+      substituteInPlace ./tests/async/tioselectors.nim --replace "/bin/sleep" "sleep"
+      substituteInPlace ./tests/osproc/tworkingdir.nim --replace "/usr/bin" "${coreutils}/bin"
+      substituteInPlace ./tests/stdlib/ttimes.nim --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
+
+      # disable supposedly broken tests
+      ${disableTest} ./tests/errmsgs/tproper_stacktrace2.nim
+      ${disableTest} ./tests/vm/trgba.nim
+
+      # disable tests requiring network access (not available in the build container)
+      ${disableTest} ./tests/stdlib/thttpclient.nim
+      ${disableTest} ./tests/cpp/tasync_cpp.nim
+      ${disableTest} ./tests/niminaction/Chapter7/Tweeter/src/tweeter.nim
+
+      # disable tests requiring un-downloadable dependencies (using nimble, which isn't available in the fetch phase)
+      ${disableCompile} ./tests/manyloc/keineschweine/keineschweine.nim
+      ${disableTest} ./tests/manyloc/keineschweine/keineschweine.nim
+      ${disableCompile} ./tests/manyloc/nake/nakefile.nim
+      ${disableTest} ./tests/manyloc/nake/nakefile.nim
+      ${disableCompile} ./tests/manyloc/named_argument_bug/main.nim
+      ${disableTest} ./tests/manyloc/named_argument_bug/main.nim
+    '';
+
+  checkPhase = ''
+    ./koch tests
+  '';
 
   meta = with stdenv.lib; {
     description = "Statically typed, imperative programming language";