git.iko.soy/typeable/nixpkgs
on master help sign in
crystal: init at 0.29.0
commitf21aa0995b217f6fb08d6258645e8897ca291469 authorPeter Hoeg <peter@hoeg.com> dateThu 6 Jun 2019, 20:35 (7 years ago) parentae71c13
2 files changed+47−9
pkgs/development/compilers/crystal/default.nix+45−9 pkgs/top-level/all-packages.nix+2
pkgs/development/compilers/crystal/default.nix+45−9
@@ -1,11 +1,11 @@
11{ stdenv, lib, fetchFromGitHub, fetchurl, makeWrapper
2−, gmp, openssl, readline, tzdata, libxml2, libyaml
2+, coreutils, git, gmp, nettools, openssl, readline, tzdata, libxml2, libyaml
33, boehmgc, libatomic_ops, pcre, libevent, libiconv, llvm, clang, which, zlib }:
44
55# We need multiple binaries as a given binary isn't always able to build
6−# (even slightly) older or newer version.
6+# (even slightly) older or newer versions.
77# - 0.26.1 can build 0.25.x and 0.26.x but not 0.27.x
8−# - 0.27.2 can build 0.27.x but not 0.25.x and 0.26.x
8+# - 0.27.2 can build 0.27.x but not 0.25.x, 0.26.x and 0.29.x
99#
1010# We need to keep around at least the latest version released with a stable
1111# NixOS
@@ -19,7 +19,7 @@ let
1919
2020 arch = archs."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
2121
22− checkInputs = [ gmp openssl readline libxml2 libyaml tzdata ];
22+ checkInputs = [ git gmp openssl readline libxml2 libyaml ];
2323
2424 genericBinary = { version, sha256s, rel ? 1 }:
2525 stdenv.mkDerivation rec {
@@ -38,8 +38,8 @@ let
3838
3939 generic = { version, sha256, binary, doCheck ? true }:
4040 stdenv.mkDerivation rec {
41− inherit doCheck;
42− name = "crystal-${version}";
41+ pname = "crystal";
42+ inherit doCheck version;
4343
4444 src = fetchFromGitHub {
4545 owner = "crystal-lang";
@@ -48,14 +48,30 @@ let
4848 inherit sha256;
4949 };
5050
51+ # we are almost able to run the full test suite now
5152 postPatch = ''
53+ substituteInPlace src/crystal/system/unix/time.cr \
54+ --replace /usr/share/zoneinfo ${tzdata}/share/zoneinfo
55+
5256 ln -s spec/compiler spec/std
57+
58+ substituteInPlace spec/std/file_spec.cr \
59+ --replace '/bin/ls' '${coreutils}/bin/ls' \
60+ --replace '/usr/share' '/tmp/test'
61+
5362 substituteInPlace spec/std/process_spec.cr \
54− --replace /bin/ /run/current-system/sw/bin/
63+ --replace '/bin/cat' '${coreutils}/bin/cat' \
64+ --replace '/bin/ls' '${coreutils}/bin/ls' \
65+ --replace '/usr/bin/env' '${coreutils}/bin/env' \
66+ --replace '"env"' '"${coreutils}/bin/env"' \
67+ --replace '"/usr"' '"/tmp"'
68+
69+ substituteInPlace spec/std/system_spec.cr \
70+ --replace '`hostname`' '`${nettools}/bin/hostname`'
5571 '';
5672
5773 buildInputs = [
58− boehmgc libatomic_ops pcre libevent
74+ boehmgc libatomic_ops pcre libevent libyaml
5975 llvm zlib openssl
6076 ] ++ stdenv.lib.optionals stdenv.isDarwin [
6177 libiconv
@@ -111,7 +127,11 @@ let
111127 checkTarget = "spec";
112128
113129 preCheck = ''
130+ export HOME=/tmp
131+ mkdir -p $HOME/test
132+
114133 export LIBRARY_PATH=${lib.makeLibraryPath checkInputs}:$LIBRARY_PATH
134+ export PATH=${lib.makeBinPath checkInputs}:$PATH
115135 '';
116136
117137 meta = with lib; {
@@ -142,6 +162,15 @@ in rec {
142162 };
143163 };
144164
165+ binaryCrystal_0_29 = genericBinary {
166+ version = "0.29.0";
167+ sha256s = {
168+ "x86_64-linux" = "1wrk29sfx35akg7hxwpdiikvl18wd40gq1kwirw7x522hnq7vlna";
169+ "i686-linux" = "1nx0piis2k3nn7kqiijqazzbvlaavhgvsln0l3dxmpfa4i4dz5h2";
170+ "x86_64-darwin" = "1fd0fbyf05abivnp3igjlrm2axf65n2wdmg4aq6nqj60ipc01rvd";
171+ };
172+ };
173+
145174 crystal_0_25 = generic {
146175 version = "0.25.1";
147176 sha256 = "15xmbkalsdk9qpc6wfpkly3sifgw6a4ai5jzlv78dh3jp7glmgyl";
@@ -163,5 +192,12 @@ in rec {
163192 binary = binaryCrystal_0_27;
164193 };
165194
166− crystal = crystal_0_27;
195+ crystal_0_29 = generic {
196+ version = "0.29.0";
197+ sha256 = "0v9l253b2x8yw6a43vvalywpwciwr094l3g5wakmndfrzak2s3zr";
198+ doCheck = false; # 6 checks are failing now
199+ binary = binaryCrystal_0_29;
200+ };
201+
202+ crystal = crystal_0_29;
167203}
pkgs/top-level/all-packages.nix+2
@@ -7145,6 +7145,8 @@ in
71457145 })
71467146 crystal_0_25
71477147 crystal_0_26
7148+ crystal_0_27
7149+ crystal_0_29
71487150 crystal;
71497151
71507152 icr = callPackage ../development/tools/icr {};