@ -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 = " n i m - ${ version } " ;
version = " 0 . 1 7 . 2 " ;
version = " 0 . 1 8 . 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 = " 1 g c 2 x k 3 y g m z 9 y 4 p m 7 5 p l i g s s g w 9 9 5 a 7 g v n f p y 4 4 5 f j p w 4 d 8 1 p z x a " ;
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 " ;
} ;
doCheck = true ;
@ -18,6 +20,7 @@ stdenv.mkDerivation rec {
" - 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 "
] ;
# 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 = " . / k o c h t e s t s " ;
postPatch =
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 ''
substituteInPlace ./tests/async/tioselectors.nim - - replace " / b i n / s l e e p " " s l e e p "
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 = ''
./koch tests
'' ;
meta = with stdenv . lib ; {
description = " S t a t i c a l l y t y p e d , i m p e r a t i v e p r o g r a m m i n g l a n g u a g e " ;