27 buildPerlPackage rec {
32 url = "https://github.com/mquinson/po4a/releases/download/v${version}/po4a-${version}.tar.gz";
33 hash = "sha256-bxj4LYyyo3c5QTfqOWzD6BldbNbkVP4CGKoPDjYDjqA=";
39 # the tests for the tex-format use kpsewhich -- texlive's file finding utility.
40 # We don't want to depend on texlive here, so we replace it with a minimal
41 # shellscript that suffices for the tests in t/fmt/tex/, i.e. it looks up
42 # article.cls to an existing file, but doesn't find article-wrong.cls.
44 kpsewhich-stub = writeShellScriptBin "kpsewhich"
45 ''[[ $1 = "article.cls" ]] && echo /dev/null'';
60 # Needs a patch for 5.40 until the next release
62 url = "https://github.com/mquinson/po4a/commit/28fe52651eb8096d97d6bd3a97b3168522ba5306.patch";
63 hash = "sha256-QUXxkSzcnwRvU+2y2KoBXmtfE8qTZ2BV0StkJHqZehQ=";
67 # TODO: TermReadKey was temporarily removed from propagatedBuildInputs to unfreeze the build
68 propagatedBuildInputs = lib.optionals (!stdenv.hostPlatform.isMusl) [
79 buildInputs = [ bash ];
81 LC_ALL = "en_US.UTF-8";
82 SGML_CATALOG_FILES = "${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml";
86 export PERL_MB_OPT="--install_base=$out --prefix=$out"
90 perl Build.PL --install_base=$out --install_path="lib=$out/${perl.libPrefix}"
94 # Disabling tests on musl
95 # Void linux package have investigated the failure and tracked it down to differences in gettext behavior. They decided to disable tests.
96 # https://github.com/void-linux/void-packages/pull/34029#issuecomment-973267880
97 # Alpine packagers have not worried about running the tests until now:
98 # https://git.alpinelinux.org/aports/tree/main/po4a/APKBUILD#n11
100 # Disabling tests on Darwin until https://github.com/NixOS/nixpkgs/issues/236560 is resolved.
101 doCheck = (!stdenv.hostPlatform.isMusl) && (!stdenv.hostPlatform.isDarwin);
104 export SGML_CATALOG_FILES=${docbook_sgml_dtd_41}/sgml/dtd/docbook-4.1/docbook.cat
110 for f in $out/bin/*; do
111 substituteInPlace $f --replace "#! /usr/bin/env perl" "#!${perl}/bin/perl"
112 substituteInPlace $f --replace "exec perl" "exec ${perl}/bin/perl"
117 description = "Tools for helping translation of documentation";
118 homepage = "https://po4a.org";
119 license = with lib.licenses; [ gpl2Plus ];