about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/typesetting/asciidoctor/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/typesetting/asciidoctor/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/typesetting/asciidoctor/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/typesetting/asciidoctor/default.nix b/nixpkgs/pkgs/tools/typesetting/asciidoctor/default.nix
new file mode 100644
index 000000000000..73fb46d2e606
--- /dev/null
+++ b/nixpkgs/pkgs/tools/typesetting/asciidoctor/default.nix
@@ -0,0 +1,39 @@
+{ lib, bundlerApp, makeWrapper,
+  # Optional dependencies, can be null
+  epubcheck,
+  bundlerUpdateScript
+}:
+
+let
+  app = bundlerApp {
+    pname = "asciidoctor";
+    gemdir = ./.;
+
+    exes = [
+      "asciidoctor"
+      "asciidoctor-pdf"
+      "asciidoctor-epub3"
+      "asciidoctor-revealjs"
+    ];
+
+    buildInputs = [ makeWrapper ];
+
+    postBuild = ''
+        wrapProgram "$out/bin/asciidoctor-epub3" \
+          ${lib.optionalString (epubcheck != null) "--set EPUBCHECK ${epubcheck}/bin/epubcheck"}
+      '';
+
+    passthru = {
+      updateScript = bundlerUpdateScript "asciidoctor";
+    };
+
+    meta = with lib; {
+      description = "A faster Asciidoc processor written in Ruby";
+      homepage = "https://asciidoctor.org/";
+      license = licenses.mit;
+      maintainers = with maintainers; [ gpyh nicknovitski ];
+      platforms = platforms.unix;
+    };
+  };
+in
+  app