From 2fca5d7bea1191996e2ca6ca99c078caf2e2a45f Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Wed, 20 Nov 2024 16:12:59 -0600 Subject: [PATCH] po4a: make msgmerge command available --- .../development/perl-modules/Po4a/default.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/development/perl-modules/Po4a/default.nix b/pkgs/development/perl-modules/Po4a/default.nix index 1fae36dfcb777a..cdbe7e5b35e6c0 100644 --- a/pkgs/development/perl-modules/Po4a/default.nix +++ b/pkgs/development/perl-modules/Po4a/default.nix @@ -14,6 +14,7 @@ fetchpatch, perl, buildPerlPackage, + makeWrapper, ModuleBuild, TextWrapI18N, LocaleGettext, @@ -49,6 +50,7 @@ buildPerlPackage rec { libxslt docbook_xsl docbook_xsl_ns + makeWrapper ModuleBuild docbook_xml_dtd_45 docbook_sgml_dtd_41 @@ -89,8 +91,10 @@ buildPerlPackage rec { ''; buildPhase = '' + runHook preBuild perl Build.PL --install_base=$out --install_path="lib=$out/${perl.libPrefix}" ./Build build + runHook postBuild ''; # Disabling tests on musl @@ -103,21 +107,30 @@ buildPerlPackage rec { doCheck = (!stdenv.hostPlatform.isMusl) && (!stdenv.hostPlatform.isDarwin); checkPhase = '' + runHook preCheck export SGML_CATALOG_FILES=${docbook_sgml_dtd_41}/sgml/dtd/docbook-4.1/docbook.cat ./Build test + runHook postCheck ''; installPhase = '' + runHook preInstall ./Build install - for f in $out/bin/*; do - substituteInPlace $f --replace "#! /usr/bin/env perl" "#!${perl}/bin/perl" - substituteInPlace $f --replace "exec perl" "exec ${perl}/bin/perl" + for f in $out/bin/{msguntypot,po4a,po4a-gettextize,po4a-normalize,po4a-translate,po4a-updatepo}; do + substituteInPlace $f --replace-fail "exec perl" "exec ${lib.getExe perl}" done + runHook postInstall + ''; + + postFixup = '' + wrapProgram $out/bin/po4a \ + --prefix PATH : ${lib.makeBinPath [ gettext ]} ''; meta = { description = "Tools for helping translation of documentation"; homepage = "https://po4a.org"; license = with lib.licenses; [ gpl2Plus ]; + mainProgram = "po4a"; }; }