diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix index 1326c91759389..61af8102f51eb 100644 --- a/pkgs/tools/typesetting/asciidoc/default.nix +++ b/pkgs/tools/typesetting/asciidoc/default.nix @@ -1,5 +1,5 @@ -{ fetchurl, lib, stdenv, python2 - +{ fetchurl, lib, stdenv, python3 +, fetchFromGitHub, autoreconfHook , enableStandardFeatures ? false , sourceHighlight ? null , highlight ? null @@ -144,14 +144,17 @@ let in stdenv.mkDerivation rec { - name = "asciidoc-8.6.9"; + pname = "asciidoc"; + version = "9.0.4"; - src = fetchurl { - url = "mirror://sourceforge/asciidoc/${name}.tar.gz"; - sha256 = "1w71nk527lq504njmaf0vzr93pgahkgzzxzglrq6bay8cw2rvnvq"; + src = fetchFromGitHub { + owner = "asciidoc"; + repo = "asciidoc-py3"; + rev = version; + sha256 = "1gspxw5i0axymxdjzj5rmhf10gyl2gqr666gz141nv042l9dm5vi"; }; - buildInputs = [ python2 unzip ]; + nativeBuildInputs = [ python3 unzip autoreconfHook ]; # install filters early, so their shebangs are patched too patchPhase = with lib; '' @@ -212,7 +215,7 @@ stdenv.mkDerivation rec { # 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'|" \ "$out/etc/asciidoc/backends/odt/a2x-backend.py" - '' + optionalString enableStandardFeatures '' + '' + (if enableStandardFeatures then '' sed -e "s|dot|${graphviz}/bin/dot|g" \ -e "s|neato|${graphviz}/bin/neato|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" \ -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" \ -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|^EPUBCHECK =.*|EPUBCHECK = 'nixpkgs_is_missing_epubcheck'|" \ -i a2x.py - '' + '' - for n in $(find "$out" . -name \*.py); do - sed -i -e "s,^#![[:space:]]*.*/bin/env python,#!${python2}/bin/python,g" "$n" - chmod +x "$n" - done + '' else '' + 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')|" \ + -e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \ + -e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \ + -i a2x.py + '') + '' + patchShebangs . sed -i -e "s,/etc/vim,,g" Makefile.in ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eb049d9923db2..2674b5a5b9a15 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2806,20 +2806,21 @@ in arpoison = callPackage ../tools/networking/arpoison { }; asciidoc = callPackage ../tools/typesetting/asciidoc { - inherit (python2Packages) matplotlib numpy aafigure recursivePthLoader; - w3m = w3m-batch; + inherit (python3.pkgs) matplotlib numpy aafigure recursivePthLoader; enableStandardFeatures = false; }; asciidoc-full = appendToName "full" (asciidoc.override { - inherit (python2Packages) pygments; + inherit (python3.pkgs) pygments; texlive = texlive.combine { inherit (texlive) scheme-minimal dvipng; }; + w3m = w3m-batch; enableStandardFeatures = true; }); 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; }; + w3m = w3m-batch; enableStandardFeatures = true; enableExtraPlugins = true; });