lol

gettext.sh: fixup calls to absolute paths

For discussion see https://github.com/NixOS/nixpkgs/pull/13072

+24 -1
+21
pkgs/development/libraries/gettext/absolute-paths.diff
··· 1 + diff --git a/gettext-runtime/src/gettext.sh.in b/gettext-runtime/src/gettext.sh.in 2 + index 1dfa3bb..d6ef8a8 100644 3 + --- a/gettext-runtime/src/gettext.sh.in 4 + +++ b/gettext-runtime/src/gettext.sh.in 5 + @@ -86,14 +86,14 @@ fi 6 + # looks up the translation of MSGID and substitutes shell variables in the 7 + # result. 8 + eval_gettext () { 9 + - gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1") 10 + + @out@/bin/gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1") 11 + } 12 + 13 + # eval_ngettext MSGID MSGID-PLURAL COUNT 14 + # looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes 15 + # shell variables in the result. 16 + eval_ngettext () { 17 + - ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2") 18 + + @out@/bin/ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2") 19 + } 20 + 21 + # Note: This use of envsubst is much safer than using the shell built-in 'eval'
+3 -1
pkgs/development/libraries/gettext/default.nix
··· 7 7 url = "mirror://gnu/gettext/${name}.tar.gz"; 8 8 sha256 = "0pb9vp4ifymvdmc31ks3xxcnfqgzj8shll39czmk8c1splclqjzd"; 9 9 }; 10 + patches = [ ./absolute-paths.diff ]; 10 11 11 12 outputs = [ "out" "doc" ]; 12 13 ··· 28 29 "gt_cv_func_CFLocaleCopyCurrent=no" 29 30 ]); 30 31 31 - patchPhase = '' 32 + postPatch = '' 33 + substituteAllInPlace gettext-runtime/src/gettext.sh.in 32 34 substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd 33 35 substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd 34 36 substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd