about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-03-10 15:57:14 +0000
committerLudovic Courtès <ludo@gnu.org>2008-03-10 15:57:14 +0000
commitbd361daf062c27347e8e20b0a225b6c781883bfc (patch)
treeea86e8c634f2303f93e5ef92683c5f59ceb9e3c4
parentbc8eb14767280bfda91c487e331918483f7ec109 (diff)
Add AsciiDoc.
svn path=/nixpkgs/trunk/; revision=11039
-rw-r--r--pkgs/tools/typesetting/asciidoc/default.nix51
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix
new file mode 100644
index 0000000000000..375e1fad6a378
--- /dev/null
+++ b/pkgs/tools/typesetting/asciidoc/default.nix
@@ -0,0 +1,51 @@
+{ fetchurl, stdenv, python }:
+
+stdenv.mkDerivation rec {
+  name = "asciidoc-8.2.5";
+  src = fetchurl {
+    url = "mirror://sourceforge/asciidoc/${name}.tar.gz";
+    sha256 = "1aqmii7qyhnn8pby5rlyrc3sl08br35xsdn7wpx2cy03p46pqr7a";
+  };
+
+  patchPhase = ''
+    cat "asciidoc.py" | \
+      sed -e 's,^#!/usr/bin/env python,#!${python}/bin/python,g' \
+      > ,,tmp && mv ,,tmp asciidoc.py && chmod +x asciidoc.py
+    cat "a2x" | \
+      sed -e 's,^#!/usr/bin/env bash,#!${stdenv.bash}/bin/bash,g' \
+      > ,,tmp && mv ,,tmp a2x && chmod +x a2x
+
+    cat "install.sh" | \
+      sed -e "s,^CONFDIR=.*,CONFDIR=$out/etc/asciidoc,g" \
+      > ,,tmp && mv ,,tmp install.sh
+    cat "install.sh" | \
+      sed -e "s,^BINDIR=.*,BINDIR=$out/bin,g" \
+      > ,,tmp && mv ,,tmp install.sh
+    cat "install.sh" | \
+      sed -e "s,^MANDIR=.*,MANDIR=$out/man,g" \
+      > ,,tmp && mv ,,tmp install.sh
+    cat "install.sh" | \
+      sed -e "s,^VIM_CONFDIR=.*,VIM_CONFDIR=$out/etc/vim,g" \
+      > ,,tmp && mv ,,tmp install.sh
+
+    chmod +x install.sh
+  '';
+
+  buildInputs = [ python ];
+  configurePhase = ''true'';
+  installPhase = ''
+    ensureDir $out/bin
+    ensureDir $out/etc
+    ensureDir $out/etc/vim
+    ensureDir $out/man
+    ./install.sh
+  '';
+
+  meta = {
+    description = ''AsciiDoc is a text-based document generation system.
+                    AsciiDoc input files can be translated to HTML and
+		    DocBook markups'';
+    homepage = http://www.methods.co.nz/asciidoc/;
+    license = "GPLv2+";
+  };
+}
\ No newline at end of file
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index df0566f8ef387..5a18c13c10f2b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -412,6 +412,10 @@ rec {
     inherit fetchurl stdenv flex;
   };
 
+  asciidoc = import ../tools/typesetting/asciidoc {
+    inherit fetchurl stdenv python;
+  };
+
   bibtextools = import ../tools/typesetting/bibtex-tools {
     inherit fetchurl stdenv aterm tetex hevea sdf strategoxt;
   };