Skip to content

Commit

Permalink
asciidoc: get rid of ? null
Browse files Browse the repository at this point in the history
  • Loading branch information
dotlambda committed Jun 29, 2022
1 parent 919e04f commit 601d9db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 64 deletions.
83 changes: 26 additions & 57 deletions pkgs/tools/typesetting/asciidoc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
, fetchFromGitHub, autoreconfHook
, installShellFiles
, enableStandardFeatures ? false
, sourceHighlight ? null
, highlight ? null
, pygments ? null
, graphviz ? null
, texlive ? null
, dblatexFull ? null
, libxslt ? null
, w3m ? null
, lynx ? null
, imagemagick ? null
, lilypond ? null
, libxml2 ? null
, docbook_xml_dtd_45 ? null
, docbook_xsl_ns ? null
, docbook_xsl ? null
, fop ? null
, epubcheck ? null
, gnused ? null
, coreutils ? null
, sourceHighlight
, highlight
, pygments
, graphviz
, texlive
, dblatexFull
, libxslt
, w3m
, lynx
, imagemagick
, lilypond
, libxml2
, docbook_xml_dtd_45
, docbook_xsl_ns
, docbook_xsl
, fop
, epubcheck
, gnused
, coreutils

# if true, enable all the below filters and backends
, enableExtraPlugins ? false

# unzip is needed to extract filter and backend plugins
, unzip ? null
, unzip
# filters
, enableDitaaFilter ? false, jre ? null
, enableMscgenFilter ? false, mscgen ? null
, enableDiagFilter ? false, blockdiag ? null, seqdiag ? null, actdiag ? null, nwdiag ? null
, enableQrcodeFilter ? false, qrencode ? null
, enableMatplotlibFilter ? false, matplotlib ? null, numpy ? null
, enableAafigureFilter ? false, aafigure ? null, recursivePthLoader ? null
, enableDitaaFilter ? false, jre
, enableMscgenFilter ? false, mscgen
, enableDiagFilter ? false, blockdiag, seqdiag, actdiag, nwdiag
, enableQrcodeFilter ? false, qrencode
, enableMatplotlibFilter ? false, matplotlib, numpy
, enableAafigureFilter ? false, aafigure, recursivePthLoader
# backends
, enableDeckjsBackend ? false
, enableOdfBackend ? false
Expand All @@ -44,37 +44,6 @@
, buildPackages
}:

assert enableStandardFeatures ->
sourceHighlight != null &&
highlight != null &&
pygments != null &&
graphviz != null &&
texlive != null &&
dblatexFull != null &&
libxslt != null &&
w3m != null &&
lynx != null &&
imagemagick != null &&
lilypond != null &&
libxml2 != null &&
docbook_xml_dtd_45 != null &&
docbook_xsl_ns != null &&
docbook_xsl != null &&
(fop != null || !enableJava) &&
epubcheck != null &&
gnused != null &&
coreutils != null;

# filters
assert enableExtraPlugins || enableDitaaFilter || enableMscgenFilter || enableDiagFilter || enableQrcodeFilter || enableAafigureFilter -> unzip != null;
assert (enableExtraPlugins && enableJava) || enableDitaaFilter -> jre != null;
assert enableExtraPlugins || enableMscgenFilter -> mscgen != null;
assert enableExtraPlugins || enableDiagFilter -> blockdiag != null && seqdiag != null && actdiag != null && nwdiag != null;
assert enableExtraPlugins || enableMatplotlibFilter -> matplotlib != null && numpy != null;
assert enableExtraPlugins || enableAafigureFilter -> aafigure != null && recursivePthLoader != null;
# backends
assert enableExtraPlugins || enableDeckjsBackend || enableOdfBackend -> unzip != null;

let

_enableDitaaFilter = (enableExtraPlugins && enableJava) || enableDitaaFilter;
Expand Down
10 changes: 3 additions & 7 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4470,21 +4470,17 @@ with pkgs;
arpoison = callPackage ../tools/networking/arpoison { };

asciidoc = callPackage ../tools/typesetting/asciidoc {
inherit (python3.pkgs) matplotlib numpy aafigure recursivePthLoader;
inherit (python3.pkgs) pygments matplotlib numpy aafigure recursivePthLoader;
texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; };
w3m = w3m-batch;
enableStandardFeatures = false;
};

asciidoc-full = asciidoc.override {
inherit (python3.pkgs) pygments;
texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; };
w3m = w3m-batch;
enableStandardFeatures = true;
};

asciidoc-full-with-plugins = asciidoc.override {
inherit (python3.pkgs) pygments;
texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; };
w3m = w3m-batch;
enableStandardFeatures = true;
enableExtraPlugins = true;
};
Expand Down

0 comments on commit 601d9db

Please sign in to comment.