diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2019-06-26 13:00:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-26 13:00:50 -0400 |
commit | bff22431b5b0848acd4b16cda44dbfa1137ac32e (patch) | |
tree | 5ea033893dfb98f7fac3c1f9fc7c9a91237036a5 /pkgs/development/compilers | |
parent | 8e620e1bc5acfba27a5a8ea240c15e8041e0e68b (diff) | |
parent | b0b64b3927f33040f52cb3c8318b5d4be4d1cbde (diff) | |
download | nixlib-bff22431b5b0848acd4b16cda44dbfa1137ac32e.tar nixlib-bff22431b5b0848acd4b16cda44dbfa1137ac32e.tar.gz nixlib-bff22431b5b0848acd4b16cda44dbfa1137ac32e.tar.bz2 nixlib-bff22431b5b0848acd4b16cda44dbfa1137ac32e.tar.lz nixlib-bff22431b5b0848acd4b16cda44dbfa1137ac32e.tar.xz nixlib-bff22431b5b0848acd4b16cda44dbfa1137ac32e.tar.zst nixlib-bff22431b5b0848acd4b16cda44dbfa1137ac32e.zip |
Merge pull request #62845 from royneary/nim-0.20.0
nim: 0.19.4 -> 0.20.0
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/nim/default.nix | 70 |
1 files changed, 47 insertions, 23 deletions
diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix index aaf45ac36f6d..77d8710cdf93 100644 --- a/pkgs/development/compilers/nim/default.nix +++ b/pkgs/development/compilers/nim/default.nix @@ -1,14 +1,15 @@ # based on https://github.com/nim-lang/Nim/blob/v0.18.0/.travis.yml -{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim-10_x, openssl, pcre, readline, boehmgc, sfml, tzdata, coreutils }: +{ stdenv, lib, fetchurl, makeWrapper, nodejs-slim-11_x, openssl, pcre, readline, + boehmgc, sfml, tzdata, coreutils, sqlite }: stdenv.mkDerivation rec { name = "nim-${version}"; - version = "0.19.4"; + version = "0.20.0"; src = fetchurl { url = "https://nim-lang.org/download/${name}.tar.xz"; - sha256 = "0k59dhfsg5wnkc3nxg5a336pjd9jnfxabns63bl9n28iwdg16hgl"; + sha256 = "144sd7icg2p6qsrr29jdnl11hr34daxq4h16ywwrayz866w7kx2i"; }; doCheck = !stdenv.isDarwin; @@ -20,6 +21,7 @@ stdenv.mkDerivation rec { "-lpcre" "-lreadline" "-lgc" + "-lsqlite3" ]; # 1. nodejs is only needed for tests @@ -27,19 +29,21 @@ 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 + checkInputs = [ + nodejs-slim-11_x tzdata coreutils + ]; + nativeBuildInputs = [ - makeWrapper nodejs-slim-10_x tzdata coreutils + makeWrapper ]; buildInputs = [ - openssl pcre readline boehmgc sfml + openssl pcre readline boehmgc sfml sqlite ]; - phases = [ "unpackPhase" "patchPhase" "buildPhase" "installPhase" "checkPhase" ]; - buildPhase = '' - # use $CC to trigger the linker since calling ld in build.sh causes an error - LD=$CC + runHook preBuild + # build.sh wants to write to $HOME/.cache HOME=$TMPDIR sh build.sh @@ -48,35 +52,55 @@ stdenv.mkDerivation rec { -d:useGnuReadline \ ${lib.optionals (stdenv.isDarwin || stdenv.isLinux) "-d:nativeStacktrace"} ./koch tools -d:release - ''; - installPhase = '' - install -Dt $out/bin bin/* koch - ./koch install $out - mv $out/nim/bin/* $out/bin/ && rmdir $out/nim/bin - mv $out/nim/* $out/ && rmdir $out/nim - wrapProgram $out/bin/nim \ - --suffix PATH : ${lib.makeBinPath [ stdenv.cc ]} + runHook postBuild ''; - patchPhase = + prePatch = let disableTest = ''sed -i '1i discard \"\"\"\n disabled: true\n\"\"\"\n\n' ''; disableStdLibTest = ''sed -i -e '/^when isMainModule/,/^END$/{s/^/#/}' ''; + 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 tests requiring network access (not available in the build container) + # reported upstream: https://github.com/nim-lang/Nim/issues/11435 + ${disableTest} ./tests/misc/tstrace.nim + + # runs out of memory on a machine with 8GB RAM + ${disableTest} ./tests/system/t7894.nim + + # requires network access (not available in the build container) ${disableTest} ./tests/stdlib/thttpclient.nim '' + lib.optionalString stdenv.isAarch64 '' - # disable test supposedly broken on aarch64 + # supposedly broken on aarch64 ${disableStdLibTest} ./lib/pure/stats.nim + + # reported upstream: https://github.com/nim-lang/Nim/issues/11463 + ${disableCompile} ./lib/nimhcr.nim + ${disableTest} ./tests/dll/nimhcr_unit.nim + ${disableTest} ./tests/dll/nimhcr_integration.nim ''; checkPhase = '' - PATH=$PATH:$out/bin - ./koch tests + runHook preCheck + + ./koch tests --nim:bin/nim all + + runHook postCheck + ''; + + installPhase = '' + runHook preInstall + + install -Dt $out/bin bin/* koch + ./koch install $out + mv $out/nim/bin/* $out/bin/ && rmdir $out/nim/bin + mv $out/nim/* $out/ && rmdir $out/nim + wrapProgram $out/bin/nim \ + --suffix PATH : ${lib.makeBinPath [ stdenv.cc ]} + + runHook postInstall ''; meta = with stdenv.lib; { |