update to 2.57.2

This commit is contained in:
Thomas Sailer 2018-08-02 19:45:33 +02:00
parent b27c9205a7
commit e992e1307d
7 changed files with 70 additions and 66 deletions

View File

@ -22,7 +22,7 @@ diff --git a/glib/gstdio.c b/glib/gstdio.c
index 6d763e1..c1d072f 100644
--- a/glib/gstdio.c
+++ b/glib/gstdio.c
@@ -191,6 +191,11 @@ g_open (const gchar *filename,
@@ -758,6 +758,11 @@
int mode)
{
#ifdef G_OS_WIN32
@ -34,7 +34,7 @@ index 6d763e1..c1d072f 100644
wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
int retval;
int save_errno;
@@ -201,12 +206,114 @@ g_open (const gchar *filename,
@@ -768,12 +773,114 @@
return -1;
}
@ -68,7 +68,7 @@ index 6d763e1..c1d072f 100644
+ g_free (wfilename);
+ return -1;
+ }
+
+ dwDesiredAccess |= GENERIC_WRITE;
+ }
+ if (flags & _O_RDWR)
@ -133,7 +133,7 @@ index 6d763e1..c1d072f 100644
+ }
+ else
+ retval = _open_osfhandle((long)hFile, flags);
+
+ if ((-1) != retval)
+ {
+ /* We have a valid file handle. Set its translation mode to text or binary, as appropriate */
@ -152,7 +152,7 @@ index 6d763e1..c1d072f 100644
return retval;
#else
int fd;
@@ -248,6 +355,8 @@ g_creat (const gchar *filename,
@@ -821,6 +928,8 @@
int mode)
{
#ifdef G_OS_WIN32
@ -161,7 +161,7 @@ index 6d763e1..c1d072f 100644
wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
int retval;
int save_errno;
@@ -258,12 +367,41 @@ g_creat (const gchar *filename,
@@ -831,12 +940,41 @@
return -1;
}
@ -172,8 +172,7 @@ index 6d763e1..c1d072f 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);
+
@ -200,22 +199,39 @@ index 6d763e1..c1d072f 100644
+ retval = _open_osfhandle((long)hFile, _O_RDWR);
+ save_errno = errno;
+ g_free (wfilename);
g_free (wfilename);
-
errno = save_errno;
+
return retval;
#else
return creat (filename, mode);
@@ -699,33 +837,102 @@ g_fopen (const gchar *filename,
@@ -1286,36 +1424,102 @@
const gchar *mode)
{
#ifdef G_OS_WIN32
- wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
- wchar_t *wmode;
- gchar *mode2;
- FILE *retval;
- int save_errno;
-
- if (wfilename == NULL)
- {
- errno = EINVAL;
- return NULL;
- }
-
- mode2 = _g_win32_get_mode_alias (mode);
- wmode = g_utf8_to_utf16 (mode2, -1, NULL, NULL, NULL);
- g_free (mode2);
-
- if (wmode == NULL)
- {
- g_free (wfilename);
- errno = EINVAL;
- return NULL;
- }
+ int hFile;
+ int flags = 0;
+ gchar priv_mode[4];
@ -241,9 +257,7 @@ index 6d763e1..c1d072f 100644
+ if (('c' == priv_mode[2]) || ('n' == priv_mode[2]))
+ priv_mode[2] = '\0';
+ else
{
- 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"))
@ -261,21 +275,14 @@ index 6d763e1..c1d072f 100644
+ errno = EINVAL;
+ goto out;
+ }
}
-
- wmode = g_utf8_to_utf16 (mode, -1, NULL, NULL, NULL);
-
- if (wmode == NULL)
+ }
+ }
+ if (2 == strlen(priv_mode))
+ {
+ if (('c' == priv_mode[1]) || ('n' == priv_mode[1]))
+ priv_mode[1] = '\0';
+ else
{
- g_free (wfilename);
- errno = EINVAL;
- return NULL;
+ {
+ if (0 == strcmp(priv_mode, "a+"))
+ flags = _O_RDWR | _O_CREAT | _O_APPEND;
+ else if (0 == strcmp(priv_mode, "ab"))
@ -295,7 +302,7 @@ index 6d763e1..c1d072f 100644
+ errno = EINVAL;
+ goto out;
+ }
}
+ }
+ }
+ if (1 == strlen(priv_mode))
+ {
@ -329,6 +336,3 @@ index 6d763e1..c1d072f 100644
return retval;
#else
return fopen (filename, mode);
--
1.7.11.4

View File

@ -1,12 +1,13 @@
--- glib-2.57.1/configure.orig 2018-08-02 16:09:46.329046276 +0200
+++ glib-2.57.1/configure 2018-08-02 16:13:29.928093284 +0200
@@ -29652,7 +29652,7 @@
--- glib-2.57.2/configure.ac 2018-07-31 20:31:07.000000000 +0200
+++ glib-2.57.2/configure.ac 2018-08-02 19:09:02.569368144 +0200
@@ -3398,8 +3398,8 @@
-Wno-bad-function-cast \
-Werror=declaration-after-statement \
-Werror=missing-prototypes -Werror=implicit-function-declaration \
- -Werror=pointer-arith -Werror=init-self -Werror=format-security \
- -Werror=format=2 -Werror=missing-include-dirs; do
- -Werror=format=2 -Werror=missing-include-dirs])
+ -Werror=pointer-arith -Werror=init-self -Wno-error=format-security \
+ -Wno-error=format=2 -Werror=missing-include-dirs; do
+ -Wno-error=format=2 -Werror=missing-include-dirs])
])
AC_SUBST(GLIB_WARN_CFLAGS)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports flag $flag in envvar CFLAGS" >&5
$as_echo_n "checking if $CC supports flag $flag in envvar CFLAGS... " >&6; }

View File

@ -1,11 +1,11 @@
--- glib-2.57.1/configure.orig 2018-08-02 16:09:46.329046276 +0200
+++ glib-2.57.1/configure 2018-08-02 16:13:29.928093284 +0200
@@ -24131,7 +24131,7 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
--- glib-2.57.2/configure.ac 2018-07-31 20:31:07.000000000 +0200
+++ glib-2.57.2/configure.ac 2018-08-02 19:09:02.569368144 +0200
@@ -925,7 +925,7 @@
AC_MSG_CHECKING([if ip_mreq_source.imr_interface has s_addr member])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
- #include <netinet/in.h>
+ #include <ws2tcpip.h>
int
main ()
]],
[[
struct ip_mreq_source mc_req_src;

View File

@ -13,9 +13,9 @@ versions using #pragma)
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/glib/glib-init.c b/glib/glib-init.c
--- a/glib/glib-init.c 2018-08-02 16:09:46.277047195 +0200
+++ b/glib/glib-init.c 2018-08-02 16:10:23.617387056 +0200
@@ -275,12 +275,14 @@
--- a/glib/glib-init.c 2018-08-02 16:09:46.277047195 +0200
+++ b/glib/glib-init.c 2018-08-02 16:10:23.617387056 +0200
@@ -272,12 +272,14 @@
#if defined (G_OS_WIN32)
@ -32,7 +32,7 @@ diff --git a/glib/glib-init.c b/glib/glib-init.c
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
@@ -290,11 +292,6 @@
@@ -287,13 +289,6 @@
{
case DLL_PROCESS_ATTACH:
glib_dll = hinstDLL;
@ -41,10 +41,12 @@ diff --git a/glib/glib-init.c b/glib/glib-init.c
- g_thread_win32_init ();
-#endif
- glib_init ();
- /* must go after glib_init */
- g_console_win32_init ();
break;
case DLL_THREAD_DETACH:
@@ -318,7 +315,10 @@
@@ -317,7 +312,10 @@
return TRUE;
}
@ -56,7 +58,7 @@ diff --git a/glib/glib-init.c b/glib/glib-init.c
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(glib_init_ctor)
@@ -328,6 +328,12 @@
@@ -327,7 +325,15 @@
static void
glib_init_ctor (void)
{
@ -67,5 +69,8 @@ diff --git a/glib/glib-init.c b/glib/glib-init.c
+#endif /* defined (THREADS_WIN32) */
+#endif /* defined (G_OS_WIN32) */
glib_init ();
+ /* must go after glib_init */
+ g_console_win32_init ();
}
#else

View File

@ -1,12 +0,0 @@
--- glib-2.57.1/glib/valgrind.h.xx 2018-08-02 17:29:39.096594952 +0200
+++ glib-2.57.1/glib/valgrind.h 2018-08-02 17:29:49.478405545 +0200
@@ -93,6 +93,9 @@
#include <stdarg.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
/* Nb: this file might be included in a file compiled with -ansi. So
we can't use C++ style "//" comments nor the "asm" keyword (instead

View File

@ -4,7 +4,7 @@
%global __python %{__python3}
Name: mingw-glib2
Version: 2.57.1
Version: 2.57.2
Release: 1%{?dist}
Summary: MinGW Windows GLib2 library
@ -39,6 +39,10 @@ BuildRequires: gettext
# Native version required for glib-genmarshal
BuildRequires: glib2-devel >= 2.45.3
BuildRequires: python3-devel
# glib starting from 2.57.2 does not ship autoconf scripts anymore
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
# https://bugzilla.gnome.org/show_bug.cgi?id=674214
Patch1: 0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch
@ -56,9 +60,6 @@ Patch6: glib-formaterror.patch
# https://gitlab.gnome.org/GNOME/glib/issues/1472
Patch7: glib-ipmreqsource.patch
# https://gitlab.gnome.org/GNOME/glib/issues/1473
Patch8: glib-valgrind.patch
%description
MinGW Windows Glib2 library.
@ -106,9 +107,9 @@ Static version of the MinGW Windows GLib2 library.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
NOCONFIGURE=1 ./autogen.sh
#GLib can't build static and shared libraries in one go, so we build GLib twice
MINGW_BUILDDIR_SUFFIX=_static %mingw_configure --with-python=%{__python3} --disable-shared --enable-static
MINGW_BUILDDIR_SUFFIX=_shared %mingw_configure --with-python=%{__python3} --disable-static
@ -190,6 +191,7 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%{mingw32_bindir}/gdbus.exe
%{mingw32_bindir}/gio.exe
%{mingw32_bindir}/gio-querymodules.exe
%{mingw32_bindir}/gio-launch-desktop.exe
%{mingw32_bindir}/glib-compile-resources.exe
%{mingw32_bindir}/glib-compile-schemas.exe
%{mingw32_bindir}/glib-genmarshal
@ -242,6 +244,7 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%{mingw64_bindir}/gdbus.exe
%{mingw64_bindir}/gio.exe
%{mingw64_bindir}/gio-querymodules.exe
%{mingw64_bindir}/gio-launch-desktop.exe
%{mingw64_bindir}/glib-compile-resources.exe
%{mingw64_bindir}/glib-compile-schemas.exe
%{mingw64_bindir}/glib-genmarshal
@ -290,6 +293,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%changelog
* Thu Aug 02 2018 Thomas Sailer <t.sailer@alumni.ethz.ch> - 2.57.2-1
- Update to 2.57.2
* Thu Aug 02 2018 Thomas Sailer <t.sailer@alumni.ethz.ch> - 2.57.1-1
- Update to 2.57.1

View File

@ -1 +1 @@
SHA512 (glib-2.57.1.tar.xz) = fad52b079731338d2a573c460750cdbc757e249f5276f57a4cb5e1833e65e3fc353da78c3253db820a69af2e1444f6d32874d862580e199570a64965401388b1
SHA512 (glib-2.57.2.tar.xz) = 372de80d738063c1ad359435deb095803d92e449abc64d2a8311d217fe0cb517dc12c05193b4618164ec2016ab0f83e4e331aae1488d5585e552bd36e5c8591f