Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Guillaume_G:WSL
mingw64-dia
dia-0.97.1-relocations.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File dia-0.97.1-relocations.patch of Package mingw64-dia
--- dia-0.97.1/app/app_procs.c 2010-01-24 17:56:08.000000000 +0100 +++ dia-0.97.1/app/app_procs.c 2010-09-02 17:54:26.000000000 +0200 @@ -653,7 +653,7 @@ #ifdef G_OS_WIN32 /* calculate runtime directory */ { - gchar* localedir = dia_get_lib_directory ("locale"); + gchar* localedir = dia_get_locale_directory (); bindtextdomain(GETTEXT_PACKAGE, localedir); g_free (localedir); --- dia-0.97.1/lib/dia_dirs.c 2009-11-07 18:13:53.000000000 +0100 +++ dia-0.97.1/lib/dia_dirs.c 2010-09-02 18:18:19.000000000 +0200 @@ -32,6 +32,22 @@ #endif #include <glib/gstdio.h> +#if defined(G_OS_WIN32) && defined(PREFIX) +static gchar * +replace_prefix (const gchar *runtime_prefix, + const gchar *configure_time_path) +{ + if (runtime_prefix && + strncmp (configure_time_path, PREFIX "/", + strlen (PREFIX) + 1) == 0) { + return g_strconcat (runtime_prefix, + configure_time_path + strlen (PREFIX) + 1, + NULL); + } else + return g_strdup (configure_time_path); +} +#endif + /** Get the name of a subdirectory of our data directory. * This function does not create the subdirectory, just make the correct name. * @param subdir The name of the directory desired. @@ -42,6 +58,8 @@ dia_get_data_directory(const gchar* subdir) { #ifdef G_OS_WIN32 + gchar *tmpPath = NULL; + gchar *returnPath = NULL; /* * Calculate from executable path */ @@ -57,7 +75,17 @@ if (strrchr(sLoc, G_DIR_SEPARATOR)) strrchr(sLoc, G_DIR_SEPARATOR)[1] = 0; } +#if defined(PREFIX) && defined(DATADIR) + tmpPath = replace_prefix(sLoc, DATADIR); + if (strlen (subdir) == 0) + returnPath = g_strdup(tmpPath); + else + returnPath = g_build_path(G_DIR_SEPARATOR_S, tmpPath, subdir, NULL); + g_free(tmpPath); + return returnPath; +#else return g_strconcat (sLoc , subdir, NULL); +#endif #else if (strlen (subdir) == 0) @@ -77,6 +105,8 @@ dia_get_lib_directory(const gchar* subdir) { #ifdef G_OS_WIN32 + gchar *tmpPath = NULL; + gchar *returnPath = NULL; /* * Calulate from executable path */ @@ -92,7 +122,46 @@ if (strrchr(sLoc, G_DIR_SEPARATOR)) strrchr(sLoc, G_DIR_SEPARATOR)[1] = 0; } +#if defined(PREFIX) && defined(LIBDIR) + tmpPath = replace_prefix(sLoc, LIBDIR); + returnPath = g_build_path(G_DIR_SEPARATOR_S, tmpPath, subdir, NULL); + g_free(tmpPath); + return returnPath; +#else return g_strconcat (sLoc , subdir, NULL); +#endif + + +#else + return g_strconcat (LIBDIR, G_DIR_SEPARATOR_S, subdir, NULL); +#endif +} + +gchar* +dia_get_locale_directory(void) +{ +#ifdef G_OS_WIN32 +#if defined(PREFIX) && defined(LOCALEDIR) + /* + * Calulate from executable path + */ + gchar sLoc [MAX_PATH+1]; + HINSTANCE hInst = GetModuleHandle(NULL); + + if (0 != GetModuleFileName(hInst, sLoc, MAX_PATH)) + { + /* strip the name */ + if (strrchr(sLoc, G_DIR_SEPARATOR)) + strrchr(sLoc, G_DIR_SEPARATOR)[0] = 0; + /* and one dir (bin) */ + if (strrchr(sLoc, G_DIR_SEPARATOR)) + strrchr(sLoc, G_DIR_SEPARATOR)[1] = 0; + } + return replace_prefix(sLoc, LOCALEDIR); +#else + return dia_get_lib_directory ("locale"); +#endif + #else return g_strconcat (LIBDIR, G_DIR_SEPARATOR_S, subdir, NULL); --- dia-0.97.1/lib/dia_dirs.h 2009-11-07 15:28:34.000000000 +0100 +++ dia-0.97.1/lib/dia_dirs.h 2010-09-02 17:26:27.000000000 +0200 @@ -29,6 +29,7 @@ gchar *dia_get_data_directory (const gchar* subdir); gchar *dia_get_lib_directory (const gchar* subdir); +gchar *dia_get_locale_directory (void); gchar *dia_config_filename (const gchar* file); gboolean dia_config_ensure_dir (const gchar* filename); gchar *dia_get_absolute_filename (const gchar *filename); --- dia-0.97.1/lib/libdia.def 2009-11-07 18:13:53.000000000 +0100 +++ dia-0.97.1/lib/libdia.def 2010-09-02 18:09:28.000000000 +0200 @@ -245,6 +245,7 @@ dia_get_data_directory dia_get_lib_directory + dia_get_locale_directory dia_get_absolute_filename dia_get_canonical_path --- dia-0.97.1/lib/Makefile.am 2010-09-02 17:14:14.000000000 +0200 +++ dia-0.97.1/lib/Makefile.am 2010-09-02 17:16:00.000000000 +0200 @@ -192,7 +192,9 @@ $(LIBART_CFLAGS) \ -DLIBDIA_COMPILATION \ -DLIBDIR=\"$(libdir)\" \ - -DDATADIR=\"$(pkgdatadir)\" + -DDATADIR=\"$(pkgdatadir)\" \ + -DLOCALEDIR=\"$(localedir)\" \ + -DPREFIX=\"$(prefix)\" sheetdir = $(pkgdatadir)/sheets
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor