about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/typesetting/asciidoctor-with-extensions/default.nix
blob: e31ce69baa1f2efd25116de3991298348a9cb0a1 (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
40
41
{ lib
, bundlerApp
, bundlerUpdateScript
, makeWrapper
, withJava ? true, jre # Used by asciidoctor-diagram for ditaa and PlantUML
}:

let
  path = lib.makeBinPath (lib.optional withJava jre);
in
bundlerApp rec {
  pname = "asciidoctor";
  gemdir = ./.;

  exes = [
    "asciidoctor"
    "asciidoctor-epub3"
    "asciidoctor-multipage"
    "asciidoctor-pdf"
    "asciidoctor-revealjs"
  ];

  buildInputs = [ makeWrapper ];

  postBuild = lib.optionalString (path != "") (lib.concatMapStrings (exe: ''
    wrapProgram $out/bin/${exe} \
      --prefix PATH : ${path}
  '') exes);

  passthru = {
    updateScript = bundlerUpdateScript "asciidoctor-with-extensions";
  };

  meta = with lib; {
    description = "A faster Asciidoc processor written in Ruby, with many extensions enabled";
    homepage = "https://asciidoctor.org/";
    license = licenses.mit;
    maintainers = with maintainers; [ doronbehar ];
    platforms = platforms.unix;
  };
}