glib: Update to 2.64.6 and port to meson

Reasons for patches being dropped:

* 2.34.3-m4macros.patch: autotools related
* 2.36.3-not-win32.patch:
  https://gitlab.gnome.org/GNOME/glib/-/merge_requests/751
  https://gitlab.gnome.org/GNOME/glib/-/merge_requests/862
* 2.36.3-visibility.patch: autotools related
* 2.36.4-gspawn-cygwin.patch: unclear, that code is gone
* 2.36.4-gutf8-cygwin.patch:
  https://gitlab.gnome.org/GNOME/glib/-/merge_requests/863
* 2.42.1-goption-cygwin.patch:
  https://gitlab.gnome.org/GNOME/glib/-/merge_requests/754
* glib-2.38.1-msys2.patch: autotools related

I've rebased the remaining, hopefully that worked out..
This commit is contained in:
Christoph Reiter 2020-10-16 16:10:05 +02:00
parent 562af72b8d
commit a429f3a2f4
9 changed files with 78 additions and 650 deletions

View File

@ -1,15 +0,0 @@
Fix for -Werror=nested-externs
--- origsrc/glib-2.34.3/m4macros/glib-gettext.m4 2012-11-20 08:27:12.000000000 -0600
+++ src/glib-2.34.3/m4macros/glib-gettext.m4 2013-04-15 02:04:25.707401500 -0500
@@ -222,8 +222,8 @@ msgstr ""
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
- AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
- return _nl_msg_cat_cntr],
+ AC_TRY_LINK([extern int _nl_msg_cat_cntr;],
+ [return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[case $host in

View File

@ -1,389 +0,0 @@
--- origsrc/glib-2.36.3/configure.ac 2013-08-04 20:21:20.808722600 -0500
+++ src/glib-2.36.3/configure.ac 2013-08-04 18:30:21.852852200 -0500
@@ -1880,7 +1880,7 @@ dnl ************************************
AC_MSG_CHECKING(for platform-dependent source)
case "$host" in
- *-*-cygwin*|*-*-mingw*)
+ *-*-mingw*)
PLATFORMDEP=gwin32.lo
;;
*)
@@ -2594,9 +2594,6 @@ dnl *** Win32 API libs ***
dnl **********************
case $host in
- *-*-cygwin*)
- G_LIBS_EXTRA="-luser32 -lkernel32"
- ;;
*-*-mingw*)
G_LIBS_EXTRA="-lws2_32 -lole32 -lwinmm -lshlwapi"
;;
--- origsrc/glib-2.36.3/docs/reference/gio/Makefile.am 2013-08-04 20:21:20.849725000 -0500
+++ src/glib-2.36.3/docs/reference/gio/Makefile.am 2013-08-04 18:11:14.000000000 -0500
@@ -77,6 +77,8 @@ IGNORE_HFILES = \
gunixvolume.h \
gunixvolumemonitor.h \
gwin32appinfo.h \
+ gwin32inputstream.h \
+ gwin32outputstream.h \
gwin32mount.h \
gwin32resolver.h \
gwin32volumemonitor.h
--- origsrc/glib-2.36.3/gio/giomodule-priv.h 2013-08-04 20:21:20.877726600 -0500
+++ src/glib-2.36.3/gio/giomodule-priv.h 2013-08-04 18:11:14.000000000 -0500
@@ -39,7 +39,7 @@ GType _g_io_module_get_default_type (
const gchar *envvar,
guint is_supported_offset);
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
void *_g_io_win32_get_module (void);
#endif
--- origsrc/glib-2.36.3/gio/giomodule.c 2013-08-04 20:21:20.886727100 -0500
+++ src/glib-2.36.3/gio/giomodule.c 2013-08-04 18:11:14.000000000 -0500
@@ -894,7 +894,7 @@ extern GType g_network_monitor_base_get_
extern GType _g_network_monitor_netlink_get_type (void);
#endif
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
#include <windows.h>
--- origsrc/glib-2.36.3/gio/tests/live-g-file.c 2013-08-04 20:21:20.898727800 -0500
+++ src/glib-2.36.3/gio/tests/live-g-file.c 2013-08-04 18:11:14.000000000 -0500
@@ -1282,7 +1282,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.36.3/glib/gatomic.c 2013-08-04 20:21:20.907728300 -0500
+++ src/glib-2.36.3/glib/gatomic.c 2013-08-04 18:11:14.000000000 -0500
@@ -464,7 +464,7 @@ gsize
return g_atomic_pointer_xor ((volatile gpointer *) atomic, val);
}
-#elif defined (G_PLATFORM_WIN32)
+#elif defined (G_OS_WIN32)
#include <windows.h>
#if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) && !(defined _MSC_VER && _MSC_VER <= 1200)
--- origsrc/glib-2.36.3/glib/gcharset.c 2013-08-04 20:21:20.925729300 -0500
+++ src/glib-2.36.3/glib/gcharset.c 2013-08-04 18:11:14.000000000 -0500
@@ -496,7 +496,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.36.3/glib/gconvert.c 2013-08-04 20:21:20.933729800 -0500
+++ src/glib-2.36.3/glib/gconvert.c 2013-08-04 18:11:14.000000000 -0500
@@ -33,9 +33,6 @@
#ifdef G_OS_WIN32
#include "win_iconv.c"
-#endif
-
-#ifdef G_PLATFORM_WIN32
#define STRICT
#include <windows.h>
#undef STRICT
@@ -1258,7 +1255,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;
@@ -1374,7 +1371,7 @@ g_get_filename_charsets (const gchar ***
return cache->is_utf8;
}
-#else /* G_PLATFORM_WIN32 */
+#else /* G_OS_WIN32 */
gboolean
g_get_filename_charsets (const gchar ***filename_charsets)
@@ -1403,7 +1400,7 @@ g_get_filename_charsets (const gchar ***
#endif
}
-#endif /* G_PLATFORM_WIN32 */
+#endif /* G_OS_WIN32 */
static gboolean
get_filename_charset (const gchar **filename_charset)
--- origsrc/glib-2.36.3/glib/gfileutils.c 2013-08-04 20:21:20.942730300 -0500
+++ src/glib-2.36.3/glib/gfileutils.c 2013-08-04 18:11:14.000000000 -0500
@@ -2153,7 +2153,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]) &&
@@ -2163,7 +2163,6 @@ g_path_skip_root (const gchar *file_name
gchar *p;
p = strchr (file_name + 2, G_DIR_SEPARATOR);
-#ifdef G_OS_WIN32
{
gchar *q;
@@ -2171,7 +2170,6 @@ g_path_skip_root (const gchar *file_name
if (p == NULL || (q != NULL && q < p))
p = q;
}
-#endif
if (p && p > file_name + 2 && p[1])
{
--- origsrc/glib-2.36.3/glib/glib.h 2013-08-04 20:21:20.949730700 -0500
+++ src/glib-2.36.3/glib/glib.h 2013-08-04 18:11:14.000000000 -0500
@@ -96,7 +96,7 @@
#include <glib/gvariant.h>
#include <glib/gversion.h>
#include <glib/gversionmacros.h>
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
#include <glib/gwin32.h>
#endif
--- origsrc/glib-2.36.3/glib/gutf8.c 2013-08-04 20:21:20.984732700 -0500
+++ src/glib-2.36.3/glib/gutf8.c 2013-08-04 18:11:14.000000000 -0500
@@ -27,7 +27,7 @@
#endif
#include <string.h>
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
#include <stdio.h>
#define STRICT
#include <windows.h>
--- origsrc/glib-2.36.3/glib/gutils.c 2013-08-04 20:21:21.015734500 -0500
+++ src/glib-2.36.3/glib/gutils.c 2013-08-04 18:11:14.000000000 -0500
@@ -72,7 +72,7 @@
#include "garray.h"
#include "glibintl.h"
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
#include "gconvert.h"
#include "gwin32.h"
#endif
@@ -86,16 +86,13 @@
* These are portable utility functions.
*/
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
# include <windows.h>
# ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
# define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 2
# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4
# endif
# include <lmcons.h> /* For UNLEN */
-#endif /* G_PLATFORM_WIN32 */
-
-#ifdef G_OS_WIN32
# include <direct.h>
# include <shlobj.h>
/* older SDK (e.g. msvc 5.0) does not have these*/
@@ -131,7 +128,7 @@
#include <langinfo.h>
#endif
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
gchar *
_glib_get_dll_directory (void)
--- origsrc/glib-2.36.3/glib/gutils.h 2013-08-04 20:21:21.067737500 -0500
+++ src/glib-2.36.3/glib/gutils.h 2013-08-04 18:11:14.000000000 -0500
@@ -350,7 +350,7 @@ g_bit_storage (gulong number)
* 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) \
@@ -378,7 +378,7 @@ DllMain (HINSTANCE hinstDLL, \
#endif /* !G_DISABLE_DEPRECATED */
-#endif /* G_PLATFORM_WIN32 */
+#endif /* G_OS_WIN32 */
G_END_DECLS
--- origsrc/glib-2.36.3/glib/gwin32.h 2013-08-04 20:21:21.081738300 -0500
+++ src/glib-2.36.3/glib/gwin32.h 2013-08-04 18:11:14.000000000 -0500
@@ -33,7 +33,7 @@
#include <glib/gtypes.h>
-#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
@@ -68,7 +66,6 @@ G_BEGIN_DECLS
GLIB_AVAILABLE_IN_ALL
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"
@@ -112,7 +109,7 @@ gchar* g_win32_locale_filename_
G_END_DECLS
-#endif /* G_PLATFORM_WIN32 */
+#endif /* G_OS_WIN32 */
#ifdef G_OS_WIN32
#ifdef _WIN64
--- origsrc/glib-2.36.3/glib/libcharset/localcharset.c 2013-08-04 20:21:21.095739100 -0500
+++ src/glib-2.36.3/glib/libcharset/localcharset.c 2013-08-04 18:11:14.000000000 -0500
@@ -46,10 +46,6 @@
# include <locale.h>
# endif
# endif
-# ifdef __CYGWIN__
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# endif
#elif defined WIN32_NATIVE
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@@ -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.36.3/glib/tests/uri.c 2013-08-04 20:21:21.104739600 -0500
+++ src/glib-2.36.3/glib/tests/uri.c 2013-08-04 18:11:14.000000000 -0500
@@ -56,7 +56,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
--- origsrc/glib-2.36.3/tests/Makefile.am 2013-08-04 20:21:21.109739900 -0500
+++ src/glib-2.36.3/tests/Makefile.am 2013-08-04 18:11:14.000000000 -0500
@@ -20,7 +20,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.36.3/tests/testglib.c 2013-08-04 20:21:21.118740400 -0500
+++ src/glib-2.36.3/tests/testglib.c 2013-08-04 18:11:14.000000000 -0500
@@ -776,7 +776,7 @@ test_info (void)
if (g_test_verbose())
{
-#ifdef G_PLATFORM_WIN32
+#ifdef G_OS_WIN32
g_printerr ("current locale: %s\n", g_win32_getlocale ());
g_printerr ("found more.com as %s\n", g_find_program_in_path ("more.com"));

View File

@ -1,11 +0,0 @@
--- origsrc/glib-2.36.3/configure.ac 2013-08-04 18:11:14.140206800 -0500
+++ src/glib-2.36.3/configure.ac 2013-08-04 18:30:21.852852200 -0500
@@ -3584,7 +3584,7 @@ dnl visibility attributes for symbol exp
dnl
GLIB_HIDDEN_VISIBILITY_CFLAGS=""
case "$host" in
- *-*-mingw*)
+ *-*-cygwin*|*-*-mingw*)
dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
AC_DEFINE([_GLIB_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
[defines how to decorate public symbols while building])

View File

@ -1,11 +0,0 @@
--- origsrc/glib-2.36.4/glib/gspawn.c 2013-08-07 09:36:32.000000000 -0500
+++ src/glib-2.36.4/glib/gspawn.c 2013-10-21 13:25:34.502441400 -0500
@@ -1040,7 +1040,7 @@ fdwalk (int (*cb)(void *data, int fd), v
struct rlimit rl;
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(__CYGWIN__)
DIR *d;
if ((d = opendir("/proc/self/fd"))) {

View File

@ -1,24 +0,0 @@
Cygwin defines this since 1.7.8, but our wchar_t is only 16-bit while
this code seems to assume 32-bit wchar_t. So, either some incorrect
assumptions need to be fixed in the __STDC_ISO_10646__ code paths, or
the conditionals need to also be guarded && (__SIZEOF_WCHAR_T__ == 4).
Reported by SLao:
http://article.gmane.org/gmane.os.cygwin.ports.general/1330
--- origsrc/glib-2.36.4/glib/gunicollate.c 2013-05-07 13:26:07.000000000 -0500
+++ src/glib-2.36.4/glib/gunicollate.c 2013-11-30 21:36:27.710188300 -0600
@@ -37,9 +37,12 @@
#include "gstrfuncs.h"
#include "gtestutils.h"
#include "gcharset.h"
-#ifndef __STDC_ISO_10646__
+#if !defined(__STDC_ISO_10646__) || defined(G_WITH_CYGWIN)
#include "gconvert.h"
#endif
+#ifdef G_WITH_CYGWIN
+#undef __STDC_ISO_10646__
+#endif
#ifdef _MSC_VER

View File

@ -1,31 +0,0 @@
--- origsrc/glib-2.42.1/glib/goption.c 2014-11-09 15:54:26.000000000 -0600
+++ src/glib-2.42.1/glib/goption.c 2015-01-01 19:39:40.385456500 -0600
@@ -1740,7 +1740,7 @@ free_pending_nulls (GOptionContext *cont
static char *
platform_get_argv0 (void)
{
-#if defined __linux
+#if defined __linux || defined __CYGWIN__
char *cmdline;
char *base_arg0;
gsize len;
--- origsrc/glib-2.42.1/glib/tests/option-argv0.c 2014-06-28 12:02:43.000000000 -0500
+++ src/glib-2.42.1/glib/tests/option-argv0.c 2015-01-01 19:39:34.848253300 -0600
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
-#if defined __linux || defined __OpenBSD__
+#if defined __linux || defined __OpenBSD__ || defined __CYGWIN__
static void
test_platform_argv0 (void)
{
@@ -56,7 +56,7 @@ main (int argc,
{
g_test_init (&argc, &argv, "no_g_set_prgname", NULL);
-#if defined __linux || defined __OpenBSD__
+#if defined __linux || defined __OpenBSD__ || defined __CYGWIN__
g_test_add_func ("/option/argv0", test_platform_argv0);
#endif

View File

@ -1,5 +1,16 @@
--- origsrc/glib-2.50.3/gmodule/gmodule-win32.c 2017-03-17 13:34:41.869717400 -0500
+++ src/glib-2.50.3/gmodule/gmodule-win32.c 2017-03-17 13:43:50.357304400 -0500
From e0732151aa27aea76f04558f6414bd95510621df Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Fri, 16 Oct 2020 14:44:15 +0200
Subject: [PATCH] 2.50-gmodule-cygwin (rebased)
---
gmodule/gmodule-win32.c | 72 +++++++++++++++++++++++++++++++++++------
1 file changed, 63 insertions(+), 9 deletions(-)
diff --git a/gmodule/gmodule-win32.c b/gmodule/gmodule-win32.c
index 2aea8bae9..4ee741cce 100644
--- a/gmodule/gmodule-win32.c
+++ b/gmodule/gmodule-win32.c
@@ -37,7 +37,20 @@
#ifdef G_WITH_CYGWIN
@ -20,9 +31,9 @@
+
+#else
static void
static void G_GNUC_PRINTF (1, 2)
set_error (const gchar *format,
@@ -62,20 +75,24 @@ set_error (const gchar *format,
@@ -62,22 +75,26 @@ set_error (const gchar *format,
g_free (error);
}
@ -34,26 +45,28 @@
gboolean bind_lazy,
gboolean bind_local)
{
- HINSTANCE handle;
- wchar_t *wfilename;
#ifdef G_WITH_CYGWIN
- gchar tmp[MAX_PATH];
+#ifdef G_WITH_CYGWIN
+ gpointer handle;
- cygwin_conv_to_win32_path(file_name, tmp);
- file_name = tmp;
-#endif
+
+ handle = dlopen (file_name,
+ (bind_local ? RTLD_LOCAL : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
+ if (!handle)
+ g_module_set_error (fetch_dlerror (TRUE));
+#else
+ HINSTANCE handle;
+ wchar_t *wfilename;
HINSTANCE handle;
wchar_t *wfilename;
DWORD old_mode;
BOOL success;
-#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);
@@ -83,26 +100,44 @@ _g_module_open (const gchar *file_name,
/* suppress error dialog */
@@ -99,25 +116,43 @@ _g_module_open (const gchar *file_name,
if (!handle)
set_error ("'%s': ", file_name);
@ -84,8 +97,7 @@
}
static void
_g_module_close (gpointer handle,
gboolean is_unref)
_g_module_close (gpointer handle)
{
+#ifdef G_WITH_CYGWIN
+ if (dlclose (handle) != 0)
@ -98,7 +110,7 @@
}
static gpointer
@@ -121,8 +156,19 @@ find_in_any_module_using_toolhelp (const
@@ -152,8 +187,19 @@ find_in_any_module_using_toolhelp (const gchar *symbol_name)
if (Module32First (snapshot, &me32))
{
do {
@ -120,7 +132,7 @@
} while (Module32Next (snapshot, &me32));
}
@@ -148,6 +193,13 @@ _g_module_symbol (gpointer handle,
@@ -180,6 +226,13 @@ _g_module_symbol (gpointer handle,
{
gpointer p;
@ -134,7 +146,7 @@
if (handle == null_module_handle)
{
if ((p = GetProcAddress (GetModuleHandle (NULL), symbol_name)) == NULL)
@@ -158,6 +210,7 @@ _g_module_symbol (gpointer handle,
@@ -190,6 +243,7 @@ _g_module_symbol (gpointer handle,
if (!p)
set_error ("");
@ -142,3 +154,6 @@
return p;
}
--
2.28.0

View File

@ -2,73 +2,56 @@
pkgbase=glib2
pkgname=(glib2 glib2-devel glib2-docs)
pkgver=2.54.3
pkgrel=3
pkgver=2.64.6
pkgrel=1
pkgdesc="Common C routines used by GTK+ and other libs"
license=(LGPL2)
url="https://www.gtk.org/"
arch=('i686' 'x86_64')
makedepends=('pkg-config' 'python3' 'libxslt-devel' 'docbook-xsl' 'pcre-devel' 'libffi-devel' 'libiconv-devel' 'gamin-devel' 'gtk-doc' 'zlib-devel')
makedepends=('docbook-xsl'
'gamin-devel'
'gtk-doc'
'libffi-devel'
'libiconv-devel'
'libxslt-devel'
'pcre-devel'
'pkg-config'
'python3'
'meson'
'ninja'
'zlib-devel')
source=(https://download.gnome.org/sources/glib/${pkgver%.*}/glib-$pkgver.tar.xz
2.36.3-not-win32.patch
2.36.4-gspawn-cygwin.patch
2.42.1-goption-cygwin.patch
2.34.3-m4macros.patch
2.36.3-visibility.patch
2.36.4-gutf8-cygwin.patch
2.38.2-gconvert-cygwin.patch
2.50-gmodule-cygwin.patch
glib-2.38.1-msys2.patch)
sha256sums=('963fdc6685dc3da8e5381dfb9f15ca4b5709b28be84d9d05a9bb8e446abac0a8'
'8f37c92212a34c392066ff5b9952994550895fd6098b01d62f49139fea5b9ec1'
'5a5df4d7ca0ae2be859a80731041fd9cfe6e1a338a882702d1e7d820816d8866'
'01bb13f685ffd77c47df4609e8ab394463275d4c58013e5aaf5f7f9b6b442a7e'
'9095183f944334e2d02ca67b363d43ea7508c2b02c6e91905160786e7bccbaa7'
'23a544c39a8596dfcd59b0226a3228d04c288c2023f6069942c3a76b8397e93b'
'5016c0af3a21a03fc1a979a5de21f2116edc75c88f2980e0f2ab816eff98680b'
2.64-gmodule-cygwin-rebased.patch)
sha256sums=('c36ee07a70164c71f046016fe6aaacd6368333c42590bc0cba47c344ffb853f1'
'9054ae2ba34a12bcafa7659f9f21badbfa7aa6114657ed993818cd867ba698f4'
'45a4d5d5fdc01c38d83f7f49a9936dfe7fbaf25e0aa791f1e5c22c89a6c49d93'
'3030fe15798cef54aebaf5b8c186f2bc87e49f0385198e3e4fe9ab8a57bca1c9')
'dc7a6691f1a19c1b5c6765446d39838331126b29cad45594c100c73da737710c')
prepare() {
cd glib-${pkgver}
# Cygwin patches
patch -p2 -i ${srcdir}/2.36.3-not-win32.patch
patch -p2 -i ${srcdir}/2.36.4-gspawn-cygwin.patch
patch -p2 -i ${srcdir}/2.42.1-goption-cygwin.patch
patch -p2 -i ${srcdir}/2.34.3-m4macros.patch
patch -p2 -i ${srcdir}/2.36.3-visibility.patch
patch -p2 -i ${srcdir}/2.36.4-gutf8-cygwin.patch
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/756
patch -p2 -i ${srcdir}/2.38.2-gconvert-cygwin.patch
patch -p2 -i ${srcdir}/2.50-gmodule-cygwin.patch
# MSYS patches
patch -p1 -i ${srcdir}/glib-2.38.1-msys2.patch
libtoolize --force --copy
autoreconf -fi
# Unclear what this is about and why it's not upstrean..
# Rebased from cygwin 2.50-gmodule-cygwin.patch
patch -p1 -i ${srcdir}/2.64-gmodule-cygwin-rebased.patch
}
build() {
export lt_cv_deplibs_check_method='pass_all'
cd glib-${pkgver}
export CFLAGS="$CFLAGS -Wno-error=format-overflow"
./configure \
--build=${CHOST} \
--host=${CHOST} \
--prefix=/usr \
--disable-libelf \
--with-pcre=system \
--with-threads=posix \
--enable-shared \
--disable-static \
--disable-silent-rules \
ac_cv_header_winsock2_h=no \
ac_cv_header_mswsock_h=no
make VERBOSE=1
mkdir "${srcdir}"/build && cd "${srcdir}"/build
meson \
--buildtype=plain \
--prefix=/usr \
-Dfam=true \
-Dgtk_doc=true \
"../glib-${pkgver}"
meson compile
DESTDIR="${srcdir}/dest" meson install
make completiondir=/usr/share/bash-completion/completions DESTDIR="${srcdir}/dest" install
pushd ${srcdir}/dest/usr/share/gdb/auto-load/usr/lib > /dev/null
mv libglib* msys-glib-2.0-0.dll-gdb.py
mv libgobject* msys-gobject-2.0-0.dll-gdb.py
@ -76,8 +59,9 @@ build() {
}
check() {
cd glib-${pkgver}
#make -k check || :
cd "${srcdir}"/build
# meson test
}
package_glib2() {
@ -87,9 +71,6 @@ package_glib2() {
options=('!docs' '!emptydirs')
license=('LGPL')
#cd glib-${pkgver}
#make completiondir=/usr/share/bash-completion/completions DESTDIR="${pkgdir}" install
mkdir -p ${pkgdir}/usr/{bin,lib,share}
cp -f ${srcdir}/dest/usr/bin/*.dll ${pkgdir}/usr/bin/
for file in gapplication gdbus gio-querymodules glib-compile-schemas gobject-query gsettings; do
@ -142,6 +123,9 @@ package_glib2-devel() {
rm -rf ${pkgdir}/usr/share/glib-2.0/gdb
rm -rf ${pkgdir}/usr/share/glib-2.0/schemas
python3 -m compileall -d "/usr/share/glib-2.0/codegen" "${pkgdir}/usr/share/glib-2.0/codegen"
python3 -O -m compileall -d "/usr/share/glib-2.0/codegen" "${pkgdir}/usr/share/glib-2.0/codegen"
#mkdir -p ${pkgdir}/usr/share/man/man1
#cp -rf ${srcdir}/dest/usr/share/man/man1/gdbus-codegen* ${pkgdir}/usr/share/man/man1/
#cp -rf ${srcdir}/dest/usr/share/man/man1/glib-* ${pkgdir}/usr/share/man/man1/
@ -157,10 +141,10 @@ package_glib2-docs() {
license=('custom')
options=('docs' '!emptydirs')
mkdir -p ${pkgdir}/usr/share
cp -rf ${srcdir}/dest/usr/share/gtk-doc ${pkgdir}/usr/share
cd glib-$pkgver/docs
make DESTDIR="${pkgdir}" install
install -m755 -d "${pkgdir}/usr/share/licenses/glib2-docs"
install -m644 reference/COPYING "${pkgdir}/usr/share/licenses/glib2-docs/"
rm -rf "${pkgdir}/usr/share/man"
}

View File

@ -1,90 +0,0 @@
diff -Naur glib-2.38.1-orig/compile glib-2.38.1/compile
--- glib-2.38.1-orig/compile 2013-08-07 18:43:05.000000000 +0400
+++ glib-2.38.1/compile 2013-08-23 10:47:48.875000000 +0400
@@ -53,7 +53,7 @@
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN*|MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/*|msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
diff -Naur glib-2.38.1-orig/config.guess glib-2.38.1/config.guess
--- glib-2.38.1-orig/config.guess 2013-08-07 18:43:05.000000000 +0400
+++ glib-2.38.1/config.guess 2013-08-23 10:48:19.218750000 +0400
@@ -866,6 +866,9 @@
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
+ amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+ echo x86_64-unknown-msys
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
--- glib-2.42.0/configure.ac.orig 2014-09-26 10:16:30.460314900 +0900
+++ glib-2.42.0/configure.ac 2014-09-26 10:18:01.902282100 +0900
@@ -1459,7 +1459,7 @@
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*|*-*-cygwin*|*-*-msys*) G_MODULE_IMPL=G_MODULE_IMPL_WIN32 ;;
esac
fi
dnl *** force native AIX library loader
@@ -1834,7 +1834,7 @@
AC_MSG_CHECKING([whether to compile timeloop])
case "$host" in
- *-*-cygwin*|*-*-mingw*|*-*-minix)
+ *-*-cygwin*|*-*-msys*|*-*-mingw*|*-*-minix)
enable_timeloop=no
;;
*)
@@ -1846,7 +1846,7 @@
AC_MSG_CHECKING([if building for some Win32 platform])
case "$host" in
- *-*-mingw*|*-*-cygwin*)
+ *-*-mingw*|*-*-cygwin*|*-*-msys*)
platform_win32=yes
;;
*)
@@ -1962,7 +1962,7 @@
# One of them does for most gcc versions and some other platforms/compilers
# too and could be considered as the canonical way to go.
case $host in
- *-*-cygwin*|*-*-darwin*)
+ *-*-cygwin*|*-*-msys*|*-*-darwin*)
# skip cygwin and darwin -pthread or -pthreads test
;;
*-solaris*)
@@ -3360,7 +3360,7 @@
g_pid_type="$glib_pid_type"
case $host in
- *-*-cygwin*)
+ *-*-cygwin* | *-*-msys*)
glib_os="#define G_OS_UNIX
#define G_PLATFORM_WIN32
#define G_WITH_CYGWIN"
@@ -3496,7 +3496,7 @@
dnl
GLIB_HIDDEN_VISIBILITY_CFLAGS=""
case "$host" in
- *-*-cygwin*|*-*-mingw*)
+ *-*-cygwin*|*-*-msys*|*-*-mingw*)
dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
AC_DEFINE([_GLIB_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
[defines how to decorate public symbols while building])