Skip to content

Commit

Permalink
po4a: make msgmerge command available
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillikers committed Nov 23, 2024
1 parent cee87c1 commit 8c7c768
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pkgs/development/perl-modules/Po4a/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
fetchpatch,
perl,
buildPerlPackage,
makeWrapper,
ModuleBuild,
TextWrapI18N,
LocaleGettext,
Expand Down Expand Up @@ -49,6 +50,7 @@ buildPerlPackage rec {
libxslt
docbook_xsl
docbook_xsl_ns
makeWrapper
ModuleBuild
docbook_xml_dtd_45
docbook_sgml_dtd_41
Expand Down Expand Up @@ -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
Expand All @@ -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";
};
}

0 comments on commit 8c7c768

Please sign in to comment.