1 These patches are currently required to get a properly working
2 MXE setup for sigrok usage.
4 - libsigrok currently requires a special libusb branch.
6 - We're reverting to glib 2.44.1 for now since more recent
7 versions (e.g. 2.50.2) seem to have a bug. Details:
8 https://sigrok.org/bugzilla/show_bug.cgi?id=1232
9 https://github.com/mxe/mxe/issues/2168
11 - We're patching glib to fix various MinGW compiler warnings. Details:
12 https://sigrok.org/bugzilla/show_bug.cgi?id=986
13 https://gitlab.gnome.org/GNOME/glib/commit/3d7cde654c4c6f3bdad32f5521f28f5802a7c377
15 diff --git a/src/libusb1.mk b/src/libusb1.mk
16 index 358d0f3c..2f97246e 100644
19 @@ -5,10 +5,10 @@ $(PKG)_WEBSITE := https://libusb.info/
20 $(PKG)_DESCR := LibUsb-1.0
22 $(PKG)_VERSION := 1.0.21
23 -$(PKG)_CHECKSUM := 7dce9cce9a81194b7065ee912bcd55eeffebab694ea403ffb91b67db66b1824b
24 -$(PKG)_SUBDIR := libusb-$($(PKG)_VERSION)
25 -$(PKG)_FILE := libusb-$($(PKG)_VERSION).tar.bz2
26 -$(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/libusb/libusb-1.0/libusb-$($(PKG)_VERSION)/$($(PKG)_FILE)
27 +$(PKG)_CHECKSUM := 58fee7f3f05fda209d14c55763df36ab86028bd9ab82c9bb74f1d5ab3208bcfd
28 +$(PKG)_SUBDIR := libusb-event-abstraction-v4
29 +$(PKG)_FILE := libusb-event-abstraction-v4.zip
30 +$(PKG)_URL := https://github.com/dickens/libusb/archive/event-abstraction-v4.zip
34 @@ -19,7 +19,7 @@ define $(PKG)_UPDATE
38 - cd '$(1)' && ./configure \
39 + cd '$(1)' && autoreconf -i && ./configure \
40 $(MXE_CONFIGURE_OPTS) \
41 CFLAGS=-D_WIN32_WINNT=0x0500
42 $(MAKE) -C '$(1)' -j '$(JOBS)' install
43 diff --git a/src/glib-1-fixes.patch b/src/glib-1-fixes.patch
44 index 021a5cac..428cc6a9 100644
45 --- a/src/glib-1-fixes.patch
46 +++ b/src/glib-1-fixes.patch
47 @@ -5,7 +5,7 @@ Contains ad hoc patches for cross building.
48 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
49 From: Mark Brand <mabrand@mabrand.nl>
50 Date: Thu, 23 Sep 2010 21:42:46 +0200
51 -Subject: [PATCH 1/9] fix tool paths
52 +Subject: [PATCH] fix tool paths
55 diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in
56 @@ -29,17 +29,14 @@ index 1111111..2222222 100644
57 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
58 From: Hans Petter Jansson <hpj@cl.no>
59 Date: Fri, 15 Jun 2012 15:25:01 +0200
60 -Subject: [PATCH 2/9] Avoid DllMain symbol conflict when linking statically
61 +Subject: [PATCH] Avoid DllMain symbol conflict when linking statically
63 -Adjusted by Boris Nagaev on 29-Jan-2017 to fix
64 -https://gist.github.com/starius/f4fc85939352cb50122ba29e0f5b140d
65 -when updating to glib-2.50.2.
67 diff --git a/gio/giomodule.c b/gio/giomodule.c
68 index 1111111..2222222 100644
71 -@@ -928,14 +928,12 @@ extern GType g_cocoa_notification_backend_get_type (void);
72 +@@ -918,14 +918,12 @@ extern GType g_gtk_notification_backend_get_type (void);
74 static HMODULE gio_dll = NULL;
76 @@ -56,7 +53,7 @@ index 1111111..2222222 100644
80 -@@ -945,8 +943,6 @@ DllMain (HINSTANCE hinstDLL,
81 +@@ -935,8 +933,6 @@ DllMain (HINSTANCE hinstDLL,
85 @@ -69,7 +66,7 @@ diff --git a/glib/glib-init.c b/glib/glib-init.c
86 index 1111111..2222222 100644
87 --- a/glib/glib-init.c
88 +++ b/glib/glib-init.c
89 -@@ -245,14 +245,14 @@ glib_init (void)
90 +@@ -237,14 +237,14 @@ glib_init (void)
92 #if defined (G_OS_WIN32)
94 @@ -86,31 +83,18 @@ index 1111111..2222222 100644
98 -diff --git a/gobject/gtype.c b/gobject/gtype.c
99 -index 1111111..2222222 100644
100 ---- a/gobject/gtype.c
101 -+++ b/gobject/gtype.c
102 -@@ -4450,7 +4450,7 @@ gobject_init (void)
106 --#if defined (G_OS_WIN32)
109 - BOOL WINAPI DllMain (HINSTANCE hinstDLL,
112 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
113 From: Hans Petter Jansson <hpj@cl.no>
114 Date: Fri, 15 Jun 2012 15:27:22 +0200
115 -Subject: [PATCH 3/9] Allow building without inotify support
116 +Subject: [PATCH] Allow building without inotify support
119 diff --git a/configure.ac b/configure.ac
120 index 1111111..2222222 100644
123 -@@ -1599,10 +1599,16 @@ dnl *****************************
124 +@@ -1659,10 +1659,16 @@ dnl *****************************
125 dnl ** Check for inotify (GIO) **
126 dnl *****************************
128 @@ -131,7 +115,7 @@ index 1111111..2222222 100644
129 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
130 From: Hans Petter Jansson <hpj@cl.no>
131 Date: Fri, 15 Jun 2012 15:28:14 +0200
132 -Subject: [PATCH 4/9] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
133 +Subject: [PATCH] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
134 Backported from upstream
137 @@ -139,7 +123,7 @@ diff --git a/configure.ac b/configure.ac
138 index 1111111..2222222 100644
141 -@@ -511,6 +511,8 @@ LT_INIT([disable-static win32-dll])
142 +@@ -499,6 +499,8 @@ LT_INIT([disable-static win32-dll])
143 dnl when using libtool 2.x create libtool early, because it's used in configure
144 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
146 @@ -152,7 +136,7 @@ index 1111111..2222222 100644
147 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
148 From: Hans Petter Jansson <hpj@cl.no>
149 Date: Fri, 15 Jun 2012 15:29:06 +0200
150 -Subject: [PATCH 5/9] Link with dnsapi
151 +Subject: [PATCH] Link with dnsapi
154 diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
155 @@ -171,15 +155,15 @@ index 1111111..2222222 100644
156 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
157 From: Hans Petter Jansson <hpj@cl.no>
158 Date: Fri, 15 Jun 2012 15:29:38 +0200
159 -Subject: [PATCH 6/9] Ensure globals are initialized even when DllMain is not
161 +Subject: [PATCH] Ensure globals are initialized even when DllMain is not being
165 diff --git a/glib/gmain.c b/glib/gmain.c
166 index 1111111..2222222 100644
169 -@@ -2657,12 +2657,15 @@ g_get_real_time (void)
170 +@@ -2577,12 +2577,15 @@ g_get_real_time (void)
171 #if defined (G_OS_WIN32)
172 static ULONGLONG (*g_GetTickCount64) (void) = NULL;
173 static guint32 g_win32_tick_epoch = 0;
174 @@ -195,7 +179,7 @@ index 1111111..2222222 100644
175 g_GetTickCount64 = NULL;
176 kernel32 = GetModuleHandle ("KERNEL32.DLL");
177 if (kernel32 != NULL)
178 -@@ -2721,6 +2724,9 @@ g_get_monotonic_time (void)
179 +@@ -2641,6 +2644,9 @@ g_get_monotonic_time (void)
180 * timeBeginPeriod() to increase it as much as they want
183 @@ -535,7 +519,7 @@ index 1111111..2222222 100644
184 win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE));
187 -@@ -1041,6 +1145,8 @@ g_thread_lookup_native_funcs (void)
188 +@@ -984,6 +1088,8 @@ g_thread_lookup_native_funcs (void)
190 g_thread_win32_init (void)
192 @@ -548,7 +532,7 @@ index 1111111..2222222 100644
193 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
194 From: Gerardo Ballabio <gerardo.ballabio@gmail.com>
195 Date: Sun, 16 Aug 2015 13:18:24 +0200
196 -Subject: [PATCH 7/9] Remove an annoying runtime warning
197 +Subject: [PATCH] Remove an annoying runtime warning
199 that pops up when using GtkApplication in Gtk+ 3 programs.
201 @@ -556,7 +540,7 @@ diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
202 index 1111111..2222222 100644
203 --- a/gio/gdbusaddress.c
204 +++ b/gio/gdbusaddress.c
205 -@@ -1387,6 +1387,7 @@ __declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANC
206 +@@ -1325,6 +1325,7 @@ __declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANC
207 __declspec(dllexport) void CALLBACK
208 g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow)
210 @@ -564,7 +548,7 @@ index 1111111..2222222 100644
214 -@@ -1418,6 +1419,7 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
215 +@@ -1354,6 +1355,7 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
217 g_main_loop_unref (loop);
218 g_object_unref (daemon);
219 @@ -576,7 +560,7 @@ index 1111111..2222222 100644
220 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
221 From: aquiles2k <aj@elane2k.com>
222 Date: Wed, 6 Apr 2016 22:39:53 +0300
223 -Subject: [PATCH 8/9] fix error "won't overwrite defined macro" on OSX
224 +Subject: [PATCH] fix error "won't overwrite defined macro" on OSX
226 See https://github.com/mxe/mxe/issues/1281
228 @@ -596,48 +580,22 @@ index 1111111..2222222 100644
229 dnl At the end, if we're not within glib, we'll define the public
230 dnl definitions in terms of our private definitions.
232 -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
233 -From: Tony Theodore <tonyt@logyst.com>
234 -Date: Mon, 26 Feb 2018 16:09:53 +1100
235 -Subject: [PATCH 9/9] darwin: disable g_cocoa_notification_backend
237 +From: Boris Pek <tehnick-8@mail.ru>
238 +Date: Thu, 28 Apr 2016 16:48:12 +0300
239 +Subject: [PATCH] fix build with GCC >= 6.x
241 -diff --git a/gio/Makefile.am b/gio/Makefile.am
242 -index 1111111..2222222 100644
243 ---- a/gio/Makefile.am
244 -+++ b/gio/Makefile.am
245 -@@ -279,10 +279,6 @@ unix_sources = \
247 - appinfo_sources += $(unix_appinfo_sources)
250 --unix_sources += gcocoanotificationbackend.c
253 - giounixincludedir=$(includedir)/gio-unix-2.0/gio
254 - giounixinclude_HEADERS = \
255 - gdesktopappinfo.h \
256 -diff --git a/gio/giomodule.c b/gio/giomodule.c
257 -index 1111111..2222222 100644
258 ---- a/gio/giomodule.c
259 -+++ b/gio/giomodule.c
260 -@@ -918,9 +918,6 @@ extern GType g_proxy_resolver_portal_get_type (void);
261 - extern GType g_network_monitor_portal_get_type (void);
265 --extern GType g_cocoa_notification_backend_get_type (void);
267 +See plugins/gcc6/README.md
269 +diff --git a/gio/gregistrysettingsbackend.c b/gio/gregistrysettingsbackend.c
270 +--- a/gio/gregistrysettingsbackend.c
271 ++++ b/gio/gregistrysettingsbackend.c
273 + if (result_code == ERROR_KEY_DELETED)
274 + trace ("(%s)", win32_message);
276 +- g_message (win32_message);
277 ++ g_message ("%s", win32_message);
280 - #ifdef G_PLATFORM_WIN32
282 -@@ -1117,9 +1114,6 @@ _g_io_modules_ensure_loaded (void)
283 - g_type_ensure (g_network_monitor_portal_get_type ());
284 - g_type_ensure (g_proxy_resolver_portal_get_type ());
287 -- g_type_ensure (g_cocoa_notification_backend_get_type ());
290 - g_type_ensure (_g_winhttp_vfs_get_type ());
292 diff --git a/src/glib-2-format.patch b/src/glib-2-format.patch
294 index 00000000..3d594af0
296 +++ b/src/glib-2-format.patch
298 +--- a/configure.ac.orig 2018-10-03 16:23:45.065890113 +0200
299 ++++ b/configure.ac 2018-10-03 16:28:04.378188119 +0200
300 +@@ -562,7 +562,7 @@ AS_IF([test x$glib_native_win32 != xyes
301 + # long long is a 64 bit integer.
302 + AC_MSG_CHECKING(for format to printf and scanf a guint64)
303 + AC_CACHE_VAL(glib_cv_long_long_format,[
304 +- for format in ll q I64; do
305 ++ for format in ll q; do
306 + AC_TRY_RUN([#include <stdio.h>
309 +@@ -588,7 +588,7 @@ AS_IF([test x$glib_native_win32 != xyes
310 + # __int64 is a 64 bit integer.
311 + AC_MSG_CHECKING(for format to printf and scanf a guint64)
312 + # We know this is MSVCRT.DLL, and what the formats are
313 +- glib_cv_long_long_format=I64
314 ++ glib_cv_long_long_format=ll
315 + AC_MSG_RESULT(%${glib_cv_long_long_format}u)
316 + AC_DEFINE(HAVE_LONG_LONG_FORMAT,1,[define if system printf can print long long])
317 + AC_DEFINE(HAVE_INT64_AND_I64,1,[define to support printing 64-bit integers with format I64])
318 +@@ -3176,8 +3176,8 @@ $ac_cv_sizeof___int64)
319 + guint64_format='"'$glib_cv_long_long_format'u"'
322 +- gint64_constant='(val##i64)'
323 +- guint64_constant='(val##ui64)'
324 ++ gint64_constant='(val##ll)'
325 ++ guint64_constant='(val##ull)'
328 + glib_size_t=$ac_cv_sizeof_size_t
329 +@@ -3204,8 +3204,8 @@ long)
330 + glib_msize_type='LONG'
332 + "long long"|__int64)
333 +- gsize_modifier='"I64"'
334 +- gsize_format='"I64u"'
335 ++ gsize_modifier='"ll"'
336 ++ gsize_format='"llu"'
337 + glib_msize_type='INT64'
340 +@@ -3227,8 +3227,8 @@ long)
341 + glib_mssize_type='LONG'
343 + "long long"|__int64)
344 +- gssize_modifier='"I64"'
345 +- gssize_format='"I64i"'
346 ++ gssize_modifier='"ll"'
347 ++ gssize_format='"lli"'
348 + glib_mssize_type='INT64'
351 +@@ -3257,17 +3257,17 @@ $ac_cv_sizeof_long)
353 + $ac_cv_sizeof_long_long)
354 + glib_intptr_type_define='long long'
355 +- gintptr_modifier='"I64"'
356 +- gintptr_format='"I64i"'
357 +- guintptr_format='"I64u"'
358 ++ gintptr_modifier='"ll"'
359 ++ gintptr_format='"lli"'
360 ++ guintptr_format='"llu"'
361 + glib_gpi_cast='(gint64)'
362 + glib_gpui_cast='(guint64)'
364 + $ac_cv_sizeof___int64)
365 + glib_intptr_type_define=__int64
366 +- gintptr_modifier='"I64"'
367 +- gintptr_format='"I64i"'
368 +- guintptr_format='"I64u"'
369 ++ gintptr_modifier='"ll"'
370 ++ gintptr_format='"lli"'
371 ++ guintptr_format='"llu"'
372 + glib_gpi_cast='(gint64)'
373 + glib_gpui_cast='(guint64)'
375 diff --git a/src/glib.mk b/src/glib.mk
376 index 825b86bb..499a45b8 100644
381 $(PKG)_WEBSITE := https://gtk.org/
384 -$(PKG)_VERSION := 2.50.2
385 -$(PKG)_CHECKSUM := be68737c1f268c05493e503b3b654d2b7f43d7d0b8c5556f7e4651b870acfbf5
387 +$(PKG)_VERSION := 2.44.1
388 +$(PKG)_CHECKSUM := 8811deacaf8a503d0a9b701777ea079ca6a4277be10e3d730d2112735d5eca07
389 $(PKG)_SUBDIR := glib-$($(PKG)_VERSION)
390 $(PKG)_FILE := glib-$($(PKG)_VERSION).tar.xz
391 $(PKG)_URL := https://download.gnome.org/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE)
392 @@ -27,6 +27,7 @@ define $(PKG)_BUILD_DARWIN
393 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
394 $(MXE_CONFIGURE_OPTS) \
396 + --disable-compile-warnings \
400 @@ -55,6 +56,7 @@ define $(PKG)_BUILD_NATIVE
401 cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
402 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
403 $(MXE_CONFIGURE_OPTS) \
404 + --disable-compile-warnings \
408 @@ -97,6 +99,7 @@ define $(PKG)_BUILD
409 cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
410 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
411 $(MXE_CONFIGURE_OPTS) \
412 + --disable-compile-warnings \
413 --with-threads=win32 \
415 --with-libiconv=gnu \