asciidoctor: wrap asciidoctor-epub3 for epubcheck and kindlegen

kindlegen is unfree, so we don't include it by default. The derivation
can be overridden to include it.
This commit is contained in:
Michael Peyton Jones 2019-07-04 14:55:02 +01:00
parent 855936370c
commit d6b7b2a8cf
No known key found for this signature in database
GPG Key ID: 86A43C24A728F66D
2 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,9 @@
{ lib, bundlerApp, mkShell, bundix }:
{ lib, bundlerApp, makeWrapper,
# Optional dependencies, can be null
epubcheck, kindlegen,
# For the update shell
mkShell, bundix
}:
let app = bundlerApp {
pname = "asciidoctor";
@ -11,6 +16,14 @@ let app = bundlerApp {
"asciidoctor-epub3"
];
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram "$out/bin/asciidoctor-epub3" \
${lib.optionalString (epubcheck != null) "--set EPUBCHECK ${epubcheck}/bin/epubcheck"} \
${lib.optionalString (kindlegen != null) "--set KINDLEGEN ${kindlegen}/bin/kindlegen"}
'';
meta = with lib; {
description = "A faster Asciidoc processor written in Ruby";
homepage = https://asciidoctor.org/;

View File

@ -1922,7 +1922,7 @@ in
enableExtraPlugins = true;
});
asciidoctor = callPackage ../tools/typesetting/asciidoctor { };
asciidoctor = callPackage ../tools/typesetting/asciidoctor { kindlegen = null; };
asunder = callPackage ../applications/audio/asunder { };