From 8e40747e62943327c390fb8f7e4a3988d9e6e1cd Mon Sep 17 00:00:00 2001 From: apfelkuchen06 Date: Wed, 22 Mar 2023 05:06:21 +0100 Subject: [PATCH] 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. --- pkgs/development/perl-modules/Po4a/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/development/perl-modules/Po4a/default.nix b/pkgs/development/perl-modules/Po4a/default.nix index 99c100455a8a..f08b5b2361a3 100644 --- a/pkgs/development/perl-modules/Po4a/default.nix +++ b/pkgs/development/perl-modules/Po4a/default.nix @@ -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 ];