anchor.diff:      }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
   
     prebuiltBinary = fetchurl {
  -    url = "https://github.com/crystal-lang/crystal/releases/download/${version}/crystal-${version}-1-${arch}.tar.gz";
  +    url = "https://github.com/crystal-lang/crystal/releases/download/${version}/crystal-${version}-${patch}-${arch}.tar.gz";
       sha256 =
         {
  -        "x86_64-linux" = "0nhs7swbll8hrk15kmmywngkhij80x62axiskb1gjmiwvzhlh0qx";
  -        "i686-linux" = "03xp8d3lqflzzm26lpdn4yavj87qzgd6xyrqxp2pn9ybwrq8fx8a";
  -        "x86_64-darwin" = "1prz6c1gs8z7dgpdy2id2mjn1c8f5p2bf9b39985bav448njbyjz";
  +        "x86_64-linux" = "6a84cc866838ffa5250e28c3ce1a918a93f89c06393fe8cfd4068fcbbc66f3ab";
  +        "i686-linux" = "268a39b8d37385ff60d113d4d9fc966472160faa1e3bbf7ae58860ab6678aceb";
  +        "x86_64-darwin" = "d3f964ebfc5cd48fad73ab2484ea2a00268812276293dd0f7e9c7d184c8aad8a";
         }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
     };
   
     src = fetchurl {
       url = "https://github.com/crystal-lang/crystal/archive/${version}.tar.gz";
  -    sha256 = "05ymwmjkl1b4m888p725kybpiap5ag2vj8l07d59j02inm5r0rcv";
  +    sha256 = "8cf1b9a4eab29fca2f779ea186ae18f7ce444ce189c621925fa1a0c61dd5ff55";
     };
   
     # crystal on Darwin needs libiconv to build
  
positive.code:   sourceRoot = ".";
  
    fixPrebuiltBinary = if stdenv.isDarwin then ''
      wrapProgram $(pwd)/crystal-${version}-1/embedded/bin/crystal \
          --suffix DYLD_LIBRARY_PATH : $libPath
    ''
    else ''
      patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
        crystal-${version}-1/embedded/bin/crystal
      patchelf --set-rpath ${ stdenv.lib.makeLibraryPath [ stdenv.cc.cc ] } \
        crystal-${version}-1/embedded/bin/crystal
    '';
  
    buildPhase = ''
      # patch the script which launches the prebuilt compiler
      substituteInPlace $(pwd)/crystal-${version}-1/bin/crystal --replace \
        "/usr/bin/env bash" "${stdenv.shell}"
      substituteInPlace $(pwd)/crystal-${version}/bin/crystal --replace \
        "/usr/bin/env bash" "${stdenv.shell}"
  
      ${fixPrebuiltBinary}
  
      cd crystal-${version}
      make release=1 PATH="../crystal-${version}-1/bin:$PATH"
      make doc
    '';
  
  
negative.code:     description = "A compiled language with Ruby like syntax and type inference";
      homepage = https://crystal-lang.org/;
      license = stdenv.lib.licenses.asl20;
      maintainers = with stdenv.lib.maintainers; [ sifmelcara david50407 ];
      platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
    };
  }
  