From 9bf79add1380b436d8cf7bb885095cd1a7bcfca0 Mon Sep 17 00:00:00 2001 From: royneary Date: Sat, 27 Oct 2018 14:30:21 +0200 Subject: [PATCH] nim: 0.18.0 -> 0.19.0 - remove sqlite as dependency (I don't see why it's needed) - run checkPhase after installPhase (at least one test assumes the standard library in ../lib relative to the nim binary) - the broken tests pass now or don't exist anymore - two of the tests requiring network access pass now without network access - the tests in manyloc do not download dependencies and are passing now --- pkgs/development/compilers/nim/default.nix | 32 ++++++++-------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/pkgs/development/compilers/nim/default.nix b/pkgs/development/compilers/nim/default.nix index a4b706d35aa5..0d06f847ddfd 100644 --- a/pkgs/development/compilers/nim/default.nix +++ b/pkgs/development/compilers/nim/default.nix @@ -1,14 +1,14 @@ # 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, lib, fetchurl, makeWrapper, nodejs-slim-8_x, openssl, pcre, readline, boehmgc, sfml, tzdata, coreutils }: stdenv.mkDerivation rec { name = "nim-${version}"; - version = "0.18.0"; + version = "0.19.0"; src = fetchurl { url = "https://nim-lang.org/download/${name}.tar.xz"; - sha256 = "45c74adb35f08dfa9add1112ae17330e5d902ebb4a36e7046caee8b79e6f3bd0"; + sha256 = "0biwvw1gividp5lkf0daq1wp9v6ms4xy6dkf5zj0sn9w4m3n76d1"; }; doCheck = !stdenv.isDarwin; @@ -19,7 +19,6 @@ stdenv.mkDerivation rec { "-lcrypto" "-lpcre" "-lreadline" - "-lsqlite3" "-lgc" ]; @@ -30,10 +29,16 @@ stdenv.mkDerivation rec { buildInputs = [ makeWrapper nodejs-slim-8_x tzdata coreutils - openssl pcre readline sqlite boehmgc sfml + openssl pcre readline boehmgc sfml ]; + phases = [ "unpackPhase" "patchPhase" "buildPhase" "installPhase" "checkPhase" ]; + buildPhase = '' + # use gcc to trigger the linker since calling ld in build.sh causes an error + LD=gcc + # build.sh wants to write to $HOME/.cache + HOME=$TMPDIR sh build.sh ./bin/nim c koch ./koch boot -d:release \ @@ -51,7 +56,7 @@ stdenv.mkDerivation rec { --suffix PATH : ${lib.makeBinPath [ stdenv.cc ]} ''; - postPatch = + patchPhase = let disableTest = ''sed -i '1i discard \"\"\"\n disabled: true\n\"\"\"\n\n' ''; disableCompile = ''sed -i -e 's/^/#/' ''; in '' @@ -59,25 +64,12 @@ stdenv.mkDerivation rec { 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 = '' + PATH=$PATH:$out/bin ./koch tests '';