lol

Merge pull request #13154 from zimbatm/git-rebase-fix-v2

git: fixes references to gettext properly

+80 -1
+2 -1
pkgs/applications/version-management/git-and-tools/git/default.nix
··· 24 24 patches = [ 25 25 ./docbook2texi.patch 26 26 ./symlinks-in-bin.patch 27 + ./git-sh-i18n.patch 27 28 ]; 28 29 29 30 buildInputs = [curl openssl zlib expat gettext cpio makeWrapper libiconv] ··· 85 86 86 87 # Fix references to gettext. 87 88 substituteInPlace $out/libexec/git-core/git-sh-i18n \ 88 - --replace 'gettext.sh' '${gettext}/bin/gettext.sh' 89 + --subst-var-by gettext ${gettext} 89 90 90 91 # gzip (and optionally bzip2, xz, zip) are runtime dependencies for 91 92 # gitweb.cgi, need to patch so that it's found
+78
pkgs/applications/version-management/git-and-tools/git/git-sh-i18n.patch
··· 1 + diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh 2 + index e6c3116..4e34a2c 100644 3 + --- a/git-sh-i18n.sh 4 + +++ b/git-sh-i18n.sh 5 + @@ -15,69 +15,11 @@ else 6 + fi 7 + export TEXTDOMAINDIR 8 + 9 + -# First decide what scheme to use... 10 + -GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough 11 + -if test -n "@@USE_GETTEXT_SCHEME@@" 12 + -then 13 + - GIT_INTERNAL_GETTEXT_SH_SCHEME="@@USE_GETTEXT_SCHEME@@" 14 + -elif test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" 15 + -then 16 + - : no probing necessary 17 + -elif test -n "$GIT_GETTEXT_POISON" 18 + -then 19 + - GIT_INTERNAL_GETTEXT_SH_SCHEME=poison 20 + -elif type gettext.sh >/dev/null 2>&1 21 + -then 22 + - # GNU libintl's gettext.sh 23 + - GIT_INTERNAL_GETTEXT_SH_SCHEME=gnu 24 + -elif test "$(gettext -h 2>&1)" = "-h" 25 + -then 26 + - # gettext binary exists but no gettext.sh. likely to be a gettext 27 + - # binary on a Solaris or something that is not GNU libintl and 28 + - # lack eval_gettext. 29 + - GIT_INTERNAL_GETTEXT_SH_SCHEME=gettext_without_eval_gettext 30 + -fi 31 + -export GIT_INTERNAL_GETTEXT_SH_SCHEME 32 + - 33 + -# ... and then follow that decision. 34 + -case "$GIT_INTERNAL_GETTEXT_SH_SCHEME" in 35 + -gnu) 36 + - # Use libintl's gettext.sh, or fall back to English if we can't. 37 + - . gettext.sh 38 + - ;; 39 + -gettext_without_eval_gettext) 40 + - # Solaris has a gettext(1) but no eval_gettext(1) 41 + - eval_gettext () { 42 + - gettext "$1" | ( 43 + - export PATH $(git sh-i18n--envsubst --variables "$1"); 44 + - git sh-i18n--envsubst "$1" 45 + - ) 46 + - } 47 + - ;; 48 + -poison) 49 + - # Emit garbage so that tests that incorrectly rely on translatable 50 + - # strings will fail. 51 + - gettext () { 52 + - printf "%s" "# GETTEXT POISON #" 53 + - } 54 + - 55 + - eval_gettext () { 56 + - printf "%s" "# GETTEXT POISON #" 57 + - } 58 + - ;; 59 + -*) 60 + - gettext () { 61 + - printf "%s" "$1" 62 + - } 63 + +# GNU gettext 64 + +export GIT_INTERNAL_GETTEXT_SH_SCHEME=gnu 65 + +export PATH=@gettext@/bin:$PATH 66 + 67 + - eval_gettext () { 68 + - printf "%s" "$1" | ( 69 + - export PATH $(git sh-i18n--envsubst --variables "$1"); 70 + - git sh-i18n--envsubst "$1" 71 + - ) 72 + - } 73 + - ;; 74 + -esac 75 + +. @gettext@/bin/gettext.sh 76 + 77 + # Git-specific wrapper functions 78 + gettextln () {