anchor.diff:  
     buildInputs = [ readline ];
   
  -  configurePhase = "makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux )";
  +  patches = [ dsoPatch ];
  +
  +  configurePhase = ''
  +    makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-O2 -fPIC" LDLAGS="-fPIC" )
  +    installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.a liblua.so liblua.so.5.1" INSTALL_DATA='cp -d' )
  +  '';
  +
  +  postInstall = ''
  +    mkdir -p "$out/share/doc/lua" "$out/lib/pkgconfig"
  +    mv "etc/lua.pc" "$out/lib/pkgconfig/"
  +    mv "doc/"*.{gif,png,css,html} "$out/share/doc/lua/"
  +    rmdir $out/{share,lib}/lua/5.1 $out/{share,lib}/lua
  +  '';
   
     meta = {
       homepage = "http://www.lua.org";
  
positive.code: { stdenv, fetchurl, readline}:
  
  stdenv.mkDerivation rec {
    name = "lua-5.1.5";
  
  
negative.code:     '';
      license = "MIT";
      platforms = stdenv.lib.platforms.unix;
      maintainers = [ stdenv.lib.maintainers.simons ];
    };
  }
  