asciidoc: 8.6.9 -> 9.0.4 (#102398)
Main motivation was to port it to Python3 which is due to #101964. So: - Switch from asciidoc to asciidoc-py3 - Switch from Python 2 to Python 3 - This needs autoreconfHook now - We also need to do some patching in a2x.py - Switch to patchShebangs (more readable) - Only input w3m if we actually build with it
This commit is contained in:
parent
df8b20163b
commit
e48b0ede04
@ -1,5 +1,5 @@
|
|||||||
{ fetchurl, lib, stdenv, python2
|
{ fetchurl, lib, stdenv, python3
|
||||||
|
, fetchFromGitHub, autoreconfHook
|
||||||
, enableStandardFeatures ? false
|
, enableStandardFeatures ? false
|
||||||
, sourceHighlight ? null
|
, sourceHighlight ? null
|
||||||
, highlight ? null
|
, highlight ? null
|
||||||
@ -144,14 +144,17 @@ let
|
|||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "asciidoc-8.6.9";
|
pname = "asciidoc";
|
||||||
|
version = "9.0.4";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchFromGitHub {
|
||||||
url = "mirror://sourceforge/asciidoc/${name}.tar.gz";
|
owner = "asciidoc";
|
||||||
sha256 = "1w71nk527lq504njmaf0vzr93pgahkgzzxzglrq6bay8cw2rvnvq";
|
repo = "asciidoc-py3";
|
||||||
|
rev = version;
|
||||||
|
sha256 = "1gspxw5i0axymxdjzj5rmhf10gyl2gqr666gz141nv042l9dm5vi";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ python2 unzip ];
|
nativeBuildInputs = [ python3 unzip autoreconfHook ];
|
||||||
|
|
||||||
# install filters early, so their shebangs are patched too
|
# install filters early, so their shebangs are patched too
|
||||||
patchPhase = with lib; ''
|
patchPhase = with lib; ''
|
||||||
@ -212,7 +215,7 @@ stdenv.mkDerivation rec {
|
|||||||
# the odp backend already has that fix. Copy it here until fixed upstream.
|
# the odp backend already has that fix. Copy it here until fixed upstream.
|
||||||
sed -i "s|'/etc/asciidoc/backends/odt/asciidoc.ott'|os.path.dirname(__file__),'asciidoc.ott'|" \
|
sed -i "s|'/etc/asciidoc/backends/odt/asciidoc.ott'|os.path.dirname(__file__),'asciidoc.ott'|" \
|
||||||
"$out/etc/asciidoc/backends/odt/a2x-backend.py"
|
"$out/etc/asciidoc/backends/odt/a2x-backend.py"
|
||||||
'' + optionalString enableStandardFeatures ''
|
'' + (if enableStandardFeatures then ''
|
||||||
sed -e "s|dot|${graphviz}/bin/dot|g" \
|
sed -e "s|dot|${graphviz}/bin/dot|g" \
|
||||||
-e "s|neato|${graphviz}/bin/neato|g" \
|
-e "s|neato|${graphviz}/bin/neato|g" \
|
||||||
-e "s|twopi|${graphviz}/bin/twopi|g" \
|
-e "s|twopi|${graphviz}/bin/twopi|g" \
|
||||||
@ -222,7 +225,8 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
sed -e "s|run('latex|run('${texlive}/bin/latex|g" \
|
sed -e "s|run('latex|run('${texlive}/bin/latex|g" \
|
||||||
-e "s|cmd = 'dvipng'|cmd = '${texlive}/bin/dvipng'|g" \
|
-e "s|cmd = 'dvipng'|cmd = '${texlive}/bin/dvipng'|g" \
|
||||||
-i "filters/latex/latex2png.py"
|
-e "s|cmd = 'dvisvgm'|cmd = '${texlive}/bin/dvisvgm'|g" \
|
||||||
|
-i "filters/latex/latex2img.py"
|
||||||
|
|
||||||
sed -e "s|run('abc2ly|run('${lilypond}/bin/abc2ly|g" \
|
sed -e "s|run('abc2ly|run('${lilypond}/bin/abc2ly|g" \
|
||||||
-e "s|run('lilypond|run('${lilypond}/bin/lilypond|g" \
|
-e "s|run('lilypond|run('${lilypond}/bin/lilypond|g" \
|
||||||
@ -249,11 +253,13 @@ stdenv.mkDerivation rec {
|
|||||||
-e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \
|
-e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \
|
||||||
-e "s|^EPUBCHECK =.*|EPUBCHECK = 'nixpkgs_is_missing_epubcheck'|" \
|
-e "s|^EPUBCHECK =.*|EPUBCHECK = 'nixpkgs_is_missing_epubcheck'|" \
|
||||||
-i a2x.py
|
-i a2x.py
|
||||||
'' + ''
|
'' else ''
|
||||||
for n in $(find "$out" . -name \*.py); do
|
sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook_xsl_ns}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml')|" \
|
||||||
sed -i -e "s,^#![[:space:]]*.*/bin/env python,#!${python2}/bin/python,g" "$n"
|
-e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \
|
||||||
chmod +x "$n"
|
-e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \
|
||||||
done
|
-i a2x.py
|
||||||
|
'') + ''
|
||||||
|
patchShebangs .
|
||||||
|
|
||||||
sed -i -e "s,/etc/vim,,g" Makefile.in
|
sed -i -e "s,/etc/vim,,g" Makefile.in
|
||||||
'';
|
'';
|
||||||
|
@ -2820,20 +2820,21 @@ in
|
|||||||
arpoison = callPackage ../tools/networking/arpoison { };
|
arpoison = callPackage ../tools/networking/arpoison { };
|
||||||
|
|
||||||
asciidoc = callPackage ../tools/typesetting/asciidoc {
|
asciidoc = callPackage ../tools/typesetting/asciidoc {
|
||||||
inherit (python2Packages) matplotlib numpy aafigure recursivePthLoader;
|
inherit (python3.pkgs) matplotlib numpy aafigure recursivePthLoader;
|
||||||
w3m = w3m-batch;
|
|
||||||
enableStandardFeatures = false;
|
enableStandardFeatures = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
asciidoc-full = appendToName "full" (asciidoc.override {
|
asciidoc-full = appendToName "full" (asciidoc.override {
|
||||||
inherit (python2Packages) pygments;
|
inherit (python3.pkgs) pygments;
|
||||||
texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; };
|
texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; };
|
||||||
|
w3m = w3m-batch;
|
||||||
enableStandardFeatures = true;
|
enableStandardFeatures = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
asciidoc-full-with-plugins = appendToName "full-with-plugins" (asciidoc.override {
|
asciidoc-full-with-plugins = appendToName "full-with-plugins" (asciidoc.override {
|
||||||
inherit (python2Packages) pygments;
|
inherit (python3.pkgs) pygments;
|
||||||
texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; };
|
texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; };
|
||||||
|
w3m = w3m-batch;
|
||||||
enableStandardFeatures = true;
|
enableStandardFeatures = true;
|
||||||
enableExtraPlugins = true;
|
enableExtraPlugins = true;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user