asciidoc: add support for aafigure filter
This commit is contained in:
parent
0e9599ca94
commit
ff4b28be47
@ -5,13 +5,15 @@
|
|||||||
, enableDiagFilter ? false, blockdiag ? null, seqdiag ? null, actdiag ? null, nwdiag ? null
|
, enableDiagFilter ? false, blockdiag ? null, seqdiag ? null, actdiag ? null, nwdiag ? null
|
||||||
, enableQrcodeFilter ? false, qrencode ? null
|
, enableQrcodeFilter ? false, qrencode ? null
|
||||||
, enableMatplotlibFilter ? false, matplotlib ? null, numpy ? null
|
, enableMatplotlibFilter ? false, matplotlib ? null, numpy ? null
|
||||||
|
, enableAafigureFilter ? false, aafigure ? null, recursivePthLoader ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert (enableDitaaFilter || enableMscgenFilter || enableDiagFilter || enableQrcodeFilter) -> unzip != null;
|
assert (enableDitaaFilter || enableMscgenFilter || enableDiagFilter || enableQrcodeFilter || enableAafigureFilter) -> unzip != null;
|
||||||
assert enableDitaaFilter -> jre != null;
|
assert enableDitaaFilter -> jre != null;
|
||||||
assert enableMscgenFilter -> mscgen != null;
|
assert enableMscgenFilter -> mscgen != null;
|
||||||
assert enableDiagFilter -> blockdiag != null && seqdiag != null && actdiag != null && nwdiag != null;
|
assert enableDiagFilter -> blockdiag != null && seqdiag != null && actdiag != null && nwdiag != null;
|
||||||
assert enableMatplotlibFilter -> matplotlib != null && numpy != null;
|
assert enableMatplotlibFilter -> matplotlib != null && numpy != null;
|
||||||
|
assert enableAafigureFilter -> aafigure != null && recursivePthLoader != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
ditaaFilterSrc = fetchurl {
|
ditaaFilterSrc = fetchurl {
|
||||||
@ -42,6 +44,11 @@ let
|
|||||||
sha256 = "0yfhkm2dr8gnp0fcg25x89hwiymkri2m5cyqzmzragzwj0hbmcf1";
|
sha256 = "0yfhkm2dr8gnp0fcg25x89hwiymkri2m5cyqzmzragzwj0hbmcf1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
aafigureFilterSrc = fetchurl {
|
||||||
|
url = "https://asciidoc-aafigure-filter.googlecode.com/files/aafigure-filter-1.1.zip";
|
||||||
|
sha256 = "1hq2s30dvmv5dqvj0xm1qwdwafhgm9w1iyr0lr0c40cyk8h00j8j";
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -91,6 +98,14 @@ stdenv.mkDerivation rec {
|
|||||||
numpy_path="$(toPythonPath ${numpy})"
|
numpy_path="$(toPythonPath ${numpy})"
|
||||||
sed -i "/^import.*sys/asys.path.append(\"$matplotlib_path\"); sys.path.append(\"$numpy_path\");" \
|
sed -i "/^import.*sys/asys.path.append(\"$matplotlib_path\"); sys.path.append(\"$numpy_path\");" \
|
||||||
"$out/etc/asciidoc/filters/mpl/mplw.py"
|
"$out/etc/asciidoc/filters/mpl/mplw.py"
|
||||||
|
'' + optionalString enableAafigureFilter ''
|
||||||
|
echo "Extracting aafigure filter"
|
||||||
|
unzip -d "$out/etc/asciidoc/filters/aafigure" "${aafigureFilterSrc}"
|
||||||
|
# Add aafigure to sys.path (and it needs recursive-pth-loader)
|
||||||
|
pth_loader_path="$(toPythonPath ${recursivePthLoader})"
|
||||||
|
aafigure_path="$(toPythonPath ${aafigure})"
|
||||||
|
sed -i "/^import.*sys/asys.path.append(\"$pth_loader_path\"); sys.path.append(\"$aafigure_path\"); import sitecustomize" \
|
||||||
|
"$out/etc/asciidoc/filters/aafigure/aafig2img.py"
|
||||||
'' + ''
|
'' + ''
|
||||||
for n in $(find "$out" . -name \*.py); do
|
for n in $(find "$out" . -name \*.py); do
|
||||||
sed -i -e "s,^#![[:space:]]*/usr/bin/env python,#!${python}/bin/python,g" "$n"
|
sed -i -e "s,^#![[:space:]]*/usr/bin/env python,#!${python}/bin/python,g" "$n"
|
||||||
|
@ -563,7 +563,7 @@ let
|
|||||||
mcelog = callPackage ../os-specific/linux/mcelog { };
|
mcelog = callPackage ../os-specific/linux/mcelog { };
|
||||||
|
|
||||||
asciidoc = callPackage ../tools/typesetting/asciidoc {
|
asciidoc = callPackage ../tools/typesetting/asciidoc {
|
||||||
inherit (pythonPackages) matplotlib numpy;
|
inherit (pythonPackages) matplotlib numpy aafigure recursivePthLoader;
|
||||||
};
|
};
|
||||||
|
|
||||||
autossh = callPackage ../tools/networking/autossh { };
|
autossh = callPackage ../tools/networking/autossh { };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user