anchor.diff:        "LIBLAPACKNAME=libopenblas"
   
         "USE_SYSTEM_ARPACK=1"
  -
  +      "USE_SYSTEM_GRISU=1"
  +      "USE_SYSTEM_PATCHELF=1"
         "USE_SYSTEM_UTF8PROC=1"
       ];
   
  
positive.code:   NIX_CFLAGS_COMPILE = [ "-fPIC" ];
  
    postPatch = ''
      sed -e "s@/usr/local/lib@$out/lib@g" -i deps/Makefile
      sed -e "s@/usr/lib@$out/lib@g" -i deps/Makefile
  
      patchShebangs . contrib
  
  
negative.code:   extraSrcs =
      let
        dsfmt_ver = "2.2";
  
        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";
        };
      in [ dsfmt_src ];
  
    buildInputs =
      [ libunwind llvm readline utf8proc zlib
        double_conversion fftw fftwSinglePrec glpk gmp mpfr pcre
        openblas arpack suitesparse
      ];
  
    nativeBuildInputs = [ gfortran git m4 patchelf perl which ];
  
    makeFlags =
      let
        arch = head (splitString "-" stdenv.system);
        march =
          { "x86_64-linux" = "x86-64";
            "x86_64-darwin" = "x86-64";
            "i686-linux" = "i686";
          }."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
      in [
  