diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-02-17 18:16:20 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-02-17 18:16:20 +0100 |
commit | 74bda15a94490feef13dd7313f64255acc3d6af3 (patch) | |
tree | 435bc843daaeed02359976e77ac19f7897170488 /pkgs/development/libraries/gettext | |
parent | 57b3ad896222abe307c5e20f4dfd7245db6bdb4d (diff) |
gettext.sh: fixup calls to absolute paths
For discussion see https://github.com/NixOS/nixpkgs/pull/13072
Diffstat (limited to 'pkgs/development/libraries/gettext')
-rw-r--r-- | pkgs/development/libraries/gettext/absolute-paths.diff | 21 | ||||
-rw-r--r-- | pkgs/development/libraries/gettext/default.nix | 4 |
2 files changed, 24 insertions, 1 deletions
diff --git a/pkgs/development/libraries/gettext/absolute-paths.diff b/pkgs/development/libraries/gettext/absolute-paths.diff new file mode 100644 index 0000000000000..6d5cf1c1ba24d --- /dev/null +++ b/pkgs/development/libraries/gettext/absolute-paths.diff @@ -0,0 +1,21 @@ +diff --git a/gettext-runtime/src/gettext.sh.in b/gettext-runtime/src/gettext.sh.in +index 1dfa3bb..d6ef8a8 100644 +--- a/gettext-runtime/src/gettext.sh.in ++++ b/gettext-runtime/src/gettext.sh.in +@@ -86,14 +86,14 @@ fi + # looks up the translation of MSGID and substitutes shell variables in the + # result. + eval_gettext () { +- gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1") ++ @out@/bin/gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1") + } + + # eval_ngettext MSGID MSGID-PLURAL COUNT + # looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes + # shell variables in the result. + eval_ngettext () { +- ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2") ++ @out@/bin/ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2") + } + + # Note: This use of envsubst is much safer than using the shell built-in 'eval' diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 3d7cfc0ca3101..1443626124e1b 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation (rec { url = "mirror://gnu/gettext/${name}.tar.gz"; sha256 = "0pb9vp4ifymvdmc31ks3xxcnfqgzj8shll39czmk8c1splclqjzd"; }; + patches = [ ./absolute-paths.diff ]; outputs = [ "out" "doc" ]; @@ -28,7 +29,8 @@ stdenv.mkDerivation (rec { "gt_cv_func_CFLocaleCopyCurrent=no" ]); - patchPhase = '' + postPatch = '' + substituteAllInPlace gettext-runtime/src/gettext.sh.in substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd |