diff --git a/0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch b/0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch index 201ee1d..0c66d1b 100644 --- a/0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch +++ b/0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch @@ -1,27 +1,238 @@ -From 7f4f4354540440c0a8a37beaccbec8bc7fc15ec7 Mon Sep 17 00:00:00 2001 -From: Erik van Pienbroek -Date: Mon, 27 Aug 2012 23:28:54 +0200 -Subject: [PATCH] Use CreateFile on Win32 to make sure g_unlink always works - -The functions g_open(), g_creat() and g_fopen() defer to _wopen(), -_wcreat() and _wfopen() respectively. This is very similar to -the corresponding arrangement for Linux. However, those Windows -functions do not support renaming a file whilst it's open. As a -result, g_rename() behaves differently on the Windows platform -compared to its Linux behaviour, where files can be renamed even -while there are file handles still open. Resolved this by using -the Win32 API function CreateFile() instead of _wopen(), _wcreat() -and _wfopen() - -Patch initially created by John Emmas ---- - glib/gstdio.c | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- - 1 file changed, 235 insertions(+), 29 deletions(-) - -diff --git a/glib/gstdio.c b/glib/gstdio.c -index 653c8a3..26e8158 100644 ---- a/glib/gstdio.c -+++ b/glib/gstdio.c +diff -rupN --no-dereference glib-2.63.0/gio/tests/org.gtk.test.gschema.override.orig glib-2.63.0-new/gio/tests/org.gtk.test.gschema.override.orig +--- glib-2.63.0/gio/tests/org.gtk.test.gschema.override.orig 2019-10-04 15:59:03.000000000 +0200 ++++ glib-2.63.0-new/gio/tests/org.gtk.test.gschema.override.orig 1970-01-01 01:00:00.000000000 +0100 +@@ -1,2 +0,0 @@ +-[org.gtk.test.per-desktop:GNOME-Classic] +-desktop = "GNOME Classic" +diff -rupN --no-dereference glib-2.63.0/gio/tests/org.gtk.test.gschema.xml.orig glib-2.63.0-new/gio/tests/org.gtk.test.gschema.xml.orig +--- glib-2.63.0/gio/tests/org.gtk.test.gschema.xml.orig 2019-10-04 15:59:03.000000000 +0200 ++++ glib-2.63.0-new/gio/tests/org.gtk.test.gschema.xml.orig 1970-01-01 01:00:00.000000000 +0100 +@@ -1,222 +0,0 @@ +- +- +- +- +- "Hello, earthlings" +- A greeting +- +- Greeting of the invading martians +- +- +- +- "So long" +- +- +- +- +- +- +- +- +- +- true +- +- +- +- +- +- true +- +- +- 25 +- +- +- -1234 +- +- +- 1234 +- +- +- -123456 +- +- +- 123456 +- +- +- -123456789 +- +- +- 123456789 +- +- +- 123.456 +- +- +- "a string, it seems" +- +- +- "/a/object/path" +- +- +- +- +- +- ("one",(2,3)) +- +- +- [0,1,2,3,4,5] +- +- +- +- { +- "AC": [0,0, 0,0,0,0,0,0], +- "IV": [0,0, 0,0,0,0,0,0] +- } +- +- +- +- +- +- +- "Unnamed" +- +- +- "BackSpace" +- +- +- +- +- +- false +- +- +- false +- +- +- 0 +- +- +- 0 +- +- +- 0 +- +- +- 0 +- +- +- 0 +- +- +- 0 +- +- +- 0 +- +- +- 0 +- +- +- "" +- +- +- [48, 49] +- +- +- [] +- +- +- 'foo' +- +- +- ['mourning', 'laughing'] +- +- +- 33 +- +- +- +- +- +- +- 'bar' +- +- +- +- +- +- [] +- +- +- +- +- +- +- +- +- [] +- +- +- 'bar' +- +- +- +- +- +- 33 +- +- +- +- +- +- +- 33 +- +- +- +- +- +- 0 +- +- +- +- +- +- +- a paragraph. +- +- with some whitespace. +- +- because not everyone has a great editor. +- +- +- +- +- lots of space is as one. +- +- 0 +- +- +- +- +- +- 0 +- +- +- '' +- +- +- +- 42 +- +- 0 +- +- +- +- +- +- "GNOME" +- +- +- +- +diff -rupN --no-dereference glib-2.63.0/glib/gstdio.c glib-2.63.0-new/glib/gstdio.c +--- glib-2.63.0/glib/gstdio.c 2019-10-04 15:59:03.000000000 +0200 ++++ glib-2.63.0-new/glib/gstdio.c 2019-10-04 22:26:19.880972225 +0200 @@ -1035,6 +1035,11 @@ g_open (const gchar *filename, int mode) { @@ -106,8 +317,7 @@ index 653c8a3..26e8158 100644 + { + dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS; + } - -- g_free (wfilename); ++ + if (0 == dwFlagsAndAttributes) + dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL; + hFile = CreateFileW(wfilename, dwDesiredAccess, dwSharedAccess, NULL, dwDisposition, dwFlagsAndAttributes, NULL); @@ -134,6 +344,7 @@ index 653c8a3..26e8158 100644 + else + retval = _open_osfhandle((long)hFile, flags); +- g_free (wfilename); + if ((-1) != retval) + { + /* We have a valid file handle. Set its translation mode to text or binary, as appropriate */ @@ -144,7 +355,7 @@ index 653c8a3..26e8158 100644 + else + _setmode(retval, _O_BINARY); + } -+ + + save_errno = errno; + g_free (wfilename); errno = save_errno; @@ -172,11 +383,10 @@ index 653c8a3..26e8158 100644 + if (! (mode & _S_IWRITE)) + dwFlagsAndAttributes = FILE_ATTRIBUTE_READONLY; /* Sets file to 'read only' after the file gets closed */ + } - -- g_free (wfilename); ++ + hFile = CreateFileW(wfilename, (GENERIC_READ | GENERIC_WRITE), (FILE_SHARE_READ | FILE_SHARE_DELETE), + NULL, CREATE_ALWAYS, dwFlagsAndAttributes, NULL); - ++ + if (INVALID_HANDLE_VALUE == hFile) + { + retval = (-1); @@ -198,9 +408,10 @@ index 653c8a3..26e8158 100644 + } + else + retval = _open_osfhandle((long)hFile, _O_RDWR); -+ + + save_errno = errno; -+ g_free (wfilename); + g_free (wfilename); +- errno = save_errno; + return retval; @@ -214,16 +425,35 @@ index 653c8a3..26e8158 100644 - wchar_t *wmode; - FILE *retval; - int save_errno; -+ int hFile; -+ int flags = 0; -+ gchar priv_mode[4]; -+ FILE *retval = NULL; - +- - if (wfilename == NULL) - { - errno = EINVAL; - return NULL; - } +- +- wmode = g_utf8_to_utf16 (mode, -1, NULL, NULL, NULL); +- +- if (wmode == NULL) +- { +- g_free (wfilename); +- errno = EINVAL; +- return NULL; +- } +- +- _g_win32_fix_mode (wmode); +- retval = _wfopen (wfilename, wmode); +- save_errno = errno; +- +- g_free (wfilename); +- g_free (wmode); +- +- errno = save_errno; ++ int hFile; ++ int flags = 0; ++ gchar priv_mode[4]; ++ FILE *retval = NULL; ++ + if ((NULL == filename) || (NULL == mode)) + { + errno = EINVAL; @@ -234,22 +464,17 @@ index 653c8a3..26e8158 100644 + errno - EINVAL; + goto out; + } - -- wmode = g_utf8_to_utf16 (mode, -1, NULL, NULL, NULL); ++ + strncpy(priv_mode, mode, 3); + priv_mode[3] = '\0'; - -- if (wmode == NULL) ++ + /* Set up any flags to pass to 'g_open()' */ + if (3 == strlen(priv_mode)) + { + if (('c' == priv_mode[2]) || ('n' == priv_mode[2])) + priv_mode[2] = '\0'; + else - { -- g_free (wfilename); -- errno = EINVAL; -- return NULL; ++ { + if (0 == strcmp(priv_mode, "a+b")) + flags = _O_RDWR | _O_CREAT | _O_APPEND | _O_BINARY; + else if (0 == strcmp(priv_mode, "a+t")) @@ -267,16 +492,7 @@ index 653c8a3..26e8158 100644 + errno = EINVAL; + goto out; + } - } -- -- _g_win32_fix_mode (wmode); -- retval = _wfopen (wfilename, wmode); -- save_errno = errno; -- -- g_free (wfilename); -- g_free (wmode); -- -- errno = save_errno; ++ } + } + if (2 == strlen(priv_mode)) + { diff --git a/glib-prefer-constructors-over-DllMain.patch b/glib-prefer-constructors-over-DllMain.patch index 4bb5233..f15fdef 100644 --- a/glib-prefer-constructors-over-DllMain.patch +++ b/glib-prefer-constructors-over-DllMain.patch @@ -1,21 +1,6 @@ -From bc90511c1eb333e26e0bc0eaee62375d0e788db6 Mon Sep 17 00:00:00 2001 -From: Erik van Pienbroek -Date: Tue, 16 Apr 2013 11:42:11 +0200 -Subject: [PATCH] win32: Prefer the use of constructors over DllMain - -This prevents having to depend on DllMain in static libraries - -Constructors are available in both the GCC build (GCC 2.7 and later) -and the MSVC build (MSVC 2008 and later using _Pragma, earlier -versions using #pragma) ---- - glib/glib-init.c | 27 ++++++++++++++++----------- - 1 file changed, 16 insertions(+), 11 deletions(-) - -diff --git a/glib/glib-init.c b/glib/glib-init.c -index ed800dc..f760bf1 100644 ---- a/glib/glib-init.c -+++ b/glib/glib-init.c +diff -rupN --no-dereference glib-2.63.0/glib/glib-init.c glib-2.63.0-new/glib/glib-init.c +--- glib-2.63.0/glib/glib-init.c 2019-10-04 15:59:03.000000000 +0200 ++++ glib-2.63.0-new/glib/glib-init.c 2019-10-04 22:26:20.000972220 +0200 @@ -271,12 +271,14 @@ glib_init (void) #if defined (G_OS_WIN32) diff --git a/mingw-glib2.spec b/mingw-glib2.spec index a5e6bf6..104af0b 100644 --- a/mingw-glib2.spec +++ b/mingw-glib2.spec @@ -8,7 +8,7 @@ %global __python %{__python3} Name: mingw-glib2 -Version: 2.62.0 +Version: 2.63.0 Release: 1%{?dist} Summary: MinGW Windows GLib2 library @@ -272,6 +272,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete %changelog +* Fri Oct 04 2019 Sandro Mani - 2.63.0-1 +- Update to 2.63.0 + * Mon Sep 16 2019 Sandro Mani - 2.62.0-1 - Update to 2.62.0 diff --git a/sources b/sources index e083954..2103ca4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (glib-2.62.0.tar.xz) = 4a880f9cc0209e99e814c4ef0adf3ef82ec5cca413ebb3e6d2da17768b7099744ca57f0a86b5aeb443c8ee0b663581ddb8bb577fa7bcc645bd64817b39991d63 +SHA512 (glib-2.63.0.tar.xz) = e711200b765f3e1ba51ed37b9bd730dbd8415707df54973bfe0d3a1435f09dc34aa582b99cfd96e2e2735a8ab852baf33705af472bd8c85b8415273031418a61