changeset 5734:56df28fdf14f

glib: Update to version 2.58.0 * src/glib.mk: Update version and checksum. Disable compilation error on compiler warnings. * src/glib-1-fixes.patch: Rebase part of patch that no longer applied. IIUC, this is the last stable release that can be build with the autotools toolchain. Newer versions will require a rewrite of the build rules. Afaics, we need glib only to build gnuplot at the moment.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 12 Apr 2021 18:43:03 +0200
parents ac2d180a1a47
children 17b6cba7f38e
files src/glib-1-fixes.patch src/glib.mk
diffstat 2 files changed, 53 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/src/glib-1-fixes.patch	Mon Apr 12 10:51:50 2021 +0200
+++ b/src/glib-1-fixes.patch	Mon Apr 12 18:43:03 2021 +0200
@@ -209,43 +209,35 @@
 index 1111111..2222222 100644
 --- a/glib/gthread-win32.c
 +++ b/glib/gthread-win32.c
-@@ -116,18 +116,28 @@ typedef struct
-   void     (__stdcall * WakeConditionVariable)       (gpointer cond);
- } GThreadImplVtable;
- 
+@@ -60,6 +60,10 @@ g_thread_abort (gint         status,
+            strerror (status), function);
+   g_abort ();
+ }
 +/* Needed for static builds where DllMain initializer doesn't get called */
 +static gboolean g_threads_is_initialized;
 +G_GNUC_INTERNAL void g_thread_win32_init (void);
 +
- static GThreadImplVtable g_thread_impl_vtable;
  
