perl536Packages.Po4a: remove texlive dependency

The motivation behind this is wanting to reduce the reverse closure size of
texlive.

When internationalizing tex files, Po4a attempts to follow included files. In
order to find the correct files, po4a uses texlive's file-finding utility
kpsewhich. This commit replaces texlive with a tiny shell script, which is
precisely good enough to run the tests.

This does not change the resulting package in any way, it only affects how the
test is run.
This commit is contained in:
apfelkuchen06 2023-03-22 05:06:21 +01:00 committed by Dmitry Kalinkin
parent 333618087c
commit 8e40747e62

View File

@ -1,6 +1,6 @@
{ stdenv, lib, fetchurl, docbook_xsl, docbook_xsl_ns, gettext, libxslt, glibcLocales, docbook_xml_dtd_412, docbook_sgml_dtd_41, texlive, opensp, bash
{ stdenv, lib, fetchurl, docbook_xsl, docbook_xsl_ns, gettext, libxslt, glibcLocales, docbook_xml_dtd_412, docbook_sgml_dtd_41, opensp, bash
, perl, buildPerlPackage, ModuleBuild, TextWrapI18N, LocaleGettext, TermReadKey, SGMLSpm, UnicodeLineBreak, PodParser, YAMLTiny
, fetchpatch
, fetchpatch, writeShellScriptBin
}:
buildPerlPackage rec {
@ -20,7 +20,15 @@ buildPerlPackage rec {
];
strictDeps = true;
nativeBuildInputs = [ gettext libxslt docbook_xsl docbook_xsl_ns ModuleBuild docbook_xml_dtd_412 docbook_sgml_dtd_41 opensp texlive.combined.scheme-basic glibcLocales ];
nativeBuildInputs =
# the tests for the tex-format use kpsewhich -- texlive's file finding utility.
# We don't want to depend on texlive here, so we replace it with a minimal
# shellscript that suffices for the tests in t/fmt/tex/, i.e. it looks up
# article.cls to an existing file, but doesn't find article-wrong.cls.
let kpsewhich-stub = writeShellScriptBin "kpsewhich"
''[[ $1 = "article.cls" ]] && echo /dev/null'';
in
[ gettext libxslt docbook_xsl docbook_xsl_ns ModuleBuild docbook_xml_dtd_412 docbook_sgml_dtd_41 opensp kpsewhich-stub glibcLocales ];
propagatedBuildInputs = lib.optional (!stdenv.hostPlatform.isMusl) TextWrapI18N ++ [ LocaleGettext SGMLSpm UnicodeLineBreak PodParser YAMLTiny ];
# TODO: TermReadKey was temporarily removed from propagatedBuildInputs to unfreeze the build
buildInputs = [ bash ];