diff options
author | Guillaume Girol <symphorien@users.noreply.github.com> | 2021-07-17 09:46:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-17 09:46:51 +0000 |
commit | 29bbe7c6169adf86e8e51f14ef6c133480f608df (patch) | |
tree | f4cb505185bc3cc03af3eaa47e6ae7db8d125ddc /pkgs | |
parent | a13c5683649f7b68a95094a432ea8e5150ef7923 (diff) | |
parent | 982d06127188c2bc6c669b2a8982c46187c910f3 (diff) | |
download | nixpkgs-29bbe7c6169adf86e8e51f14ef6c133480f608df.tar nixpkgs-29bbe7c6169adf86e8e51f14ef6c133480f608df.tar.gz nixpkgs-29bbe7c6169adf86e8e51f14ef6c133480f608df.tar.bz2 nixpkgs-29bbe7c6169adf86e8e51f14ef6c133480f608df.tar.lz nixpkgs-29bbe7c6169adf86e8e51f14ef6c133480f608df.tar.xz nixpkgs-29bbe7c6169adf86e8e51f14ef6c133480f608df.tar.zst nixpkgs-29bbe7c6169adf86e8e51f14ef6c133480f608df.zip |
Merge pull request #130305 from Mindavi/asciidoc/cross
asciidoc: support cross-compilation
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/typesetting/asciidoc/default.nix | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix index ce3b142fbc5..0618a55df44 100644 --- a/pkgs/tools/typesetting/asciidoc/default.nix +++ b/pkgs/tools/typesetting/asciidoc/default.nix @@ -40,6 +40,8 @@ # java is problematic on some platforms, where it is unfree , enableJava ? true + +, buildPackages }: assert enableStandardFeatures -> @@ -157,7 +159,9 @@ stdenv.mkDerivation rec { sha256 = "1clf1axkns23wfmh48xfspzsnw04pjh4mq1pshpzvj0cwxhz0yaq"; }; + strictDeps = true; nativeBuildInputs = [ python3 unzip autoreconfHook ]; + buildInputs = [ python3 ]; # install filters early, so their shebangs are patched too postPatch = with lib; '' @@ -262,7 +266,20 @@ stdenv.mkDerivation rec { -e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \ -i a2x.py '') + '' - patchShebangs . + patchShebangs --host \ + asciidoc.py \ + a2x.py \ + tests/testasciidoc.py \ + filters/code/code-filter.py \ + filters/latex/latex2img.py \ + filters/music/music2png.py \ + filters/unwraplatex.py \ + filters/graphviz/graphviz2png.py + + # Hardcode the path to its own asciidoc. + # This helps with cross-compilation. + substituteInPlace a2x.py \ + --replace "find_executable(ASCIIDOC)" "'${placeholder "out"}/bin/asciidoc'" # Note: this substitution will not work in the planned 10.0.0 release: # @@ -273,11 +290,24 @@ stdenv.mkDerivation rec { # --replace "python3 -m asciidoc.a2x" "python3 -m asciidoc.a2x -a revdate=01/01/1980" substituteInPlace Makefile.in \ --replace "python3 a2x.py" "python3 a2x.py -a revdate=01/01/1980" + + # Fix tests + for f in $(grep -R --files-with-matches "2002-11-25") ; do + substituteInPlace $f --replace "2002-11-25" "1970-01-01" + substituteInPlace $f --replace "00:37:42" "00:00:01" + done + '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + # We want to use asciidoc from the build platform to build the documentation. + substituteInPlace Makefile.in \ + --replace "python3 a2x.py" "python3 ${buildPackages.asciidoc}/bin/a2x.py" ''; preInstall = "mkdir -p $out/etc/vim"; makeFlags = lib.optional stdenv.isCygwin "DESTDIR=/."; + checkInputs = [ sourceHighlight ]; + doCheck = true; + meta = with lib; { description = "Text-based document generation system"; longDescription = '' |