@ -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 = " n i m - ${ version } " ;
version = " 0 . 1 8 . 0 " ;
version = " 0 . 1 9 . 0 " ;
src = fetchurl {
url = " h t t p s : / / n i m - l a n g . o r g / d o w n l o a d / ${ name } . t a r . x z " ;
sha256 = " 4 5 c 7 4 a d b 3 5 f 0 8 d f a 9 a d d 1 1 1 2 a e 1 7 3 3 0 e 5 d 9 0 2 e b b 4 a 3 6 e 7 0 4 6 c a e e 8 b 7 9 e 6 f 3 b d 0 " ;
sha256 = " 0 b i w v w 1 g i v i d p 5 l k f 0 d a q 1 w p 9 v 6 m s 4 x y 6 d k f 5 z j 0 s n 9 w 4 m 3 n 7 6 d 1 " ;
} ;
doCheck = ! stdenv . isDarwin ;
@ -19,7 +19,6 @@ stdenv.mkDerivation rec {
" - l c r y p t o "
" - l p c r e "
" - l r e a d l i n e "
" - l s q l i t e 3 "
" - l g c "
] ;
@ -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 = [ " u n p a c k P h a s e " " p a t c h P h a s e " " b u i l d P h a s e " " i n s t a l l P h a s e " " c h e c k P h a s e " ] ;
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 ] }
'' ;
postP atch =
patchPhase =
let disableTest = '' s e d - i ' 1 i d i s c a r d \ " \ " \ " \ n d i s a b l e d : t r u e \ n \ " \ " \ " \ n \ n ' '' ;
disableCompile = '' s e d - i - e ' s / ^ / # / ' '' ;
in ''
@ -59,25 +64,12 @@ stdenv.mkDerivation rec {
substituteInPlace ./tests/osproc/tworkingdir.nim - - replace " / u s r / b i n " " ${ coreutils } / b i n "
substituteInPlace ./tests/stdlib/ttimes.nim - - replace " / u s r / s h a r e / z o n e i n f o " " ${ tzdata } / s h a r e / z o n e i n f o "
# 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
'' ;