about summary refs log tree commit diff
path: root/pkgs/development/compilers/crystal
diff options
context:
space:
mode:
authormingchuan <ming@culpring.com>2017-12-24 11:29:51 +0800
committermingchuan <ming@culpring.com>2017-12-25 00:53:29 +0800
commit5a1d3097878af45e4b41d4ac5cf55c7fccd7a8d3 (patch)
treed1214908e4e0dd2b0f6494a4afe870798c751c2c /pkgs/development/compilers/crystal
parentae15ee42aca7265da2b25efa89afc612a1435913 (diff)
crystal: 0.23.1 -> 0.24.1
Diffstat (limited to 'pkgs/development/compilers/crystal')
-rw-r--r--pkgs/development/compilers/crystal/default.nix40
1 files changed, 18 insertions, 22 deletions
diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix
index 7bb0ed1bf6171..3c3124cea1743 100644
--- a/pkgs/development/compilers/crystal/default.nix
+++ b/pkgs/development/compilers/crystal/default.nix
@@ -2,29 +2,33 @@
 
 stdenv.mkDerivation rec {
   name = "crystal-${version}";
-  version = "0.23.1";
+  version = "0.24.1";
 
   src = fetchurl {
     url = "https://github.com/crystal-lang/crystal/archive/${version}.tar.gz";
-    sha256 = "8cf1b9a4eab29fca2f779ea186ae18f7ce444ce189c621925fa1a0c61dd5ff55";
+    sha256 = "1n375cwzb9rfqbjiimfbj4h5q4rsgh2rf6rmm2zbzizzm79a96a9";
   };
 
-  prebuiltName = "crystal-0.23.0-1";
+  prebuiltName = "crystal-0.24.1-2";
   prebuiltSrc = let arch = {
     "x86_64-linux" = "linux-x86_64";
     "i686-linux" = "linux-i686";
     "x86_64-darwin" = "darwin-x86_64";
   }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
   in fetchurl {
-    url = "https://github.com/crystal-lang/crystal/releases/download/0.23.0/${prebuiltName}-${arch}.tar.gz";
+    url = "https://github.com/crystal-lang/crystal/releases/download/v0.24.1/${prebuiltName}-${arch}.tar.gz";
     sha256 = {
-      "x86_64-linux" = "0nhs7swbll8hrk15kmmywngkhij80x62axiskb1gjmiwvzhlh0qx";
-      "i686-linux" = "03xp8d3lqflzzm26lpdn4yavj87qzgd6xyrqxp2pn9ybwrq8fx8a";
-      "x86_64-darwin" = "1prz6c1gs8z7dgpdy2id2mjn1c8f5p2bf9b39985bav448njbyjz";
+      "x86_64-linux" = "19xchfzsyxh0gqi89y6d73iqc06bl097idz6905jf0i35x9ghpdp";
+      "i686-linux" = "15zaxgc1yc9ixbsgy2d8g8d7x2w4vbnndi1ms3wf0ss8azmghiag";
+      "x86_64-darwin" = "1818ahalahcbh974ai09hyfsns6njkpph4sbn4xwv2235x35dqib";
     }."${stdenv.system}";
   };
 
-  srcs = [ src prebuiltSrc ];
+  unpackPhase = ''
+    mkdir ${prebuiltName}
+    tar --strip-components=1 -C ${prebuiltName} -xf ${prebuiltSrc}
+    tar xf ${src}
+  '';
 
   # crystal on Darwin needs libiconv to build
   libs = [
@@ -41,25 +45,17 @@ stdenv.mkDerivation rec {
 
   sourceRoot = "${name}";
 
-  fixPrebuiltBinary = if stdenv.isDarwin then ''
-    wrapProgram ../${prebuiltName}/embedded/bin/crystal \
-        --suffix DYLD_LIBRARY_PATH : $libPath
-  ''
-  else ''
-    patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
-      ../${prebuiltName}/embedded/bin/crystal
-    patchelf --set-rpath ${ stdenv.lib.makeLibraryPath [ stdenv.cc.cc ] } \
-      ../${prebuiltName}/embedded/bin/crystal
-  '';
-
   preBuild = ''
     patchShebangs bin/crystal
     patchShebangs ../${prebuiltName}/bin/crystal
-    ${fixPrebuiltBinary}
     export PATH="$(pwd)/../${prebuiltName}/bin:$PATH"
   '';
 
-  makeFlags = [ "CRYSTAL_CONFIG_VERSION=${version}" "release=1" "all" "doc" ];
+  makeFlags = [ "CRYSTAL_CONFIG_VERSION=${version}"
+                "FLAGS=--no-debug"
+                "release=1"
+                "all" "docs"
+              ];
 
   installPhase = ''
     install -Dm755 .build/crystal $out/bin/crystal
@@ -70,7 +66,7 @@ stdenv.mkDerivation rec {
     cp -r src/* $out/lib/crystal/
 
     install -dm755 $out/share/doc/crystal/api
-    cp -r doc/* $out/share/doc/crystal/api/
+    cp -r docs/* $out/share/doc/crystal/api/
     cp -r samples $out/share/doc/crystal/
 
     install -Dm644 etc/completion.bash $out/share/bash-completion/completions/crystal