1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch,
6 gettext,
7 perlPackages,
8 buildPackages,
9}:
10
11stdenv.mkDerivation rec {
12 pname = "intltool";
13 version = "0.51.0";
14
15 src = fetchurl {
16 url = "https://launchpad.net/intltool/trunk/${version}/+download/${pname}-${version}.tar.gz";
17 sha256 = "1karx4sb7bnm2j67q0q74hspkfn6lqprpy5r99vkn5bb36a4viv7";
18 };
19
20 # fix "unescaped left brace" errors when using intltool in some cases
21 patches = [
22 (fetchpatch {
23 name = "perl5.26-regex-fixes.patch";
24 urls = [
25 "https://sources.debian.org/data/main/i/intltool/0.51.0-5/debian/patches/perl5.26-regex-fixes.patch"
26 "https://src.fedoraproject.org/rpms/intltool/raw/d8d2ef29fb122a42a6b6678eb1ec97ae56902af2/f/intltool-perl5.26-regex-fixes.patch"
27 ];
28 sha256 = "12q2140867r5d0dysly72khi7b0mm2gd7nlm1k81iyg7fxgnyz45";
29 })
30 ];
31
32 nativeBuildInputs = with perlPackages; [
33 perl
34 XMLParser
35 ];
36 propagatedBuildInputs = [
37 gettext
38 ]
39 ++ (with perlPackages; [
40 perl
41 XMLParser
42 ]);
43
44 postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
45 for f in $out/bin/*; do
46 substituteInPlace $f --replace "${buildPackages.perl}" "${perlPackages.perl}"
47 done
48 '';
49 meta = with lib; {
50 description = "Translation helper tool";
51 homepage = "https://launchpad.net/intltool/";
52 license = licenses.gpl2Plus;
53 maintainers = with maintainers; [ raskin ];
54 platforms = platforms.unix;
55 };
56}