- /* {{{1 GMutex */
+ /* Starting with Vista and Windows 2008, we have access to the
+  * CONDITION_VARIABLE and SRWLock primatives on Windows, which are
+@@ -79,6 +83,9 @@ g_thread_abort (gint         status,
  void
  g_mutex_init (GMutex *mutex)
  {
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.InitializeSRWLock (mutex);
+   InitializeSRWLock ((gpointer) mutex);
  }
  
- void
- g_mutex_clear (GMutex *mutex)
- {
-+  if (!g_threads_is_initialized)
-+    g_thread_win32_init ();
-+
-   if (g_thread_impl_vtable.DeleteSRWLock != NULL)
-     g_thread_impl_vtable.DeleteSRWLock (mutex);
- }
-@@ -135,18 +145,27 @@ g_mutex_clear (GMutex *mutex)
+@@ -90,18 +97,27 @@ g_mutex_clear (GMutex *mutex)
  void
  g_mutex_lock (GMutex *mutex)
  {
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.AcquireSRWLockExclusive (mutex);
+   AcquireSRWLockExclusive ((gpointer) mutex);
  }
  
  gboolean
@@ -254,7 +246,7 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   return g_thread_impl_vtable.TryAcquireSRWLockExclusive (mutex);
+   return TryAcquireSRWLockExclusive ((gpointer) mutex);
  }
  
  void
@@ -263,10 +255,10 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.ReleaseSRWLockExclusive (mutex);
+   ReleaseSRWLockExclusive ((gpointer) mutex);
  }
  
-@@ -157,6 +176,9 @@ g_rec_mutex_impl_new (void)
+@@ -112,6 +128,9 @@ g_rec_mutex_impl_new (void)
  {
    CRITICAL_SECTION *cs;
  
@@ -276,7 +268,7 @@
    cs = g_slice_new (CRITICAL_SECTION);
    InitializeCriticalSection (cs);
  
-@@ -167,6 +189,10 @@ static void
+@@ -122,6 +141,10 @@ static void
  g_rec_mutex_impl_free (CRITICAL_SECTION *cs)
  {
    DeleteCriticalSection (cs);
@@ -287,7 +279,7 @@
    g_slice_free (CRITICAL_SECTION, cs);
  }
  
-@@ -175,6 +201,9 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
+@@ -130,6 +153,9 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
  {
    CRITICAL_SECTION *impl = mutex->p;
  
@@ -297,7 +289,7 @@
    if G_UNLIKELY (mutex->p == NULL)
      {
        impl = g_rec_mutex_impl_new ();
-@@ -189,30 +218,45 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
+@@ -144,30 +170,45 @@ g_rec_mutex_get_impl (GRecMutex *mutex)
  void
  g_rec_mutex_init (GRecMutex *mutex)
  {
@@ -343,33 +335,24 @@
    return TryEnterCriticalSection (g_rec_mutex_get_impl (mutex));
  }
  
-@@ -221,12 +265,18 @@ g_rec_mutex_trylock (GRecMutex *mutex)
+@@ -176,6 +217,9 @@ g_rec_mutex_trylock (GRecMutex *mutex)
  void
  g_rw_lock_init (GRWLock *lock)
  {
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.InitializeSRWLock (lock);
+   InitializeSRWLock ((gpointer) lock);
  }
  
- void
- g_rw_lock_clear (GRWLock *lock)
- {
-+  if (!g_threads_is_initialized)
-+    g_thread_win32_init ();
-+
-   if (g_thread_impl_vtable.DeleteSRWLock != NULL)
-     g_thread_impl_vtable.DeleteSRWLock (lock);
- }
-@@ -234,36 +284,54 @@ g_rw_lock_clear (GRWLock *lock)
+@@ -187,36 +231,54 @@ g_rw_lock_clear (GRWLock *lock)
  void
  g_rw_lock_writer_lock (GRWLock *lock)
  {
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.AcquireSRWLockExclusive (lock);
+   AcquireSRWLockExclusive ((gpointer) lock);
  }
  
  gboolean
@@ -378,7 +361,7 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   return g_thread_impl_vtable.TryAcquireSRWLockExclusive (lock);
+   return TryAcquireSRWLockExclusive ((gpointer) lock);
  }
  
  void
@@ -387,7 +370,7 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.ReleaseSRWLockExclusive (lock);
+   ReleaseSRWLockExclusive ((gpointer) lock);
  }
  
  void
@@ -396,7 +379,7 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.AcquireSRWLockShared (lock);
+   AcquireSRWLockShared ((gpointer) lock);
  }
  
  gboolean
@@ -405,7 +388,7 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   return g_thread_impl_vtable.TryAcquireSRWLockShared (lock);
+   return TryAcquireSRWLockShared ((gpointer) lock);
  }
  
  void
@@ -414,36 +397,27 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.ReleaseSRWLockShared (lock);
+   ReleaseSRWLockShared ((gpointer) lock);
  }
  
-@@ -271,12 +339,18 @@ g_rw_lock_reader_unlock (GRWLock *lock)
+@@ -224,6 +286,9 @@ g_rw_lock_reader_unlock (GRWLock *lock)
  void
  g_cond_init (GCond *cond)
  {
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.InitializeConditionVariable (cond);
+   InitializeConditionVariable ((gpointer) cond);
  }
  
- void
- g_cond_clear (GCond *cond)
- {
-+  if (!g_threads_is_initialized)
-+    g_thread_win32_init ();
-+
-   if (g_thread_impl_vtable.DeleteConditionVariable)
-     g_thread_impl_vtable.DeleteConditionVariable (cond);
- }
-@@ -284,12 +358,18 @@ g_cond_clear (GCond *cond)
+@@ -235,12 +300,18 @@ g_cond_clear (GCond *cond)
  void
  g_cond_signal (GCond *cond)
  {
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.WakeConditionVariable (cond);
+   WakeConditionVariable ((gpointer) cond);
  }
  
  void
@@ -452,30 +426,30 @@
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.WakeAllConditionVariable (cond);
+   WakeAllConditionVariable ((gpointer) cond);
  }
  
-@@ -297,6 +377,9 @@ void
+@@ -248,6 +319,9 @@ void
  g_cond_wait (GCond  *cond,
               GMutex *entered_mutex)
  {
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   g_thread_impl_vtable.SleepConditionVariableSRW (cond, entered_mutex, INFINITE, 0);
+   SleepConditionVariableSRW ((gpointer) cond, (gpointer) entered_mutex, INFINITE, 0);
  }
  
-@@ -307,6 +390,9 @@ g_cond_wait_until (GCond  *cond,
- {
-   gint64 span;
+@@ -260,6 +334,9 @@ g_cond_wait_until (GCond  *cond,
+   DWORD span_millis;
+   gboolean signalled;
  
 +  if (!g_threads_is_initialized)
 +    g_thread_win32_init ();
 +
-   span = end_time - g_get_monotonic_time ();
- 
-   if G_UNLIKELY (span < 0)
-@@ -339,6 +425,9 @@ g_private_get_impl (GPrivate *key)
+   start_time = g_get_monotonic_time ();
+   do
+     {
+@@ -311,6 +388,9 @@ g_private_get_impl (GPrivate *key)
  
    if G_UNLIKELY (impl == 0)
      {
@@ -485,7 +459,7 @@
        EnterCriticalSection (&g_private_lock);
        impl = (DWORD) key->p;
        if (impl == 0)
-@@ -432,6 +521,9 @@ g_system_thread_free (GRealThread *thread)
+@@ -404,6 +484,9 @@ g_system_thread_free (GRealThread *thread)
  {
    GThreadWin32 *wt = (GThreadWin32 *) thread;
  
@@ -495,7 +469,7 @@
    win32_check_for_error (CloseHandle (wt->handle));
    g_slice_free (GThreadWin32, wt);
  }
-@@ -439,6 +531,9 @@ g_system_thread_free (GRealThread *thread)
+@@ -411,6 +494,9 @@ g_system_thread_free (GRealThread *thread)
  void
  g_system_thread_exit (void)
  {
@@ -505,7 +479,7 @@
    _endthreadex (0);
  }
  
-@@ -447,6 +542,9 @@ g_thread_win32_proxy (gpointer data)
+@@ -419,6 +505,9 @@ g_thread_win32_proxy (gpointer data)
  {
    GThreadWin32 *self = data;
  
@@ -515,7 +489,7 @@
    self->proxy (self);
  
    g_system_thread_exit ();
-@@ -464,6 +562,9 @@ g_system_thread_new (GThreadFunc   func,
+@@ -436,6 +525,9 @@ g_system_thread_new (GThreadFunc   func,
    GThreadWin32 *thread;
    guint ignore;
  
@@ -525,7 +499,7 @@
    thread = g_slice_new0 (GThreadWin32);
    thread->proxy = func;
  
-@@ -493,6 +594,9 @@ g_system_thread_wait (GRealThread *thread)
+@@ -465,6 +557,9 @@ g_system_thread_wait (GRealThread *thread)
  {
    GThreadWin32 *wt = (GThreadWin32 *) thread;
  
@@ -535,15 +509,16 @@
    win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE));
  }
  
-@@ -1041,6 +1145,8 @@ g_thread_lookup_native_funcs (void)
+@@ -536,6 +631,8 @@ g_system_thread_set_name (const gchar *name)
  void
  g_thread_win32_init (void)
  {
 +  g_threads_is_initialized = TRUE;
 +
-   if (!g_thread_lookup_native_funcs ())
-     g_thread_xp_init ();
+   InitializeCriticalSection (&g_private_lock);
  
+ #ifndef _MSC_VER
+
 
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 From: Gerardo Ballabio <gerardo.ballabio@gmail.com>
--- a/src/glib.mk	Mon Apr 12 10:51:50 2021 +0200
+++ b/src/glib.mk	Mon Apr 12 18:43:03 2021 +0200
@@ -3,8 +3,8 @@
 
 PKG             := glib
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 2.54.0
-$(PKG)_CHECKSUM := 96b434a9ca142344b93f38ed0cd88d36196b68ae
+$(PKG)_VERSION  := 2.58.0
+$(PKG)_CHECKSUM := c00e433c56e0ba3541abc5222aeca4136de10fb8
 $(PKG)_SUBDIR   := glib-$($(PKG)_VERSION)
 $(PKG)_FILE     := glib-$($(PKG)_VERSION).tar.xz
 $(PKG)_URL      := http://ftp.gnome.org/pub/gnome/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE)
@@ -41,7 +41,8 @@
         --disable-libmount \
         --with-libiconv=gnu \
         --with-pcre=internal \
-	&& $(CONFIGURE_POST_HOOK)
+        --disable-compile-warnings \
+        && $(CONFIGURE_POST_HOOK)
 
     $(SED) -i 's,#define G_ATOMIC.*,,' '$(1)/config.h'
     $(MAKE) -C '$(1)/glib'    -j '$(JOBS)'
@@ -68,6 +69,7 @@
         --with-pcre=system \
         --with-libiconv=gnu \
         --disable-inotify \
+        --disable-compile-warnings \
         PKG_CONFIG='$(MXE_PKG_CONFIG)' \
         PKG_CONFIG_PATH='$(PKG_CONFIG_PATH)'