diff options
author | Andrew Kvalheim <Andrew@Kvalhe.im> | 2022-08-09 09:34:42 -0700 |
---|---|---|
committer | Andrew Kvalheim <Andrew@Kvalhe.im> | 2022-08-11 11:42:51 -0700 |
commit | 7b7966a3b2bdbb3ffb132e578eb7a0a9fd0d9211 (patch) | |
tree | b303e98013a9012864e25b25e14b4f25a72398e5 /pkgs/tools/typesetting/asciidoctor-with-extensions | |
parent | 7e5ce549220729d6a3ebe08c5a6a0325be7a8641 (diff) |
asciidoctor-with-extensions: add Java dependency
The asciidoctor-diagram extension vendors JARs and requires a JRE to render ditaa and PlantUML diagrams. Resolves: $ asciidoctor --require asciidoctor-diagram - >/dev/null <<ADOC [ditaa] .... +---+ +---+ | A +-->| B | +---+ +---+ .... ADOC asciidoctor: ERROR: <stdin>: line 2: Failed to generate image: Could not find Java executable
Diffstat (limited to 'pkgs/tools/typesetting/asciidoctor-with-extensions')
-rw-r--r-- | pkgs/tools/typesetting/asciidoctor-with-extensions/default.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/tools/typesetting/asciidoctor-with-extensions/default.nix b/pkgs/tools/typesetting/asciidoctor-with-extensions/default.nix index c4aa7fa4a271a..e31ce69baa1f2 100644 --- a/pkgs/tools/typesetting/asciidoctor-with-extensions/default.nix +++ b/pkgs/tools/typesetting/asciidoctor-with-extensions/default.nix @@ -2,9 +2,13 @@ , bundlerApp , bundlerUpdateScript , makeWrapper +, withJava ? true, jre # Used by asciidoctor-diagram for ditaa and PlantUML }: -bundlerApp { +let + path = lib.makeBinPath (lib.optional withJava jre); +in +bundlerApp rec { pname = "asciidoctor"; gemdir = ./.; @@ -16,6 +20,13 @@ bundlerApp { "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"; }; |