Merge pull request #62845 from royneary/nim-0.20.0

nim: 0.19.4 -> 0.20.0
This commit is contained in:
Dmitry Kalinkin 2019-06-26 13:00:50 -04:00 committed by GitHub
commit bff22431b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 34 deletions

View File

@ -4,26 +4,26 @@ let
hts-nim = fetchFromGitHub { hts-nim = fetchFromGitHub {
owner = "brentp"; owner = "brentp";
repo = "hts-nim"; repo = "hts-nim";
rev = "v0.2.5"; rev = "v0.2.14";
sha256 = "1fma99rjqxgg9dihkd10hm1jjp5amsk5wsxnvq1lk4mcsjix5xqb"; sha256 = "0d1z4b6mrppmz3hgkxd4wcy79w68icvhi7q7n3m2k17n8f3xbdx3";
}; };
docopt = fetchFromGitHub { docopt = fetchFromGitHub {
owner = "docopt"; owner = "docopt";
repo = "docopt.nim"; repo = "docopt.nim";
rev = "v0.6.5"; rev = "v0.6.7";
sha256 = "0yx79m4jkdcazwlky55nwf39zj5kdhymrrdrjq29mahiwx83x5zr"; sha256 = "1ga7ckg21fzwwvh26jp2phn2h3pvkn8g8sm13dxif33rp471bv37";
}; };
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
name = "mosdepth-${version}"; name = "mosdepth-${version}";
version = "0.2.3"; version = "0.2.6";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "brentp"; owner = "brentp";
repo = "mosdepth"; repo = "mosdepth";
rev = "v${version}"; rev = "v${version}";
sha256 = "1b9frrwhcvay3alhn0d02jccc2qlbij1732hzq9nhwnr4kvsvxx7"; sha256 = "0i9pl9lsli3y84ygxanrr525gfg8fs9h481944cbzsmqmbldwvgk";
}; };
buildInputs = [ nim ]; buildInputs = [ nim ];

View File

@ -1,14 +1,15 @@
# based on https://github.com/nim-lang/Nim/blob/v0.18.0/.travis.yml # 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 { stdenv.mkDerivation rec {
name = "nim-${version}"; name = "nim-${version}";
version = "0.19.4"; version = "0.20.0";
src = fetchurl { src = fetchurl {
url = "https://nim-lang.org/download/${name}.tar.xz"; url = "https://nim-lang.org/download/${name}.tar.xz";
sha256 = "0k59dhfsg5wnkc3nxg5a336pjd9jnfxabns63bl9n28iwdg16hgl"; sha256 = "144sd7icg2p6qsrr29jdnl11hr34daxq4h16ywwrayz866w7kx2i";
}; };
doCheck = !stdenv.isDarwin; doCheck = !stdenv.isDarwin;
@ -20,6 +21,7 @@ stdenv.mkDerivation rec {
"-lpcre" "-lpcre"
"-lreadline" "-lreadline"
"-lgc" "-lgc"
"-lsqlite3"
]; ];
# 1. nodejs is only needed for tests # 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 # used for bootstrapping, but koch insists on moving the nim compiler around
# as part of building it, so it cannot be read-only # as part of building it, so it cannot be read-only
checkInputs = [
nodejs-slim-11_x tzdata coreutils
];
nativeBuildInputs = [ nativeBuildInputs = [
makeWrapper nodejs-slim-10_x tzdata coreutils makeWrapper
]; ];
buildInputs = [ buildInputs = [
openssl pcre readline boehmgc sfml openssl pcre readline boehmgc sfml sqlite
]; ];
phases = [ "unpackPhase" "patchPhase" "buildPhase" "installPhase" "checkPhase" ];
buildPhase = '' buildPhase = ''
# use $CC to trigger the linker since calling ld in build.sh causes an error runHook preBuild
LD=$CC
# build.sh wants to write to $HOME/.cache # build.sh wants to write to $HOME/.cache
HOME=$TMPDIR HOME=$TMPDIR
sh build.sh sh build.sh
@ -48,35 +52,55 @@ stdenv.mkDerivation rec {
-d:useGnuReadline \ -d:useGnuReadline \
${lib.optionals (stdenv.isDarwin || stdenv.isLinux) "-d:nativeStacktrace"} ${lib.optionals (stdenv.isDarwin || stdenv.isLinux) "-d:nativeStacktrace"}
./koch tools -d:release ./koch tools -d:release
runHook postBuild
'';
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/osproc/tworkingdir.nim --replace "/usr/bin" "${coreutils}/bin"
substituteInPlace ./tests/stdlib/ttimes.nim --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
# 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 ''
# 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 = ''
runHook preCheck
./koch tests --nim:bin/nim all
runHook postCheck
''; '';
installPhase = '' installPhase = ''
runHook preInstall
install -Dt $out/bin bin/* koch install -Dt $out/bin bin/* koch
./koch install $out ./koch install $out
mv $out/nim/bin/* $out/bin/ && rmdir $out/nim/bin mv $out/nim/bin/* $out/bin/ && rmdir $out/nim/bin
mv $out/nim/* $out/ && rmdir $out/nim mv $out/nim/* $out/ && rmdir $out/nim
wrapProgram $out/bin/nim \ wrapProgram $out/bin/nim \
--suffix PATH : ${lib.makeBinPath [ stdenv.cc ]} --suffix PATH : ${lib.makeBinPath [ stdenv.cc ]}
'';
patchPhase = runHook postInstall
let disableTest = ''sed -i '1i discard \"\"\"\n disabled: true\n\"\"\"\n\n' '';
disableStdLibTest = ''sed -i -e '/^when isMainModule/,/^END$/{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)
${disableTest} ./tests/stdlib/thttpclient.nim
'' + lib.optionalString stdenv.isAarch64 ''
# disable test supposedly broken on aarch64
${disableStdLibTest} ./lib/pure/stats.nim
'';
checkPhase = ''
PATH=$PATH:$out/bin
./koch tests
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {