]> sigrok.org Git - sigrok-util.git/blame - cross-compile/mingw/mxe_fixes.patch
sigrok-native-msys2: Update README.
[sigrok-util.git] / cross-compile / mingw / mxe_fixes.patch
CommitLineData
b9d1ce76
UH
1These patches are currently required to get a properly working
2MXE setup for sigrok usage.
3
4e20cf8f
UH
4 - libsigrok currently requires a special libusb branch.
5
b9d1ce76
UH
6 - Force libzip to use its own mkstemp() implementation.
7 http://sigrok.org/bugzilla/show_bug.cgi?id=570#c2
8
8cf06ef3
UH
9 - We're reverting to glib 2.44.1 for now since more recent
10 versions (e.g. 2.50.2) seem to have a bug. Details:
11 https://sigrok.org/bugzilla/show_bug.cgi?id=1232
12 https://github.com/mxe/mxe/issues/2168
13
4e20cf8f
UH
14diff --git a/src/libusb1.mk b/src/libusb1.mk
15index 0b58dff3..281a1169 100644
16--- a/src/libusb1.mk
17+++ b/src/libusb1.mk
18@@ -5,10 +5,10 @@ $(PKG)_WEBSITE := http://libusb.org/
19 $(PKG)_DESCR := LibUsb-1.0
20 $(PKG)_IGNORE :=
21 $(PKG)_VERSION := 1.0.21
22-$(PKG)_CHECKSUM := 7dce9cce9a81194b7065ee912bcd55eeffebab694ea403ffb91b67db66b1824b
23-$(PKG)_SUBDIR := libusb-$($(PKG)_VERSION)
24-$(PKG)_FILE := libusb-$($(PKG)_VERSION).tar.bz2
25-$(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/libusb/libusb-1.0/libusb-$($(PKG)_VERSION)/$($(PKG)_FILE)
26+$(PKG)_CHECKSUM := 58fee7f3f05fda209d14c55763df36ab86028bd9ab82c9bb74f1d5ab3208bcfd
27+$(PKG)_SUBDIR := libusb-event-abstraction-v4
28+$(PKG)_FILE := libusb-event-abstraction-v4.zip
29+$(PKG)_URL := https://github.com/dickens/libusb/archive/event-abstraction-v4.zip
30 $(PKG)_DEPS := cc
31
32 define $(PKG)_UPDATE
33@@ -19,7 +19,7 @@ define $(PKG)_UPDATE
34 endef
35
36 define $(PKG)_BUILD
37- cd '$(1)' && ./configure \
38+ cd '$(1)' && autoreconf -i && ./configure \
39 $(MXE_CONFIGURE_OPTS) \
40 CFLAGS=-D_WIN32_WINNT=0x0500
41 $(MAKE) -C '$(1)' -j '$(JOBS)' install
b9d1ce76 42diff --git a/src/libzip.mk b/src/libzip.mk
4e20cf8f 43index 28ea792c..ee1bcfbe 100644
b9d1ce76
UH
44--- a/src/libzip.mk
45+++ b/src/libzip.mk
46@@ -18,7 +18,8 @@ endef
47
48 define $(PKG)_BUILD
49 cd '$(1)' && ./configure \
50- $(MXE_CONFIGURE_OPTS)
51+ $(MXE_CONFIGURE_OPTS) \
4acee7ed 52+ ac_cv_func_mkstemp=no
b9d1ce76
UH
53 $(MAKE) -C '$(1)' -j '$(JOBS)' install $(MXE_DISABLE_CRUFT) SUBDIRS=lib
54
55 '$(TARGET)-gcc' \
8cf06ef3
UH
56diff --git a/src/glib-1-fixes.patch b/src/glib-1-fixes.patch
57index 021a5cac..428cc6a9 100644
58--- a/src/glib-1-fixes.patch
59+++ b/src/glib-1-fixes.patch
60@@ -5,7 +5,7 @@ Contains ad hoc patches for cross building.
61 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
62 From: Mark Brand <mabrand@mabrand.nl>
63 Date: Thu, 23 Sep 2010 21:42:46 +0200
64-Subject: [PATCH 1/9] fix tool paths
65+Subject: [PATCH] fix tool paths
66
67
68 diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in
69@@ -29,17 +29,14 @@ index 1111111..2222222 100644
70 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
71 From: Hans Petter Jansson <hpj@cl.no>
72 Date: Fri, 15 Jun 2012 15:25:01 +0200
73-Subject: [PATCH 2/9] Avoid DllMain symbol conflict when linking statically
74+Subject: [PATCH] Avoid DllMain symbol conflict when linking statically
75
76-Adjusted by Boris Nagaev on 29-Jan-2017 to fix
77-https://gist.github.com/starius/f4fc85939352cb50122ba29e0f5b140d
78-when updating to glib-2.50.2.
79
80 diff --git a/gio/giomodule.c b/gio/giomodule.c
81 index 1111111..2222222 100644
82 --- a/gio/giomodule.c
83 +++ b/gio/giomodule.c
84-@@ -928,14 +928,12 @@ extern GType g_cocoa_notification_backend_get_type (void);
85+@@ -918,14 +918,12 @@ extern GType g_gtk_notification_backend_get_type (void);
86
87 static HMODULE gio_dll = NULL;
88
89@@ -56,7 +53,7 @@ index 1111111..2222222 100644
90 DWORD fdwReason,
91 LPVOID lpvReserved)
92 {
93-@@ -945,8 +943,6 @@ DllMain (HINSTANCE hinstDLL,
94+@@ -935,8 +933,6 @@ DllMain (HINSTANCE hinstDLL,
95 return TRUE;
96 }
97
98@@ -69,7 +66,7 @@ diff --git a/glib/glib-init.c b/glib/glib-init.c
99 index 1111111..2222222 100644
100 --- a/glib/glib-init.c
101 +++ b/glib/glib-init.c
102-@@ -245,14 +245,14 @@ glib_init (void)
103+@@ -237,14 +237,14 @@ glib_init (void)
104
105 #if defined (G_OS_WIN32)
106
107@@ -86,31 +83,18 @@ index 1111111..2222222 100644
108 DWORD fdwReason,
109 LPVOID lpvReserved)
110 {
111-diff --git a/gobject/gtype.c b/gobject/gtype.c
112-index 1111111..2222222 100644
113---- a/gobject/gtype.c
114-+++ b/gobject/gtype.c
115-@@ -4450,7 +4450,7 @@ gobject_init (void)
116- _g_signal_init ();
117- }
118-
119--#if defined (G_OS_WIN32)
120-+#if 0
121-
122- BOOL WINAPI DllMain (HINSTANCE hinstDLL,
123- DWORD fdwReason,
124
125 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
126 From: Hans Petter Jansson <hpj@cl.no>
127 Date: Fri, 15 Jun 2012 15:27:22 +0200
128-Subject: [PATCH 3/9] Allow building without inotify support
129+Subject: [PATCH] Allow building without inotify support
130
131
132 diff --git a/configure.ac b/configure.ac
133 index 1111111..2222222 100644
134 --- a/configure.ac
135 +++ b/configure.ac
136-@@ -1599,10 +1599,16 @@ dnl *****************************
137+@@ -1659,10 +1659,16 @@ dnl *****************************
138 dnl ** Check for inotify (GIO) **
139 dnl *****************************
140 inotify_support=no
141@@ -131,7 +115,7 @@ index 1111111..2222222 100644
142 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
143 From: Hans Petter Jansson <hpj@cl.no>
144 Date: Fri, 15 Jun 2012 15:28:14 +0200
145-Subject: [PATCH 4/9] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
146+Subject: [PATCH] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
147 Backported from upstream
148
149
150@@ -139,7 +123,7 @@ diff --git a/configure.ac b/configure.ac
151 index 1111111..2222222 100644
152 --- a/configure.ac
153 +++ b/configure.ac
154-@@ -511,6 +511,8 @@ LT_INIT([disable-static win32-dll])
155+@@ -499,6 +499,8 @@ LT_INIT([disable-static win32-dll])
156 dnl when using libtool 2.x create libtool early, because it's used in configure
157 m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
158
159@@ -152,7 +136,7 @@ index 1111111..2222222 100644
160 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
161 From: Hans Petter Jansson <hpj@cl.no>
162 Date: Fri, 15 Jun 2012 15:29:06 +0200
163-Subject: [PATCH 5/9] Link with dnsapi
164+Subject: [PATCH] Link with dnsapi
165
166
167 diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
168@@ -171,15 +155,15 @@ index 1111111..2222222 100644
169 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
170 From: Hans Petter Jansson <hpj@cl.no>
171 Date: Fri, 15 Jun 2012 15:29:38 +0200
172-Subject: [PATCH 6/9] Ensure globals are initialized even when DllMain is not
173- being run
174+Subject: [PATCH] Ensure globals are initialized even when DllMain is not being
175+ run
176
177
178 diff --git a/glib/gmain.c b/glib/gmain.c
179 index 1111111..2222222 100644
180 --- a/glib/gmain.c
181 +++ b/glib/gmain.c
182-@@ -2657,12 +2657,15 @@ g_get_real_time (void)
183+@@ -2577,12 +2577,15 @@ g_get_real_time (void)
184 #if defined (G_OS_WIN32)
185 static ULONGLONG (*g_GetTickCount64) (void) = NULL;
186 static guint32 g_win32_tick_epoch = 0;
187@@ -195,7 +179,7 @@ index 1111111..2222222 100644
188 g_GetTickCount64 = NULL;
189 kernel32 = GetModuleHandle ("KERNEL32.DLL");
190 if (kernel32 != NULL)
191-@@ -2721,6 +2724,9 @@ g_get_monotonic_time (void)
192+@@ -2641,6 +2644,9 @@ g_get_monotonic_time (void)
193 * timeBeginPeriod() to increase it as much as they want
194 */
195
196@@ -535,7 +519,7 @@ index 1111111..2222222 100644
197 win32_check_for_error (WAIT_FAILED != WaitForSingleObject (wt->handle, INFINITE));
198 }
199
200-@@ -1041,6 +1145,8 @@ g_thread_lookup_native_funcs (void)
201+@@ -984,6 +1088,8 @@ g_thread_lookup_native_funcs (void)
202 void
203 g_thread_win32_init (void)
204 {
205@@ -548,7 +532,7 @@ index 1111111..2222222 100644
206 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
207 From: Gerardo Ballabio <gerardo.ballabio@gmail.com>
208 Date: Sun, 16 Aug 2015 13:18:24 +0200
209-Subject: [PATCH 7/9] Remove an annoying runtime warning
210+Subject: [PATCH] Remove an annoying runtime warning
211
212 that pops up when using GtkApplication in Gtk+ 3 programs.
213
214@@ -556,7 +540,7 @@ diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
215 index 1111111..2222222 100644
216 --- a/gio/gdbusaddress.c
217 +++ b/gio/gdbusaddress.c
218-@@ -1387,6 +1387,7 @@ __declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANC
219+@@ -1325,6 +1325,7 @@ __declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANC
220 __declspec(dllexport) void CALLBACK
221 g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow)
222 {
223@@ -564,7 +548,7 @@ index 1111111..2222222 100644
224 GDBusDaemon *daemon;
225 GMainLoop *loop;
226 const char *address;
227-@@ -1418,6 +1419,7 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
228+@@ -1354,6 +1355,7 @@ g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow
229
230 g_main_loop_unref (loop);
231 g_object_unref (daemon);
232@@ -576,7 +560,7 @@ index 1111111..2222222 100644
233 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
234 From: aquiles2k <aj@elane2k.com>
235 Date: Wed, 6 Apr 2016 22:39:53 +0300
236-Subject: [PATCH 8/9] fix error "won't overwrite defined macro" on OSX
237+Subject: [PATCH] fix error "won't overwrite defined macro" on OSX
238
239 See https://github.com/mxe/mxe/issues/1281
240
241@@ -596,48 +580,22 @@ index 1111111..2222222 100644
242 dnl At the end, if we're not within glib, we'll define the public
243 dnl definitions in terms of our private definitions.
244
245-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
246-From: Tony Theodore <tonyt@logyst.com>
247-Date: Mon, 26 Feb 2018 16:09:53 +1100
248-Subject: [PATCH 9/9] darwin: disable g_cocoa_notification_backend
249
250+From: Boris Pek <tehnick-8@mail.ru>
251+Date: Thu, 28 Apr 2016 16:48:12 +0300
252+Subject: [PATCH] fix build with GCC >= 6.x
253
254-diff --git a/gio/Makefile.am b/gio/Makefile.am
255-index 1111111..2222222 100644
256---- a/gio/Makefile.am
257-+++ b/gio/Makefile.am
258-@@ -279,10 +279,6 @@ unix_sources = \
259-
260- appinfo_sources += $(unix_appinfo_sources)
261-
262--if OS_COCOA
263--unix_sources += gcocoanotificationbackend.c
264--endif
265--
266- giounixincludedir=$(includedir)/gio-unix-2.0/gio
267- giounixinclude_HEADERS = \
268- gdesktopappinfo.h \
269-diff --git a/gio/giomodule.c b/gio/giomodule.c
270-index 1111111..2222222 100644
271---- a/gio/giomodule.c
272-+++ b/gio/giomodule.c
273-@@ -918,9 +918,6 @@ extern GType g_proxy_resolver_portal_get_type (void);
274- extern GType g_network_monitor_portal_get_type (void);
275- #endif
276-
277--#ifdef HAVE_COCOA
278--extern GType g_cocoa_notification_backend_get_type (void);
279--#endif
280+See plugins/gcc6/README.md
281+
282+diff --git a/gio/gregistrysettingsbackend.c b/gio/gregistrysettingsbackend.c
283+--- a/gio/gregistrysettingsbackend.c
284++++ b/gio/gregistrysettingsbackend.c
285+@@ -228,7 +228,7 @@
286+ if (result_code == ERROR_KEY_DELETED)
287+ trace ("(%s)", win32_message);
288+ else
289+- g_message (win32_message);
290++ g_message ("%s", win32_message);
291+ };
292
293- #ifdef G_PLATFORM_WIN32
294
295-@@ -1117,9 +1114,6 @@ _g_io_modules_ensure_loaded (void)
296- g_type_ensure (g_network_monitor_portal_get_type ());
297- g_type_ensure (g_proxy_resolver_portal_get_type ());
298- #endif
299--#ifdef HAVE_COCOA
300-- g_type_ensure (g_cocoa_notification_backend_get_type ());
301--#endif
302- #ifdef G_OS_WIN32
303- g_type_ensure (_g_winhttp_vfs_get_type ());
304- #endif
305diff --git a/src/glib.mk b/src/glib.mk
306index 825b86bb..499a45b8 100644
307--- a/src/glib.mk
308+++ b/src/glib.mk
309@@ -3,9 +3,9 @@
310 PKG := glib
311 $(PKG)_WEBSITE := https://gtk.org/
312 $(PKG)_DESCR := GLib
313-$(PKG)_IGNORE :=
314-$(PKG)_VERSION := 2.50.2
315-$(PKG)_CHECKSUM := be68737c1f268c05493e503b3b654d2b7f43d7d0b8c5556f7e4651b870acfbf5
316+$(PKG)_IGNORE :=
317+$(PKG)_VERSION := 2.44.1
318+$(PKG)_CHECKSUM := 8811deacaf8a503d0a9b701777ea079ca6a4277be10e3d730d2112735d5eca07
319 $(PKG)_SUBDIR := glib-$($(PKG)_VERSION)
320 $(PKG)_FILE := glib-$($(PKG)_VERSION).tar.xz
321 $(PKG)_URL := https://download.gnome.org/sources/glib/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE)
322@@ -27,6 +27,7 @@ define $(PKG)_BUILD_DARWIN
323 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
324 $(MXE_CONFIGURE_OPTS) \
325 --enable-regex \
326+ --disable-compile-warnings \
327 --disable-threads \
328 --disable-selinux \
329 --disable-inotify \
330@@ -55,6 +56,7 @@ define $(PKG)_BUILD_NATIVE
331 cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
332 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
333 $(MXE_CONFIGURE_OPTS) \
334+ --disable-compile-warnings \
335 --enable-regex \
336 --disable-threads \
337 --disable-selinux \
338@@ -97,6 +99,7 @@ define $(PKG)_BUILD
339 cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
340 cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
341 $(MXE_CONFIGURE_OPTS) \
342+ --disable-compile-warnings \
343 --with-threads=win32 \
344 --with-pcre=system \
345 --with-libiconv=gnu \