anchor.diff:    postPatch = ''
       substituteInPlace Makefile --replace CC=gcc CC=cc
       substituteInPlace Makefile-libbz2_so --replace CC=gcc CC=cc
  +  '' + stdenv.lib.optionalString stdenv.isDarwin ''
  +    cp ${darwinMakefile} Makefile-libbz2_dylib
  +    substituteInPlace Makefile-libbz2_dylib \
  +      --replace "CC=gcc" "CC=cc" \
  +      --replace "PREFIX=/usr" "PREFIX=$out"
     '';
   
     preConfigure = ''
  
positive.code: let
    version = "1.0.6";
  
    sharedLibrary = !stdenv.isDarwin && !(stdenv ? isStatic)
                 && stdenv.system != "i686-cygwin" && !linkStatic;
  
  in stdenv.mkDerivation {
    name = "bzip2-${version}";
  
  
negative.code:   };
  
    preBuild = stdenv.lib.optionalString sharedLibrary ''
      make -f ${if stdenv.isDarwin then "Makefile-libbz2_dylib" else "Makefile-libbz2_so"}
    '';
  
    preInstall = stdenv.lib.optionalString sharedLibrary (if !stdenv.isDarwin then ''
      mkdir -p $out/lib
      mv libbz2.so* $out/lib
      ( cd $out/lib &&
        ln -s libbz2.so.1.0.? libbz2.so &&
        ln -s libbz2.so.1.0.? libbz2.so.1
      )
    '' else ''
      mkdir -p $out/lib
      mv libbz2.*.dylib $out/lib
      ( cd $out/lib &&
        ln -s libbz2.1.0.?.dylib libbz2.dylib &&
        ln -s libbz2.1.0.?.dylib libbz2.1.dylib
      )
    '');
  
    installFlags = [ "PREFIX=$(out)" ];
  
  