{ fetchurl, stdenv, ant, jdk, runtimeShell }: stdenv.mkDerivation rec { pname = "fop"; version = "2.1"; src = fetchurl { url = "mirror://apache/xmlgraphics/fop/source/${pname}-${version}-src.tar.gz"; sha256 = "165rx13q47l6qc29ppr7sg1z26vw830s3rkklj5ap7wgvy0ivbz5"; }; buildInputs = [ ant jdk ]; buildPhase = "ant"; installPhase = '' mkdir -p $out/bin $out/lib $out/share/doc/fop cp build/*.jar lib/*.jar $out/lib/ cp -r README examples/ $out/share/doc/fop/ # There is a fop script in the source archive, but it has many impurities. # Instead of patching out 90 % of the script, we write our own. cat > "$out/bin/fop" <