fop: Drop runtime dependency on the JDK

+7 -13
+7 -13
pkgs/tools/typesetting/fop/default.nix
··· 4 4 name = "fop-1.1"; 5 5 6 6 src = fetchurl { 7 - url = "http://apache.uib.no/xmlgraphics/fop/source/${name}-src.tar.gz"; 7 + url = "mirror://apache/xmlgraphics/fop/source/${name}-src.tar.gz"; 8 8 sha256 = "08i56d57w5dl5bqchr34x9165hvi5h4bhiflxhi0a4wd56rlq5jq"; 9 9 }; 10 10 11 11 buildInputs = [ ant jdk ]; 12 12 13 - buildPhase = '' 14 - ant 15 - ''; 13 + buildPhase = "ant"; 16 14 17 15 installPhase = '' 18 - mkdir -p "$out/bin" 19 - mkdir -p "$out/lib" 20 - mkdir -p "$out/share/doc/fop" 16 + mkdir -p $out/bin $out/lib $out/share/doc/fop 21 17 22 - cp build/*.jar lib/*.jar "$out/lib/" 23 - cp -r README examples/ "$out/share/doc/fop/" 18 + cp build/*.jar lib/*.jar $out/lib/ 19 + cp -r README examples/ $out/share/doc/fop/ 24 20 25 21 # There is a fop script in the source archive, but it has many impurities. 26 22 # Instead of patching out 90 % of the script, we write our own. 27 23 cat > "$out/bin/fop" <<EOF 28 24 #!${stdenv.shell} 29 25 java_exec_args="-Djava.awt.headless=true" 30 - # Note the wildcard; it will be passed to java and java will expand it 31 - LOCALCLASSPATH="$out/lib/*" 32 - exec "${jdk}/bin/java" \$java_exec_args -classpath "\$LOCALCLASSPATH" org.apache.fop.cli.Main "\$@" 26 + exec ${jdk.jre}/bin/java \$java_exec_args -classpath "$out/lib/*" org.apache.fop.cli.Main "\$@" 33 27 EOF 34 - chmod a+x "$out/bin/fop" 28 + chmod a+x $out/bin/fop 35 29 ''; 36 30 37 31 meta = with stdenv.lib; {