Add patch for GPA locale detection
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 13 Apr 2017 08:01:37 +0000 (10:01 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Thu, 13 Apr 2017 08:04:22 +0000 (10:04 +0200)
--
Without this patch GPA does not find it's locale now
that it is installed under bin.

Makefile.am
patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.patch [new file with mode: 0755]

index a04d295..59f71a6 100644 (file)
@@ -55,7 +55,8 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch \
         patches/libkleo/lower-kf5-required.patch \
         patches/gpgex-1.0.4/0002-Fix-loop-logic-error-in-new-server-name-detection.patch \
         patches/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch \
         patches/libkleo/lower-kf5-required.patch \
         patches/gpgex-1.0.4/0002-Fix-loop-logic-error-in-new-server-name-detection.patch \
-        patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch
+        patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \
+        patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.patch
 
 copy-news:
        cp NEWS doc/website/NEWS.last
 
 copy-news:
        cp NEWS doc/website/NEWS.last
diff --git a/patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.patch b/patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.patch
new file mode 100755 (executable)
index 0000000..5229d56
--- /dev/null
@@ -0,0 +1,42 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 2dae64a65080c52a731d98a905a447de1428cc7c Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Thu, 13 Apr 2017 09:44:47 +0200
+Subject: [PATCH] w32: Make location of locale dir more flexible
+
+* src/gpa.c (get_locale_dir): If installed under a bin subdirectory
+strip this out of the locale path.
+
+--
+This fixes loading locales when GPA is installed under a bin
+subdirectory like it is with GnuPG 2.1 and Gpg4win.
+---
+ src/gpa.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/src/gpa.c b/src/gpa.c
+index be8490d..bad001f 100644
+--- a/src/gpa.c
++++ b/src/gpa.c
+@@ -160,7 +160,15 @@ get_locale_dir (void)
+
+   if (! GetModuleFileNameA (0, name, sizeof (name) - 30))
+     return NULL;
+-  p = strrchr (name, '\\');
++
++  /* If installed under bin assume that share is on the same
++     hierarchy as the bin subdirectory. Otherwise assume that
++     share is a subdirectory of the gpa.exe location. */
++  p = strstr (name, "\\bin\\");
++  if (!p)
++    {
++      p = strrchr (name, '\\');
++    }
+   if (!p)
+     {
+       *name = '\\';
+--
+2.1.4