anchor.diff:      md5 = "d28e8f428485219f756d80c011d5dd32";
       name = "julia-git-v${version}";
     };
  +
  +  extraSrcs =
  +    let
  +      dsfmt_ver = "2.2";
  +      grisu_ver = "1.1.1";
  +      utf8proc_ver = "1.1.6";
  +
  +      dsfmt_src = fetchurl {
  +        url = "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${dsfmt_ver}.tar.gz";
  +        name = "dsfmt-${dsfmt_ver}.tar.gz";
  +        md5 = "cb61be3be7254eae39684612c524740d";
  +      };
  +      grisu_src = fetchurl {
  +        url = "http://double-conversion.googlecode.com/files/double-conversion-${grisu_ver}.tar.gz";
  +        md5 = "29b533ed4311161267bff1a9a97e2953";
  +      };
  +      utf8proc_src = fetchurl {
  +        url = "http://www.public-software-group.org/pub/projects/utf8proc/v${utf8proc_ver}/utf8proc-v${utf8proc_ver}.tar.gz";
  +        md5 = "2462346301fac2994c34f5574d6c3ca7";
  +      };
  +    in [ dsfmt_src grisu_src utf8proc_src ];
   
     buildInputs =
       [
  
positive.code:       copy_kill_hash "$i" deps
      done
  
      ${if realGcc ==null then "" else ''export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib"''}
  
      export LDFLAGS="-L${suitesparse}/lib -L$out/lib/julia -Wl,-rpath,$out/lib/julia"
  
      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/usr/lib:$PWD/usr/lib/julia"
  
      export PATH="$PATH:${stdenv.cc.libc}/sbin"
    '';
  
    preBuild = ''
      # Link dynamically loaded shared libraries into output so they are found at runtime.
      mkdir -p "$out/lib/julia"
      ln -s "${openblas}/lib/libopenblas.so" "$out/lib/julia/libblas.so"
      ln -s "${openblas}/lib/libopenblas.so" "$out/lib/julia/liblapack.so"
      ln -s "${suitesparse}/lib/libsuitesparse.so" "$out/lib/julia/libsuitesparse.so"
      ln -s "${arpack}/lib/libarpack.so" "$out/lib/julia/libarpack.so"
      for i in umfpack cholmod amd camd colamd spqr; do
        ln -s libsuitesparse.so "$out/lib/julia/lib$i.so";
      done
    '';
  
    dontStrip = true;
  
negative.code:     # is probably not what we want anyway on non-NixOS
      sed -e "s@/sbin/ldconfig@true@" -i src/ccall.*
    '';
  
    # Julia tries to load these libraries dynamically at runtime, but they can't be found.
    # Easier by far to link against them as usual.
    # These go in LDFLAGS, where they affect only Julia itself, and not NIX_LDFLAGS,
    # where they would also be used for all the private libraries Julia builds.
    LDFLAGS = [
      "-larpack"
      "-lfftw3_threads"
      "-lfftw3f_threads"
      "-lglpk"
      "-lgmp"
      "-lmpfr"
      "-lopenblas"
      "-lpcre"
      "-lsuitesparse"
      "-lunistring"
      "-lz"
    ];
  
    configurePhase = ''
      for i in GMP LLVM PCRE READLINE FFTW LIBUNWIND SUITESPARSE GLPK ZLIB MPFR;
  