From b61abed9554ab813ed358ea5bad648987573772e Mon Sep 17 00:00:00 2001 From: yselkowitz Date: Tue, 15 Jun 2010 10:25:16 +0000 Subject: [PATCH] gnome/glib2.0 2.24.1 git-svn-id: https://cygwin-ports.svn.sourceforge.net/svnroot/cygwin-ports/ports/trunk@9706 e127d73d-b18e-4ae1-a744-a22e6a3ccd30 --- 2.16-gmodule.patch | 358 ------------------ 2.22.4-not-win32.patch | 260 ------------- 2.24.1-gmodule.patch | 131 +++++++ 2.24.1-not-win32.patch | 342 +++++++++++++++++ README | 24 +- ...22.4-2.cygport => glib2.0-2.24.1-1.cygport | 4 +- 6 files changed, 488 insertions(+), 631 deletions(-) delete mode 100644 2.16-gmodule.patch delete mode 100644 2.22.4-not-win32.patch create mode 100644 2.24.1-gmodule.patch create mode 100644 2.24.1-not-win32.patch rename glib2.0-2.22.4-2.cygport => glib2.0-2.24.1-1.cygport (92%) diff --git a/2.16-gmodule.patch b/2.16-gmodule.patch deleted file mode 100644 index bd2b633..0000000 --- a/2.16-gmodule.patch +++ /dev/null @@ -1,358 +0,0 @@ ---- origsrc/glib-2.16.5/configure.in 2008-07-19 21:34:02.000000000 -0500 -+++ src/glib-2.16.5/configure.in 2008-07-22 18:05:16.265625000 -0500 -@@ -1296,7 +1296,15 @@ - dnl *** force native WIN32 shared lib loader - if test -z "$G_MODULE_IMPL"; then - case "$host" in -- *-*-mingw*|*-*-cygwin*) G_MODULE_IMPL=G_MODULE_IMPL_WIN32 ;; -+ *-*-mingw*) G_MODULE_IMPL=G_MODULE_IMPL_WIN32 -+ ;; -+ esac -+fi -+dnl *** force Cygwin hybrid dl/win32 shared lib loader -+if test -z "$G_MODULE_IMPL"; then -+ case "$host" in -+ *-*-cygwin*) G_MODULE_IMPL=G_MODULE_IMPL_CYGWIN -+ ;; - esac - fi - dnl *** force native AIX library loader -@@ -2514,9 +2522,6 @@ - dnl ********************** - - case $host in -- *-*-cygwin*) -- G_LIBS_EXTRA="-luser32 -lkernel32" -- ;; - *-*-mingw*) - G_LIBS_EXTRA="-lws2_32 -lole32" - ;; ---- origsrc/glib-2.16.5/gmodule/Makefile.am 2008-07-01 17:30:05.000000000 -0500 -+++ src/glib-2.16.5/gmodule/Makefile.am 2008-07-22 18:05:16.281250000 -0500 -@@ -17,6 +17,7 @@ - gmodule-dld.c \ - gmodule-dyld.c \ - gmodule-os2.c \ -+ gmodule-cygwin.c \ - gmodule-win32.c \ - gmodule-beos.c \ - gmodule-ar.c \ ---- origsrc/glib-2.16.5/gmodule/gmodule-cygwin.c 1969-12-31 18:00:00.000000000 -0600 -+++ src/glib-2.16.5/gmodule/gmodule-cygwin.c 2008-07-22 18:05:16.281250000 -0500 -@@ -0,0 +1,250 @@ -+/* GMODULE - GLIB wrapper code for dynamic module loading -+ * Copyright (C) 1998, 2000 Tim Janik -+ * -+ * Win32 GMODULE implementation -+ * Copyright (C) 1998 Tor Lillqvist -+ * -+ * Cygwin GMODULE implementation -+ * Copyright (C) 2007 Yaakov Selkowitz -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the -+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -+ * Boston, MA 02111-1307, USA. -+ */ -+ -+/* -+ * Modified by the GLib Team and others 1997-2007. See the AUTHORS -+ * file for a list of people on the GLib Team. See the ChangeLog -+ * files for a list of changes. These files are distributed with -+ * GLib at ftp://ftp.gtk.org/pub/gtk/. -+ */ -+ -+/* -+ * MT safe -+ */ -+#include "config.h" -+ -+#include -+#include -+#include -+#include -+ -+/* --- win32 functions --- */ -+static gpointer -+find_in_any_module_using_toolhelp (const gchar *symbol_name) -+{ -+ typedef HANDLE (WINAPI *PFNCREATETOOLHELP32SNAPSHOT)(DWORD, DWORD); -+ static PFNCREATETOOLHELP32SNAPSHOT pfnCreateToolhelp32Snapshot = NULL; -+ -+ typedef BOOL (WINAPI *PFNMODULE32FIRST)(HANDLE, MODULEENTRY32*); -+ static PFNMODULE32FIRST pfnModule32First= NULL; -+ -+ typedef BOOL (WINAPI *PFNMODULE32NEXT)(HANDLE, MODULEENTRY32*); -+ static PFNMODULE32NEXT pfnModule32Next = NULL; -+ -+ static HMODULE kernel32; -+ -+ HANDLE snapshot; -+ MODULEENTRY32 me32; -+ -+ gpointer p; -+ -+ if (!pfnCreateToolhelp32Snapshot || !pfnModule32First || !pfnModule32Next) -+ { -+ if (!kernel32) -+ if (!(kernel32 = GetModuleHandle ("kernel32.dll"))) -+ return NULL; -+ -+ if (!(pfnCreateToolhelp32Snapshot = (PFNCREATETOOLHELP32SNAPSHOT) GetProcAddress (kernel32, "CreateToolhelp32Snapshot")) -+ || !(pfnModule32First = (PFNMODULE32FIRST) GetProcAddress (kernel32, "Module32First")) -+ || !(pfnModule32Next = (PFNMODULE32NEXT) GetProcAddress (kernel32, "Module32Next"))) -+ return NULL; -+ } -+ -+ if ((snapshot = (*pfnCreateToolhelp32Snapshot) (TH32CS_SNAPMODULE, 0)) == (HANDLE) -1) -+ return NULL; -+ -+ me32.dwSize = sizeof (me32); -+ p = NULL; -+ if ((*pfnModule32First) (snapshot, &me32)) -+ { -+ do { -+ if ((p = GetProcAddress (me32.hModule, symbol_name)) != NULL) -+ break; -+ } while ((*pfnModule32Next) (snapshot, &me32)); -+ } -+ -+ CloseHandle (snapshot); -+ -+ return p; -+} -+ -+static gpointer -+find_in_any_module_using_psapi (const gchar *symbol_name) -+{ -+ static HMODULE psapi = NULL; -+ -+ typedef BOOL (WINAPI *PFNENUMPROCESSMODULES) (HANDLE, HMODULE *, DWORD, LPDWORD) ; -+ static PFNENUMPROCESSMODULES pfnEnumProcessModules = NULL; -+ -+ HMODULE *modules; -+ HMODULE dummy; -+ gint i, size; -+ DWORD needed; -+ -+ gpointer p; -+ -+ if (!pfnEnumProcessModules) -+ { -+ if (!psapi) -+ if ((psapi = LoadLibrary ("psapi.dll")) == NULL) -+ return NULL; -+ -+ if (!(pfnEnumProcessModules = (PFNENUMPROCESSMODULES) GetProcAddress (psapi, "EnumProcessModules"))) -+ return NULL; -+ } -+ -+ if (!(*pfnEnumProcessModules) (GetCurrentProcess (), &dummy, -+ sizeof (HMODULE), &needed)) -+ return NULL; -+ -+ size = needed + 10 * sizeof (HMODULE); -+ modules = g_malloc (size); -+ -+ if (!(*pfnEnumProcessModules) (GetCurrentProcess (), modules, -+ size, &needed) -+ || needed > size) -+ { -+ g_free (modules); -+ return NULL; -+ } -+ -+ p = NULL; -+ for (i = 0; i < needed / sizeof (HMODULE); i++) -+ if ((p = GetProcAddress (modules[i], symbol_name)) != NULL) -+ break; -+ -+ g_free (modules); -+ -+ return p; -+} -+ -+static gpointer -+find_in_any_module (const gchar *symbol_name) -+{ -+ gpointer result; -+ -+ if ((result = find_in_any_module_using_toolhelp (symbol_name)) == NULL -+ && (result = find_in_any_module_using_psapi (symbol_name)) == NULL) -+ return NULL; -+ else -+ return result; -+} -+ -+/* --- dl functions --- */ -+static gchar* -+fetch_dlerror (gboolean replace_null) -+{ -+ gchar *msg = dlerror (); -+ -+ /* make sure we always return an error message != NULL, if -+ * expected to do so. */ -+ -+ if (!msg && replace_null) -+ return "unknown dl-error"; -+ -+ return msg; -+} -+ -+static gpointer -+_g_module_open (const gchar *file_name, -+ gboolean bind_lazy, -+ gboolean bind_local) -+{ -+ gpointer handle; -+ -+ handle = dlopen (file_name, -+ (bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW)); -+ if (!handle) -+ g_module_set_error (fetch_dlerror (TRUE)); -+ -+ return handle; -+} -+ -+static gpointer -+_g_module_self (void) -+{ -+ gpointer handle; -+ -+ /* to query symbols from the program itself, special link options -+ * are required on some systems. -+ */ -+ -+ handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY); -+ if (!handle) -+ g_module_set_error (fetch_dlerror (TRUE)); -+ -+ return handle; -+} -+ -+static void -+_g_module_close (gpointer handle, -+ gboolean is_unref) -+{ -+ /* are there any systems out there that have dlopen()/dlclose() -+ * without a reference count implementation? -+ */ -+ is_unref |= 1; -+ -+ if (is_unref) -+ { -+ if (dlclose (handle) != 0) -+ g_module_set_error (fetch_dlerror (TRUE)); -+ } -+} -+ -+static gpointer -+_g_module_symbol (gpointer handle, -+ const gchar *symbol_name) -+{ -+ gpointer p; -+ -+ p = dlsym (handle, symbol_name); -+ if (!p) -+ p = find_in_any_module (symbol_name); -+ if (!p) -+ g_module_set_error (fetch_dlerror (FALSE)); -+ -+ return p; -+} -+ -+static gchar* -+_g_module_build_path (const gchar *directory, -+ const gchar *module_name) -+{ -+ if (directory && *directory) { -+ if (g_str_has_suffix (module_name, "." G_MODULE_SUFFIX) == TRUE || g_strrstr (module_name, "." G_MODULE_SUFFIX ".") != NULL) -+ return g_strconcat (directory, "/", module_name, NULL); -+ else if (g_str_has_prefix (module_name, "cyg") == TRUE) -+ return g_strconcat (directory, "/", module_name, "." G_MODULE_SUFFIX, NULL); -+ else -+ return g_strconcat (directory, "/cyg", module_name, "." G_MODULE_SUFFIX, NULL); -+ } -+ else if (g_str_has_suffix (module_name, "." G_MODULE_SUFFIX) == TRUE || g_strrstr (module_name, "." G_MODULE_SUFFIX ".") != NULL) -+ return g_strconcat (module_name, NULL); -+ else if (g_str_has_prefix (module_name, "cyg") == TRUE) -+ return g_strconcat (module_name, "." G_MODULE_SUFFIX, NULL); -+ else -+ return g_strconcat ("cyg", module_name, "." G_MODULE_SUFFIX, NULL); -+} ---- origsrc/glib-2.16.5/gmodule/gmodule-win32.c 2008-07-01 17:30:05.000000000 -0500 -+++ src/glib-2.16.5/gmodule/gmodule-win32.c 2008-07-22 18:05:16.296875000 -0500 -@@ -37,10 +37,6 @@ - - #include - --#ifdef G_WITH_CYGWIN --#include --#endif -- - static void - set_error (void) - { -@@ -58,12 +54,6 @@ - { - HINSTANCE handle; - wchar_t *wfilename; --#ifdef G_WITH_CYGWIN -- gchar tmp[MAX_PATH]; -- -- cygwin_conv_to_win32_path(file_name, tmp); -- file_name = tmp; --#endif - wfilename = g_utf8_to_utf16 (file_name, -1, NULL, NULL, NULL); - - handle = LoadLibraryW (wfilename); -@@ -235,28 +225,14 @@ - if (directory && *directory) - if (k > 4 && g_ascii_strcasecmp (module_name + k - 4, ".dll") == 0) - return g_strconcat (directory, G_DIR_SEPARATOR_S, module_name, NULL); --#ifdef G_WITH_CYGWIN -- else if (strncmp (module_name, "lib", 3) == 0 || strncmp (module_name, "cyg", 3) == 0) -- return g_strconcat (directory, G_DIR_SEPARATOR_S, module_name, ".dll", NULL); -- else -- return g_strconcat (directory, G_DIR_SEPARATOR_S, "cyg", module_name, ".dll", NULL); --#else - else if (strncmp (module_name, "lib", 3) == 0) - return g_strconcat (directory, G_DIR_SEPARATOR_S, module_name, ".dll", NULL); - else - return g_strconcat (directory, G_DIR_SEPARATOR_S, "lib", module_name, ".dll", NULL); --#endif - else if (k > 4 && g_ascii_strcasecmp (module_name + k - 4, ".dll") == 0) - return g_strdup (module_name); --#ifdef G_WITH_CYGWIN -- else if (strncmp (module_name, "lib", 3) == 0 || strncmp (module_name, "cyg", 3) == 0) -- return g_strconcat (module_name, ".dll", NULL); -- else -- return g_strconcat ("cyg", module_name, ".dll", NULL); --#else - else if (strncmp (module_name, "lib", 3) == 0) - return g_strconcat (module_name, ".dll", NULL); - else - return g_strconcat ("lib", module_name, ".dll", NULL); --#endif - } ---- origsrc/glib-2.16.5/gmodule/gmodule.c 2008-07-01 17:30:05.000000000 -0500 -+++ src/glib-2.16.5/gmodule/gmodule.c 2008-07-22 18:05:16.296875000 -0500 -@@ -151,6 +151,8 @@ - #include "gmodule-dl.c" - #elif (G_MODULE_IMPL == G_MODULE_IMPL_DLD) - #include "gmodule-dld.c" -+#elif (G_MODULE_IMPL == G_MODULE_IMPL_CYGWIN) -+#include "gmodule-cygwin.c" - #elif (G_MODULE_IMPL == G_MODULE_IMPL_WIN32) - #include "gmodule-win32.c" - #elif (G_MODULE_IMPL == G_MODULE_IMPL_DYLD) diff --git a/2.22.4-not-win32.patch b/2.22.4-not-win32.patch deleted file mode 100644 index a32e216..0000000 --- a/2.22.4-not-win32.patch +++ /dev/null @@ -1,260 +0,0 @@ ---- origsrc/glib-2.22.4/gio/giomodule.c 2009-11-01 13:57:57.000000000 -0600 -+++ src/glib-2.22.4/gio/giomodule.c 2010-01-29 04:07:54.798013900 -0600 -@@ -297,7 +297,7 @@ extern GType _g_win32_volume_monitor_get - extern GType g_win32_directory_monitor_get_type (void); - extern GType _g_winhttp_vfs_get_type (void); - --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - - #include - ---- origsrc/glib-2.20.0/gio/tests/live-g-file.c 2009-03-12 23:09:51.000000000 -0500 -+++ src/glib-2.20.0/gio/tests/live-g-file.c 2009-03-14 22:14:36.578125000 -0500 -@@ -1124,7 +1124,7 @@ main (int argc, char *argv[]) - write_test = TRUE; - only_create_struct = FALSE; - target_path = DEFAULT_TEST_DIR; --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - posix_compat = FALSE; - #else - posix_compat = TRUE; ---- origsrc/glib-2.20.0/glib/gatomic.c 2009-03-12 23:09:59.000000000 -0500 -+++ src/glib-2.20.0/glib/gatomic.c 2009-03-14 22:16:39.343750000 -0500 -@@ -777,7 +777,7 @@ g_atomic_int_add (volatile gint G_GNUC_M - # define DEFINE_WITH_MUTEXES - # endif /* G_ATOMIC_* */ - #else /* !__GNUC__ */ --# ifdef G_PLATFORM_WIN32 -+# ifdef G_OS_WIN32 - # define DEFINE_WITH_WIN32_INTERLOCKED - # else - # define DEFINE_WITH_MUTEXES ---- origsrc/glib-2.20.3/glib/gconvert.c 2009-03-31 18:04:20.000000000 -0500 -+++ src/glib-2.20.3/glib/gconvert.c 2009-05-31 01:30:21.933166200 -0500 -@@ -38,9 +38,6 @@ - - #ifdef G_OS_WIN32 - #include "win_iconv.c" --#endif -- --#ifdef G_PLATFORM_WIN32 - #define STRICT - #include - #undef STRICT -@@ -1119,7 +1116,7 @@ g_locale_from_utf8 (const gchar *utf8str - charset, "UTF-8", bytes_read, bytes_written, error); - } - --#ifndef G_PLATFORM_WIN32 -+#ifndef G_OS_WIN32 - - typedef struct _GFilenameCharsetCache GFilenameCharsetCache; - -@@ -1235,7 +1232,7 @@ g_get_filename_charsets (G_CONST_RETURN - return cache->is_utf8; - } - --#else /* G_PLATFORM_WIN32 */ -+#else /* G_OS_WIN32 */ - - gboolean - g_get_filename_charsets (G_CONST_RETURN gchar ***filename_charsets) -@@ -1264,7 +1261,7 @@ g_get_filename_charsets (G_CONST_RETURN - #endif - } - --#endif /* G_PLATFORM_WIN32 */ -+#endif /* G_OS_WIN32 */ - - static gboolean - get_filename_charset (const gchar **filename_charset) ---- origsrc/glib-2.20.3/glib/glib.h 2009-05-29 00:06:29.000000000 -0500 -+++ src/glib-2.20.3/glib/glib.h 2009-05-31 01:30:27.754499100 -0500 -@@ -84,7 +84,7 @@ - #include - #include - #include --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - #include - #endif - ---- origsrc/glib-2.20.0/glib/gutf8.c 2009-03-12 23:09:59.000000000 -0500 -+++ src/glib-2.20.0/glib/gutf8.c 2009-03-14 22:18:50.937500000 -0500 -@@ -29,7 +29,7 @@ - - #include "glib.h" - --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - #include - #define STRICT - #include ---- origsrc/glib-2.20.0/glib/gutils.c 2009-03-12 23:09:59.000000000 -0500 -+++ src/glib-2.20.0/glib/gutils.c 2009-03-14 22:47:54.734375000 -0500 -@@ -73,7 +73,7 @@ - #define G_PATH_LENGTH 2048 - #endif - --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - # define STRICT /* Strict typing, please */ - # include - # undef STRICT -@@ -82,9 +82,6 @@ - # define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4 - # endif - # include /* For UNLEN */ --#endif /* G_PLATFORM_WIN32 */ -- --#ifdef G_OS_WIN32 - # include - # include - /* older SDK (e.g. msvc 5.0) does not have these*/ -@@ -126,7 +123,7 @@ const guint glib_micro_version = GLIB_MI - const guint glib_interface_age = GLIB_INTERFACE_AGE; - const guint glib_binary_age = GLIB_BINARY_AGE; - --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - - static HMODULE glib_dll = NULL; - -@@ -827,7 +824,7 @@ g_path_skip_root (const gchar *file_name - { - g_return_val_if_fail (file_name != NULL, NULL); - --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - /* Skip \\server\share or //server/share */ - if (G_IS_DIR_SEPARATOR (file_name[0]) && - G_IS_DIR_SEPARATOR (file_name[1]) && -@@ -837,13 +834,11 @@ g_path_skip_root (const gchar *file_name - gchar *p; - - p = strchr (file_name + 2, G_DIR_SEPARATOR); --#ifdef G_OS_WIN32 - { - gchar *q = strchr (file_name + 2, '/'); - if (p == NULL || (q != NULL && q < p)) - p = q; - } --#endif - if (p && - p > file_name + 2 && - p[1]) -@@ -3021,7 +3021,7 @@ guess_category_value (const gchar *categ - if ((retval != NULL) && (retval[0] != '\0')) - return retval; - --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - /* g_win32_getlocale() first checks for LC_ALL, LC_MESSAGES and - * LANG, which we already did above. Oh well. The main point of - * calling g_win32_getlocale() is to get the thread's locale as used ---- origsrc/glib-2.20.0/glib/gutils.h 2009-03-12 23:09:59.000000000 -0500 -+++ src/glib-2.20.0/glib/gutils.h 2009-03-14 22:48:29.625000000 -0500 -@@ -454,7 +454,7 @@ G_END_DECLS - * On non-Windows platforms, expands to nothing. - */ - --#ifndef G_PLATFORM_WIN32 -+#ifndef G_OS_WIN32 - # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) - #else - # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) \ -@@ -482,6 +482,6 @@ DllMain (HINSTANCE hinstDLL, \ - - #endif /* !G_DISABLE_DEPRECATED */ - --#endif /* G_PLATFORM_WIN32 */ -+#endif /* G_OS_WIN32 */ - - #endif /* __G_UTILS_H__ */ ---- origsrc/glib-2.20.3/glib/gwin32.h 2009-03-31 18:04:20.000000000 -0500 -+++ src/glib-2.20.3/glib/gwin32.h 2009-05-31 01:27:34.933614300 -0500 -@@ -33,7 +33,7 @@ - - #include - --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - - G_BEGIN_DECLS - -@@ -41,8 +41,6 @@ G_BEGIN_DECLS - #define MAXPATHLEN 1024 - #endif - --#ifdef G_OS_WIN32 -- - /* - * To get prototypes for the following POSIXish functions, you have to - * include the indicated non-POSIX headers. The functions are defined -@@ -67,7 +65,6 @@ G_BEGIN_DECLS - */ - gint g_win32_ftruncate (gint f, - guint size); --#endif /* G_OS_WIN32 */ - - /* The MS setlocale uses locale names of the form "English_United - * States.1252" etc. We want the Unixish standard form "en", "zh_TW" -@@ -109,6 +106,6 @@ gchar* g_win32_locale_filename_ - - G_END_DECLS - --#endif /* G_PLATFORM_WIN32 */ -+#endif /* G_OS_WIN32 */ - - #endif /* __G_WIN32_H__ */ ---- origsrc/glib-2.20.3/tests/Makefile.am 2009-05-29 00:06:30.000000000 -0500 -+++ src/glib-2.20.3/tests/Makefile.am 2009-05-31 02:27:23.889890900 -0500 -@@ -28,7 +28,9 @@ libadd_libgmodule = $(libgmodule) - libadd_libglib = $(libglib) - if PLATFORM_WIN32 - no_undefined = -no-undefined -+endif - -+if OS_WIN32 - module_test_exp = module-test.exp - - module-test.exp: module-test.o ---- origsrc/glib-2.20.3/tests/testglib.c 2009-04-08 09:10:15.000000000 -0500 -+++ src/glib-2.20.3/tests/testglib.c 2009-05-31 01:53:02.731999400 -0500 -@@ -738,7 +738,7 @@ test_info (void) - - if (g_test_verbose()) - { --#ifdef G_PLATFORM_WIN32 -+#ifdef G_OS_WIN32 - gchar *glib_dll; - #endif - const gchar *charset; -@@ -747,14 +747,9 @@ test_info (void) - else - g_print ("current charset is not UTF-8: %s\n", charset); - --#ifdef G_PLATFORM_WIN32 - #ifdef G_OS_WIN32 - /* Can't calculate GLib DLL name at runtime. */ - glib_dll = "libglib-2.0-0.dll"; --#endif --#ifdef G_WITH_CYGWIN -- glib_dll = "cygglib-2.0-0.dll"; --#endif - - g_print ("current locale: %s\n", g_win32_getlocale ()); - g_print ("GLib DLL name tested for: %s\n", glib_dll); ---- origsrc/glib-2.20.3/tests/uri-test.c 2009-03-31 18:04:21.000000000 -0500 -+++ src/glib-2.20.3/tests/uri-test.c 2009-05-31 01:32:00.534805900 -0500 -@@ -61,7 +61,7 @@ to_uri_tests[] = { - { "c:\\windows", "otherhost", NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH}, - #endif - { "etc", "localhost", NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH}, --#ifndef G_PLATFORM_WIN32 -+#ifndef G_OS_WIN32 - { "/etc/\xE5\xE4\xF6", NULL, "file:///etc/%E5%E4%F6" }, - { "/etc/\xC3\xB6\xC3\xA4\xC3\xA5", NULL, "file:///etc/%C3%B6%C3%A4%C3%A5"}, - #endif diff --git a/2.24.1-gmodule.patch b/2.24.1-gmodule.patch new file mode 100644 index 0000000..c2e41e5 --- /dev/null +++ b/2.24.1-gmodule.patch @@ -0,0 +1,131 @@ +--- origsrc/glib-2.24.1/gmodule/gmodule-win32.c 2009-03-31 18:04:20.000000000 -0500 ++++ src/glib-2.24.1/gmodule/gmodule-win32.c 2010-06-14 22:11:23.331503500 -0500 +@@ -38,8 +38,23 @@ + #include + + #ifdef G_WITH_CYGWIN +-#include +-#endif ++#include ++ ++static gchar* ++fetch_dlerror (gboolean replace_null) ++{ ++ gchar *msg = dlerror (); ++ ++ /* make sure we always return an error message != NULL, if ++ * expected to do so. */ ++ ++ if (!msg && replace_null) ++ return "unknown dl-error"; ++ ++ return msg; ++} ++ ++#else + + static void + set_error (const gchar *format, +@@ -64,20 +79,28 @@ set_error (const gchar *format, + g_free (error); + } + ++#endif ++ + /* --- functions --- */ + static gpointer + _g_module_open (const gchar *file_name, + gboolean bind_lazy, + gboolean bind_local) + { ++#ifdef G_WITH_CYGWIN ++ gpointer handle; ++ ++ handle = dlopen (file_name, ++ (bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW)); ++ if (!handle) ++ g_module_set_error (fetch_dlerror (TRUE)); ++#else + HINSTANCE handle; + wchar_t *wfilename; +-#ifdef G_WITH_CYGWIN + gchar tmp[MAX_PATH]; + + cygwin_conv_to_win32_path(file_name, tmp); + file_name = tmp; +-#endif + wfilename = g_utf8_to_utf16 (file_name, -1, NULL, NULL, NULL); + + handle = LoadLibraryW (wfilename); +@@ -85,6 +108,7 @@ _g_module_open (const gchar *file_name, + + if (!handle) + set_error ("`%s': ", file_name); ++#endif + + return handle; + } +@@ -95,16 +119,41 @@ static gpointer null_module_handle = &du + static gpointer + _g_module_self (void) + { ++#ifdef G_WITH_CYGWIN ++ gpointer handle; ++ ++ /* to query symbols from the program itself, special link options ++ * are required on some systems. ++ */ ++ ++ handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY); ++ if (!handle) ++ g_module_set_error (fetch_dlerror (TRUE)); ++ ++ return handle; ++#else + return null_module_handle; ++#endif + } + + static void + _g_module_close (gpointer handle, + gboolean is_unref) + { ++#ifdef G_WITH_CYGWIN ++ /* are there any systems out there that have dlopen()/dlclose() ++ * without a reference count implementation? ++ */ ++ is_unref |= 1; ++ ++ if (is_unref) ++ if (dlclose (handle) != 0) ++ g_module_set_error (fetch_dlerror (TRUE)); ++#else + if (handle != null_module_handle) + if (!FreeLibrary (handle)) + set_error (""); ++#endif + } + + static gpointer +@@ -224,6 +273,13 @@ _g_module_symbol (gpointer handle, + { + gpointer p; + ++#ifdef G_WITH_CYGWIN ++ p = dlsym (handle, symbol_name); ++ if (!p) ++ p = find_in_any_module (symbol_name); ++ if (!p) ++ g_module_set_error (fetch_dlerror (FALSE)); ++#else + if (handle == null_module_handle) + { + if ((p = GetProcAddress (GetModuleHandle (NULL), symbol_name)) == NULL) +@@ -234,6 +290,7 @@ _g_module_symbol (gpointer handle, + + if (!p) + set_error (""); ++#endif + + return p; + } diff --git a/2.24.1-not-win32.patch b/2.24.1-not-win32.patch new file mode 100644 index 0000000..d9485ad --- /dev/null +++ b/2.24.1-not-win32.patch @@ -0,0 +1,342 @@ +--- origsrc/glib-2.24.1/configure.in 2010-05-02 18:58:58.000000000 -0500 ++++ src/glib-2.24.1/configure.in 2010-06-14 22:00:16.325353000 -0500 +@@ -2707,9 +2707,6 @@ dnl *** Win32 API libs *** + dnl ********************** + + case $host in +- *-*-cygwin*) +- G_LIBS_EXTRA="-luser32 -lkernel32" +- ;; + *-*-mingw*) + G_LIBS_EXTRA="-lws2_32 -lole32" + ;; +--- origsrc/glib-2.24.1/gio/giomodule.c 2010-05-02 18:58:59.000000000 -0500 ++++ src/glib-2.24.1/gio/giomodule.c 2010-06-14 22:03:22.256987600 -0500 +@@ -465,7 +465,7 @@ extern GType _g_win32_volume_monitor_get + extern GType g_win32_directory_monitor_get_type (void); + extern GType _g_winhttp_vfs_get_type (void); + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + + #include + +--- origsrc/glib-2.24.1/gio/tests/live-g-file.c 2010-04-13 08:33:16.000000000 -0500 ++++ src/glib-2.24.1/gio/tests/live-g-file.c 2010-06-14 22:03:22.263988000 -0500 +@@ -1142,7 +1142,7 @@ main (int argc, char *argv[]) + write_test = TRUE; + only_create_struct = FALSE; + target_path = DEFAULT_TEST_DIR; +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + posix_compat = FALSE; + #else + posix_compat = TRUE; +--- origsrc/glib-2.24.1/glib/gatomic.c 2009-03-31 18:04:20.000000000 -0500 ++++ src/glib-2.24.1/glib/gatomic.c 2010-06-14 22:03:22.270988400 -0500 +@@ -777,7 +777,7 @@ g_atomic_int_add (volatile gint G_GNUC_M + # define DEFINE_WITH_MUTEXES + # endif /* G_ATOMIC_* */ + #else /* !__GNUC__ */ +-# ifdef G_PLATFORM_WIN32 ++# ifdef G_OS_WIN32 + # define DEFINE_WITH_WIN32_INTERLOCKED + # else + # define DEFINE_WITH_MUTEXES +--- origsrc/glib-2.24.1/glib/gconvert.c 2010-04-13 08:33:16.000000000 -0500 ++++ src/glib-2.24.1/glib/gconvert.c 2010-06-14 22:03:22.275988700 -0500 +@@ -38,9 +38,6 @@ + + #ifdef G_OS_WIN32 + #include "win_iconv.c" +-#endif +- +-#ifdef G_PLATFORM_WIN32 + #define STRICT + #include + #undef STRICT +@@ -1133,7 +1130,7 @@ g_locale_from_utf8 (const gchar *utf8str + charset, "UTF-8", bytes_read, bytes_written, error); + } + +-#ifndef G_PLATFORM_WIN32 ++#ifndef G_OS_WIN32 + + typedef struct _GFilenameCharsetCache GFilenameCharsetCache; + +@@ -1249,7 +1246,7 @@ g_get_filename_charsets (G_CONST_RETURN + return cache->is_utf8; + } + +-#else /* G_PLATFORM_WIN32 */ ++#else /* G_OS_WIN32 */ + + gboolean + g_get_filename_charsets (G_CONST_RETURN gchar ***filename_charsets) +@@ -1278,7 +1275,7 @@ g_get_filename_charsets (G_CONST_RETURN + #endif + } + +-#endif /* G_PLATFORM_WIN32 */ ++#endif /* G_OS_WIN32 */ + + static gboolean + get_filename_charset (const gchar **filename_charset) +--- origsrc/glib-2.24.1/glib/glib.h 2010-04-13 08:33:16.000000000 -0500 ++++ src/glib-2.24.1/glib/glib.h 2010-06-14 22:01:11.406503400 -0500 +@@ -88,7 +88,7 @@ + #include + #include + #include +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + #include + #endif + +--- origsrc/glib-2.24.1/glib/gutf8.c 2010-04-13 08:33:16.000000000 -0500 ++++ src/glib-2.24.1/glib/gutf8.c 2010-06-14 22:03:22.282989100 -0500 +@@ -29,7 +29,7 @@ + + #include "glib.h" + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + #include + #define STRICT + #include +--- origsrc/glib-2.24.1/glib/gutils.c 2010-04-13 08:33:16.000000000 -0500 ++++ src/glib-2.24.1/glib/gutils.c 2010-06-14 22:03:22.288989500 -0500 +@@ -73,7 +73,7 @@ + #define G_PATH_LENGTH 2048 + #endif + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + # define STRICT /* Strict typing, please */ + # include + # undef STRICT +@@ -82,9 +82,6 @@ + # define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4 + # endif + # include /* For UNLEN */ +-#endif /* G_PLATFORM_WIN32 */ +- +-#ifdef G_OS_WIN32 + # include + # include + /* older SDK (e.g. msvc 5.0) does not have these*/ +@@ -126,7 +123,7 @@ const guint glib_micro_version = GLIB_MI + const guint glib_interface_age = GLIB_INTERFACE_AGE; + const guint glib_binary_age = GLIB_BINARY_AGE; + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + + static HMODULE glib_dll = NULL; + +@@ -827,7 +824,7 @@ g_path_skip_root (const gchar *file_name + { + g_return_val_if_fail (file_name != NULL, NULL); + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + /* Skip \\server\share or //server/share */ + if (G_IS_DIR_SEPARATOR (file_name[0]) && + G_IS_DIR_SEPARATOR (file_name[1]) && +@@ -837,13 +834,11 @@ g_path_skip_root (const gchar *file_name + gchar *p; + + p = strchr (file_name + 2, G_DIR_SEPARATOR); +-#ifdef G_OS_WIN32 + { + gchar *q = strchr (file_name + 2, '/'); + if (p == NULL || (q != NULL && q < p)) + p = q; + } +-#endif + if (p && + p > file_name + 2 && + p[1]) +@@ -3079,7 +3074,7 @@ guess_category_value (const gchar *categ + if ((retval != NULL) && (retval[0] != '\0')) + return retval; + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + /* g_win32_getlocale() first checks for LC_ALL, LC_MESSAGES and + * LANG, which we already did above. Oh well. The main point of + * calling g_win32_getlocale() is to get the thread's locale as used +--- origsrc/glib-2.24.1/glib/gutils.h 2010-04-13 08:33:16.000000000 -0500 ++++ src/glib-2.24.1/glib/gutils.h 2010-06-14 22:03:22.294989800 -0500 +@@ -457,7 +457,7 @@ G_END_DECLS + * On non-Windows platforms, expands to nothing. + */ + +-#ifndef G_PLATFORM_WIN32 ++#ifndef G_OS_WIN32 + # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) + #else + # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) \ +@@ -485,6 +485,6 @@ DllMain (HINSTANCE hinstDLL, \ + + #endif /* !G_DISABLE_DEPRECATED */ + +-#endif /* G_PLATFORM_WIN32 */ ++#endif /* G_OS_WIN32 */ + + #endif /* __G_UTILS_H__ */ +--- origsrc/glib-2.24.1/glib/gwin32.h 2009-03-31 18:04:20.000000000 -0500 ++++ src/glib-2.24.1/glib/gwin32.h 2010-06-14 22:03:22.301990200 -0500 +@@ -33,7 +33,7 @@ + + #include + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + + G_BEGIN_DECLS + +@@ -41,8 +41,6 @@ G_BEGIN_DECLS + #define MAXPATHLEN 1024 + #endif + +-#ifdef G_OS_WIN32 +- + /* + * To get prototypes for the following POSIXish functions, you have to + * include the indicated non-POSIX headers. The functions are defined +@@ -67,7 +65,6 @@ G_BEGIN_DECLS + */ + gint g_win32_ftruncate (gint f, + guint size); +-#endif /* G_OS_WIN32 */ + + /* The MS setlocale uses locale names of the form "English_United + * States.1252" etc. We want the Unixish standard form "en", "zh_TW" +@@ -109,6 +106,6 @@ gchar* g_win32_locale_filename_ + + G_END_DECLS + +-#endif /* G_PLATFORM_WIN32 */ ++#endif /* G_OS_WIN32 */ + + #endif /* __G_WIN32_H__ */ +--- origsrc/glib-2.24.1/glib/libcharset/localcharset.c 2009-03-31 18:04:20.000000000 -0500 ++++ src/glib-2.24.1/glib/libcharset/localcharset.c 2010-06-14 22:06:07.008410900 -0500 +@@ -46,10 +46,6 @@ + # include + # endif + # endif +-# ifdef __CYGWIN__ +-# define WIN32_LEAN_AND_MEAN +-# include +-# endif + #elif defined WIN32_NATIVE + # define WIN32_LEAN_AND_MEAN + # include +@@ -111,7 +107,7 @@ _g_locale_get_charset_aliases (void) + cp = charset_aliases; + if (cp == NULL) + { +-#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) ++#if !(defined VMS || defined WIN32_NATIVE) + FILE *fp; + const char *dir; + const char *base = "charset.alias"; +@@ -237,7 +233,7 @@ _g_locale_get_charset_aliases (void) + "DECKOREAN" "\0" "EUC-KR" "\0"; + # endif + +-# if defined WIN32_NATIVE || defined __CYGWIN__ ++# if defined WIN32_NATIVE + /* To avoid the troubles of installing a separate file in the same + directory as the DLL and of retrieving the DLL's directory at + runtime, simply inline the aliases here. */ +@@ -292,53 +288,6 @@ _g_locale_charset_raw (void) + /* Most systems support nl_langinfo (CODESET) nowadays. */ + codeset = nl_langinfo (CODESET); + +-# ifdef __CYGWIN__ +- /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always +- returns "US-ASCII". As long as this is not fixed, return the suffix +- of the locale name from the environment variables (if present) or +- the codepage as a number. */ +- if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) +- { +- const char *locale; +- static char buf[2 + 10 + 1]; +- +- locale = getenv ("LC_ALL"); +- if (locale == NULL || locale[0] == '\0') +- { +- locale = getenv ("LC_CTYPE"); +- if (locale == NULL || locale[0] == '\0') +- locale = getenv ("LANG"); +- } +- if (locale != NULL && locale[0] != '\0') +- { +- /* If the locale name contains an encoding after the dot, return +- it. */ +- const char *dot = strchr (locale, '.'); +- +- if (dot != NULL) +- { +- const char *modifier; +- +- dot++; +- /* Look for the possible @... trailer and remove it, if any. */ +- modifier = strchr (dot, '@'); +- if (modifier == NULL) +- return dot; +- if (modifier - dot < sizeof (buf)) +- { +- memcpy (buf, dot, modifier - dot); +- buf [modifier - dot] = '\0'; +- return buf; +- } +- } +- } +- +- /* Woe32 has a function returning the locale's codepage as a number. */ +- sprintf (buf, "CP%u", GetACP ()); +- codeset = buf; +- } +-# endif +- + # else + + /* On old systems which lack it, use setlocale or getenv. */ +--- origsrc/glib-2.24.1/tests/Makefile.am 2010-04-13 08:33:17.000000000 -0500 ++++ src/glib-2.24.1/tests/Makefile.am 2010-06-14 22:03:22.305990400 -0500 +@@ -21,7 +21,9 @@ libadd_libgmodule = $(libgmodule) + libadd_libglib = $(libglib) + if PLATFORM_WIN32 + no_undefined = -no-undefined ++endif + ++if OS_WIN32 + module_test_exp = module-test.exp + + module-test.exp: module-test.o +--- origsrc/glib-2.24.1/tests/testglib.c 2010-04-13 08:33:17.000000000 -0500 ++++ src/glib-2.24.1/tests/testglib.c 2010-06-14 22:02:28.504913200 -0500 +@@ -744,7 +744,7 @@ test_info (void) + else + g_print ("current charset is not UTF-8: %s\n", charset); + +-#ifdef G_PLATFORM_WIN32 ++#ifdef G_OS_WIN32 + g_print ("current locale: %s\n", g_win32_getlocale ()); + + g_print ("found more.com as %s\n", g_find_program_in_path ("more.com")); +--- origsrc/glib-2.24.1/tests/uri-test.c 2009-11-29 19:57:36.000000000 -0600 ++++ src/glib-2.24.1/tests/uri-test.c 2010-06-14 22:03:22.312990800 -0500 +@@ -61,7 +61,7 @@ to_uri_tests[] = { + { "c:\\windows", "otherhost", NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH}, + #endif + { "etc", "localhost", NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH}, +-#ifndef G_PLATFORM_WIN32 ++#ifndef G_OS_WIN32 + { "/etc/\xE5\xE4\xF6", NULL, "file:///etc/%E5%E4%F6" }, + { "/etc/\xC3\xB6\xC3\xA4\xC3\xA5", NULL, "file:///etc/%C3%B6%C3%A4%C3%A5"}, + #endif diff --git a/README b/README index d65f3f0..44c5db3 100644 --- a/README +++ b/README @@ -6,12 +6,12 @@ portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system. Runtime requirements: - cygwin-1.7.1-1 + cygwin-1.7.5-1 libfam0-0.1.10-10 libgcc4-4.3.4-3 libiconv2-1.13.1-1 libintl8-0.17-11 - libpcre0-8.00-1 + libpcre0-8.02-1 perl python @@ -19,15 +19,14 @@ Build requirements: (besides corresponding -devel packages) autoconf2.5-2.65-1 automake1.11-1.11.1-1 - cygport-0.9.80-1 + cygport-0.9.84-1 gawk-3.1.7-1 gcc4-core-4.3.4-3 - gnome-common-2.28.0-1 - gtk-doc-1.13-1 + gnome-common-2.28.0-2 + gtk-doc-1.15-1 libtool-2.2.7a-15 make-3.81-2 pkg-config-0.23b-10 - sed-4.1.5-2 Canonical website: http://www.gtk.org/ @@ -39,21 +38,24 @@ Canonical download: ------------------------------------------- Build instructions: - unpack glib2.0-2.22.4-X-src.tar.bz2 + unpack glib2.0-2.24.1-X-src.tar.bz2 if you use setup to install this src package, it will be unpacked under /usr/src automatically cd /usr/src - cygport ./glib2.0-2.22.4-X.cygport all + cygport ./glib2.0-2.24.1-X.cygport all This will create: - /usr/src/glib2.0-2.22.4-X-src.tar.bz2 - /usr/src/libglib2.0_0-2.22.4-X.tar.bz2 - /usr/src/libglib2.0-devel-2.22.4-X.tar.bz2 + /usr/src/glib2.0-2.24.1-X-src.tar.bz2 + /usr/src/libglib2.0_0-2.24.1-X.tar.bz2 + /usr/src/libglib2.0-devel-2.24.1-X.tar.bz2 ------------------------------------------- Port Notes: +----- version 2.24.1-1 ----- +Version bump for GNOME 2.30. + ----- version 2.22.4-2 ----- Fixed bug in GIO plugin loading introduced in 2.22.3. diff --git a/glib2.0-2.22.4-2.cygport b/glib2.0-2.24.1-1.cygport similarity index 92% rename from glib2.0-2.22.4-2.cygport rename to glib2.0-2.24.1-1.cygport index 13a0d92..19deb80 100644 --- a/glib2.0-2.22.4-2.cygport +++ b/glib2.0-2.24.1-1.cygport @@ -5,9 +5,9 @@ inherit gnome2 DESCRIPTION="GNOME core C function library" HOMEPAGE="http://www.gtk.org/" -PATCH_URI="2.16-gmodule.patch +PATCH_URI="2.24.1-gmodule.patch 2.16-tests.patch - 2.22.4-not-win32.patch + 2.24.1-not-win32.patch 2.20-cygwin17.patch" DISTCLEANFILES="gmodule/gmodule-cygwin.c"