summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/typesetting
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2021-01-21 11:36:35 +0100
committerGitHub <noreply@github.com>2021-01-21 10:36:35 +0000
commite48b0ede04e07de95a7974a7829f9ae4ffd1a334 (patch)
treefd0bdca9da61fa3c70d708fc446c0c5b3b093f2c /pkgs/tools/typesetting
parentdf8b20163b90574f98eb7c0d4857bcf9a1bdc865 (diff)
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
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r--pkgs/tools/typesetting/asciidoc/default.nix34
1 files changed, 20 insertions, 14 deletions
diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix
index 1326c9175938..61af8102f51e 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
'';