Mercurial > gub
view patches/denemo-relocate-mingw.patch @ 6512:ccc20ae889ca default tip guix
mingw::guile-2.0.7 builds.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Thu, 24 Mar 2016 08:03:39 +0100 |
parents | d5baf108616e |
children |
line wrap: on
line source
--- denemo-0.8.6/src/main.c.orig 2009-07-06 16:51:25.613300954 +0200 +++ denemo-0.8.6/src/main.c 2009-07-07 22:02:37.848799483 +0200 @@ -410,10 +410,6 @@ int main (int argc, char *argv[]) { - GError *error = NULL; - /* gtk initialization */ - gtk_init (&argc, &argv); - //#ifdef G_OS_WIN32 // /* workaround necessary for compilation on Cygwin */ // g_set_print_handler ((GPrintFunc)printf); @@ -427,12 +423,47 @@ main (int argc, char *argv[]) /* initialization of directory relocatability */ initdir(); #ifdef G_OS_WIN32 - gchar *scmcode = g_build_filename(get_data_dir(), "share", "guile", NULL); - if(g_file_test(scmcode, G_FILE_TEST_EXISTS)) { - g_setenv("GUILE_LOAD_PATH", scmcode, TRUE); - g_print("Set environment variable GUILE_LOAD_PATH to %s\n", scmcode); - } else warningdialog("You may need to set GUILE_LOAD_PATH to the directory where you have ice9 installed\n"); + gchar *prefix = g_win32_get_package_installation_directory (NULL, NULL); + gchar *guile = g_build_filename (prefix, "share", "guile", NULL); + gchar *guile_1_8 = g_build_filename (guile, "1.8", NULL); + if (g_file_test (guile, G_FILE_TEST_EXISTS)) + { + gchar *guile_path = g_strconcat (guile, ";", guile_1_8, NULL); + g_setenv ("GUILE_LOAD_PATH", guile_path, TRUE); + g_print ("Setting GUILE_LOAD_PATH=%s\n", guile_path); + } + else + warningdialog ("You may need to set GUILE_LOAD_PATH to the directory where you have ice9 installed\n"); + g_setenv ("PANGO_PREFIX", prefix, TRUE); + g_setenv ("PANGO_MODULE_VERSION", "1.6.0", TRUE); + g_setenv ("PANGO_SO_EXTENSION", ".dll", TRUE); + g_print ("Setting PANGO_PREFIX=%s\n", prefix); + + g_setenv ("GTK_MODULE_VERSION", "2.10.0", TRUE); + g_setenv ("GTK_SO_EXTENSION", ".dll", TRUE); + g_setenv ("GTK_PREFIX", prefix, TRUE); + g_print ("Setting GTK_PREFIX=%s\n", prefix); + + gchar *fc_path = g_strconcat (prefix, "/etc/fonts", NULL); + g_setenv ("FONTCONFIG_PATH", fc_path, TRUE); + g_print ("Setting FONTCONFIG_PATH=%s\n", fc_path); + gchar *fc_file = g_strconcat (fc_path, "/fonts.conf", NULL); + g_setenv ("FONTCONFIG_FILE", fc_file, TRUE); + g_print ("Setting FONTCONFIG_FILE=%s\n", fc_file); + + /* Ugh, how to get/expand %ProgramFiles% ? + Let's hope user installs below Program Files... */ + gchar *program_files = g_build_filename (prefix, "..", "..", NULL); + gchar *path = g_getenv ("PATH"); + path = g_strconcat (path, ";", program_files, "/Windows Media Player", NULL); + path = g_strconcat (path, ";", program_files, "/Adobe/Reader 8.0/Reader", NULL); + g_setenv ("PATH", path, TRUE); + #endif + GError *error = NULL; + /* gtk initialization */ + gtk_init (&argc, &argv); + /* locale initialization */ //setlocale (LC_CTYPE, ""); //setlocale (LC_MESSAGES, ""); --- denemo-0.8.6/src/utils.c~ 2009-07-07 14:44:35.176798844 +0200 +++ denemo-0.8.6/src/utils.c 2009-07-07 16:47:50.428799860 +0200 @@ -627,6 +627,8 @@ get_data_dir () #ifdef G_OS_WIN32 gchar *rootdir = g_win32_get_package_installation_directory (NULL, NULL); datadir = g_build_filename (rootdir, "share", "denemo", NULL); + g_print ("rootdir=%s\n", rootdir); + g_print ("datadir=%s\n", datadir); g_free (rootdir); #else /* not G_OS_WIN32 */ datadir = gbr_find_pkg_data_dir (PKGDATADIR, PKGNAME); @@ -678,7 +678,7 @@ get_locale_dir () { #ifdef G_OS_WIN32 gchar *rootdir = g_win32_get_package_installation_directory (NULL, NULL); - localedir = g_build_filename (rootdir, "share", "locale", "denemo", NULL); + localedir = g_build_filename (rootdir, "share", "locale", NULL); g_free (rootdir); #else /* not G_OS_WIN32 */ # ifndef ENABLE_BINRELOC