summary refs log tree commit diff
path: root/pkgs/tools/typesetting
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2013-09-29 21:18:52 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2013-09-29 21:59:34 +0200
commit7f28c64f110bd43136e90284e83cb55ebca70f88 (patch)
treed1fdd487dceb386345f99ec4b383493235956dac /pkgs/tools/typesetting
parent48d3c123048f483a9772ff1f093cbb2d8225f2e0 (diff)
downloadnixpkgs-7f28c64f110bd43136e90284e83cb55ebca70f88.tar
nixpkgs-7f28c64f110bd43136e90284e83cb55ebca70f88.tar.gz
nixpkgs-7f28c64f110bd43136e90284e83cb55ebca70f88.tar.bz2
nixpkgs-7f28c64f110bd43136e90284e83cb55ebca70f88.tar.lz
nixpkgs-7f28c64f110bd43136e90284e83cb55ebca70f88.tar.xz
nixpkgs-7f28c64f110bd43136e90284e83cb55ebca70f88.tar.zst
nixpkgs-7f28c64f110bd43136e90284e83cb55ebca70f88.zip
fop: new package
fop is a XML formatter driven by XSL Formatting Objects (XSL-FO).

Homepage: http://xmlgraphics.apache.org/fop/
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r--pkgs/tools/typesetting/fop/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/tools/typesetting/fop/default.nix b/pkgs/tools/typesetting/fop/default.nix
new file mode 100644
index 00000000000..bc4486ed49c
--- /dev/null
+++ b/pkgs/tools/typesetting/fop/default.nix
@@ -0,0 +1,56 @@
+{ fetchurl, stdenv, ant, jdk }:
+
+stdenv.mkDerivation rec {
+  name = "fop-1.1";
+
+  src = fetchurl {
+    url = "http://apache.uib.no/xmlgraphics/fop/source/${name}-src.tar.gz";
+    sha256 = "08i56d57w5dl5bqchr34x9165hvi5h4bhiflxhi0a4wd56rlq5jq";
+  };
+
+  buildInputs = [ ant jdk ];
+
+  buildPhase = ''
+    ant
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    mkdir -p "$out/lib"
+    mkdir -p "$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" <<EOF
+    #!${stdenv.shell}
+    java_exec_args="-Djava.awt.headless=true"
+    # Note the wildcard; it will be passed to java and java will expand it
+    LOCALCLASSPATH="$out/lib/*"
+    exec "${jdk}/bin/java" \$java_exec_args -classpath "\$LOCALCLASSPATH" org.apache.fop.cli.Main "\$@"
+    EOF
+    chmod a+x "$out/bin/fop"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "XML formatter driven by XSL Formatting Objects (XSL-FO)";
+    longDescription = ''
+      FOP is a Java application that reads a formatting object tree and then
+      turns it into a wide variety of output presentations (including AFP, PCL,
+      PDF, PNG, PostScript, RTF, TIFF, and plain text), or displays the result
+      on-screen.
+
+      The formatting object tree can be in the form of an XML document (output
+      by an XSLT engine like xalan) or can be passed in memory as a DOM
+      Document or (in the case of xalan) SAX events.
+
+      This package contains the fop command line tool.
+    '';
+    homepage = http://xmlgraphics.apache.org/fop/;
+    license = licenses.asl20;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}