File geoclue-0.12.0-win32reloc.patch of Package mingw64-geoclue

--- geoclue-0.12.0/src/master.c	2010-02-20 12:21:56.000000000 +0100
+++ geoclue-0.12.0/src/master.c	2010-04-16 15:31:52.000000000 +0200
@@ -40,6 +40,63 @@
 #endif
 #endif
 
+#ifdef _WIN32
+#  include <shlobj.h>
+#  include <mbstring.h>
+
+/* search for data relative to where we are installed */
+
+static HMODULE hmodule;
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+         DWORD     fdwReason,
+         LPVOID    lpvReserved)
+{
+    switch (fdwReason)
+    {
+       case DLL_PROCESS_ATTACH:
+           hmodule = hinstDLL;
+           break;
+    }
+
+    return TRUE;
+}
+
+static char *
+_get_geoclue_providers_dir (void)
+{
+    static char retval[1000];
+    static int beenhere = 0;
+
+    unsigned char *p;
+
+    if (beenhere)
+        return retval;
+
+    if (!GetModuleFileName (hmodule, (CHAR *) retval, sizeof(retval) - 10))
+        return GEOCLUE_PROVIDERS_DIR;
+
+    p = _mbsrchr ((const unsigned char *) retval, '\\');
+    *p = '\0';
+    p = _mbsrchr ((const unsigned char *) retval, '\\');
+    if (p) {
+        if (stricmp ((const char *) (p+1), "bin") == 0)
+            *p = '\0';
+    }
+    strcat (retval, "\\share\\geoclue-providers");
+
+    beenhere = 1;
+
+    return retval;
+}
+
+#undef GEOCLUE_PROVIDERS_DIR
+#define GEOCLUE_PROVIDERS_DIR _get_geoclue_providers_dir ()
+
+#endif
+
+
 enum {
 	OPTIONS_CHANGED,
 	LAST_SIGNAL
openSUSE Build Service is sponsored by