anchor.diff:        sed -i -e '/<sys\\stat\.h>/s|\\|/|' bzip2.c
       '';
       preConfigure = "sh ./autogen.sh";
  -    # clear native hooks that are not needed with autoconf
  -    preBuild = "";
  -    preInstall = "";
  -    postInstall = "";
     };
   
     outputs = [ "dev" "bin" "static" ] ++ stdenv.lib.optional sharedLibrary "out";
  
positive.code:     ln -s bzip2 $bin/bin/bunzip2
      ln -s bzip2 $bin/bin/bzcat
  
      mkdir "$static"
      mv "$bin/lib" "$static/"
    '';
  
    postPatch = ''
      substituteInPlace Makefile --replace CC=gcc CC=cc
  
negative.code:     make -f ${if stdenv.isDarwin then "Makefile-libbz2_dylib" else "Makefile-libbz2_so"}
    '';
  
    preInstall = stdenv.lib.optionalString
      (sharedLibrary && stdenv.cross.libc or null != "msvcrt")
      (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=$(bin)" ];
  
  