summary refs log tree commit diff
path: root/pkgs/tools/typesetting/asciidoctor/default.nix
blob: 73fb46d2e60647ca22b849d1d3fbcd145fe156d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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