Sync mingw-w64-glib2 with AUR
This commit is contained in:
parent
7e5bc28420
commit
19b5116ea6
|
@ -0,0 +1,338 @@
|
|||
From 7f4f4354540440c0a8a37beaccbec8bc7fc15ec7 Mon Sep 17 00:00:00 2001
|
||||
From: Erik van Pienbroek <epienbro@fedoraproject.org>
|
||||
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 | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 233 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/glib/gstdio.c b/glib/gstdio.c
|
||||
index 6d763e1..c1d072f 100644
|
||||
--- a/glib/gstdio.c
|
||||
+++ b/glib/gstdio.c
|
||||
@@ -758,6 +758,11 @@
|
||||
int mode)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
+ HANDLE hFile;
|
||||
+ DWORD dwDesiredAccess = 0;
|
||||
+ DWORD dwFlagsAndAttributes = 0;
|
||||
+ DWORD dwDisposition = OPEN_EXISTING;
|
||||
+ DWORD dwSharedAccess = FILE_SHARE_READ | FILE_SHARE_DELETE;
|
||||
wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
|
||||
int retval;
|
||||
int save_errno;
|
||||
@@ -768,12 +773,114 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
- retval = _wopen (wfilename, flags, mode);
|
||||
- save_errno = errno;
|
||||
+ /* Set up the access modes and other attributes */
|
||||
+ if ((flags & _O_CREAT) && (mode & _S_IREAD))
|
||||
+ {
|
||||
+ if (! (mode & _S_IWRITE))
|
||||
+ dwFlagsAndAttributes = FILE_ATTRIBUTE_READONLY; /* Sets file to 'read only' after the file gets closed */
|
||||
+ }
|
||||
+ if ( !(flags & _O_ACCMODE))
|
||||
+ {
|
||||
+ /* Equates to _O_RDONLY */
|
||||
+ if (flags & _O_TRUNC)
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ g_free (wfilename);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
- g_free (wfilename);
|
||||
+ dwDesiredAccess |= GENERIC_READ;
|
||||
+ dwSharedAccess |= FILE_SHARE_WRITE;
|
||||
+ }
|
||||
+ if (flags & _O_WRONLY)
|
||||
+ {
|
||||
+ if (flags & _O_RDWR)
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ g_free (wfilename);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ dwDesiredAccess |= GENERIC_WRITE;
|
||||
+ }
|
||||
+ if (flags & _O_RDWR)
|
||||
+ {
|
||||
+ dwDesiredAccess |= GENERIC_READ;
|
||||
+ dwDesiredAccess |= GENERIC_WRITE;
|
||||
+ }
|
||||
+ if (flags & _O_TRUNC)
|
||||
+ {
|
||||
+ if (flags & _O_CREAT)
|
||||
+ dwDisposition = CREATE_ALWAYS;
|
||||
+ else
|
||||
+ dwDisposition = TRUNCATE_EXISTING;
|
||||
+ }
|
||||
+ if ((flags & _O_CREAT) && !(flags & _O_TRUNC))
|
||||
+ {
|
||||
+ if (flags & _O_EXCL)
|
||||
+ dwDisposition = CREATE_NEW;
|
||||
+ else
|
||||
+ dwDisposition = OPEN_ALWAYS;
|
||||
+ }
|
||||
+ if (flags & _O_CREAT)
|
||||
+ {
|
||||
+ /* Handle the other flags that can be attached to _O_CREAT */
|
||||
+ if ((flags & _O_TEMPORARY) || (flags & _O_SHORT_LIVED))
|
||||
+ dwFlagsAndAttributes |= FILE_ATTRIBUTE_TEMPORARY;
|
||||
+
|
||||
+ if (flags & _O_TEMPORARY)
|
||||
+ dwFlagsAndAttributes |= FILE_FLAG_DELETE_ON_CLOSE;
|
||||
+ }
|
||||
+ if ((flags & _O_SEQUENTIAL) || (flags & _O_APPEND))
|
||||
+ {
|
||||
+ dwFlagsAndAttributes |= FILE_FLAG_SEQUENTIAL_SCAN;
|
||||
+ }
|
||||
+ else if (flags & _O_RANDOM)
|
||||
+ {
|
||||
+ dwFlagsAndAttributes |= FILE_FLAG_RANDOM_ACCESS;
|
||||
+ }
|
||||
+
|
||||
+ if (0 == dwFlagsAndAttributes)
|
||||
+ dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
|
||||
+ hFile = CreateFileW(wfilename, dwDesiredAccess, dwSharedAccess, NULL, dwDisposition, dwFlagsAndAttributes, NULL);
|
||||
+
|
||||
+ if (INVALID_HANDLE_VALUE == hFile)
|
||||
+ {
|
||||
+ retval = (-1);
|
||||
+
|
||||
+ switch (GetLastError ())
|
||||
+ {
|
||||
+#define CASE(a,b) case ERROR_##a: errno = b; break
|
||||
+ CASE (FILE_NOT_FOUND, ENOENT);
|
||||
+ CASE (PATH_NOT_FOUND, ENOENT);
|
||||
+ CASE (ACCESS_DENIED, EACCES);
|
||||
+ CASE (NOT_SAME_DEVICE, EXDEV);
|
||||
+ CASE (LOCK_VIOLATION, EACCES);
|
||||
+ CASE (SHARING_VIOLATION, EACCES);
|
||||
+ CASE (FILE_EXISTS, EEXIST);
|
||||
+ CASE (ALREADY_EXISTS, EEXIST);
|
||||
+#undef CASE
|
||||
+ default: errno = EIO;
|
||||
+ }
|
||||
+ }
|
||||
+ 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 */
|
||||
+ if ((!(flags & _O_TEXT)) && (_fmode == _O_BINARY))
|
||||
+ _setmode(retval, _O_BINARY);
|
||||
+ else if ((flags & _O_TEXT) || (_fmode == _O_TEXT))
|
||||
+ _setmode(retval, _O_TEXT);
|
||||
+ else
|
||||
+ _setmode(retval, _O_BINARY);
|
||||
+ }
|
||||
+
|
||||
+ save_errno = errno;
|
||||
+ g_free (wfilename);
|
||||
errno = save_errno;
|
||||
+
|
||||
return retval;
|
||||
#else
|
||||
int fd;
|
||||
@@ -821,6 +928,8 @@
|
||||
int mode)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
+ HANDLE hFile;
|
||||
+ DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
|
||||
wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
|
||||
int retval;
|
||||
int save_errno;
|
||||
@@ -831,12 +940,41 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
- retval = _wcreat (wfilename, mode);
|
||||
- save_errno = errno;
|
||||
+ if (mode & _S_IREAD)
|
||||
+ {
|
||||
+ if (! (mode & _S_IWRITE))
|
||||
+ dwFlagsAndAttributes = FILE_ATTRIBUTE_READONLY; /* Sets file to 'read only' after the file gets closed */
|
||||
+ }
|
||||
+
|
||||
+ 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);
|
||||
+
|
||||
+ switch (GetLastError ())
|
||||
+ {
|
||||
+#define CASE(a,b) case ERROR_##a: errno = b; break
|
||||
+ CASE (FILE_NOT_FOUND, ENOENT);
|
||||
+ CASE (PATH_NOT_FOUND, ENOENT);
|
||||
+ CASE (ACCESS_DENIED, EACCES);
|
||||
+ CASE (NOT_SAME_DEVICE, EXDEV);
|
||||
+ CASE (LOCK_VIOLATION, EACCES);
|
||||
+ CASE (SHARING_VIOLATION, EACCES);
|
||||
+ CASE (FILE_EXISTS, EEXIST);
|
||||
+ CASE (ALREADY_EXISTS, EEXIST);
|
||||
+#undef CASE
|
||||
+ default: errno = EIO;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ retval = _open_osfhandle((long)hFile, _O_RDWR);
|
||||
|
||||
+ save_errno = errno;
|
||||
g_free (wfilename);
|
||||
-
|
||||
errno = save_errno;
|
||||
+
|
||||
return retval;
|
||||
#else
|
||||
return creat (filename, mode);
|
||||
@@ -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];
|
||||
+ FILE *retval = NULL;
|
||||
+
|
||||
+ if ((NULL == filename) || (NULL == mode))
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ if ((strlen(mode) < 1) || (strlen(mode) > 3))
|
||||
+ {
|
||||
+ errno - EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ strncpy(priv_mode, mode, 3);
|
||||
+ priv_mode[3] = '\0';
|
||||
+
|
||||
+ /* 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
|
||||
+ {
|
||||
+ if (0 == strcmp(priv_mode, "a+b"))
|
||||
+ flags = _O_RDWR | _O_CREAT | _O_APPEND | _O_BINARY;
|
||||
+ else if (0 == strcmp(priv_mode, "a+t"))
|
||||
+ flags = _O_RDWR | _O_CREAT | _O_APPEND | _O_TEXT;
|
||||
+ else if (0 == strcmp(priv_mode, "r+b"))
|
||||
+ flags = _O_RDWR | _O_BINARY;
|
||||
+ else if (0 == strcmp(priv_mode, "r+t"))
|
||||
+ flags = _O_RDWR | _O_TEXT;
|
||||
+ else if (0 == strcmp(priv_mode, "w+b"))
|
||||
+ flags = _O_RDWR | _O_CREAT |_O_TRUNC | _O_BINARY;
|
||||
+ else if (0 == strcmp(priv_mode, "w+t"))
|
||||
+ flags = _O_RDWR | _O_CREAT |_O_TRUNC | _O_TEXT;
|
||||
+ else
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (2 == strlen(priv_mode))
|
||||
+ {
|
||||
+ if (('c' == priv_mode[1]) || ('n' == priv_mode[1]))
|
||||
+ priv_mode[1] = '\0';
|
||||
+ else
|
||||
+ {
|
||||
+ if (0 == strcmp(priv_mode, "a+"))
|
||||
+ flags = _O_RDWR | _O_CREAT | _O_APPEND;
|
||||
+ else if (0 == strcmp(priv_mode, "ab"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_APPEND | _O_BINARY;
|
||||
+ else if (0 == strcmp(priv_mode, "at"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_APPEND | _O_TEXT;
|
||||
+ else if (0 == strcmp(priv_mode, "rb"))
|
||||
+ flags = _O_RDONLY | _O_BINARY;
|
||||
+ else if (0 == strcmp(priv_mode, "rt"))
|
||||
+ flags = _O_RDONLY | _O_TEXT;
|
||||
+ else if (0 == strcmp(priv_mode, "wb"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_TRUNC | _O_BINARY;
|
||||
+ else if (0 == strcmp(priv_mode, "wt"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_TRUNC | _O_TEXT;
|
||||
+ else
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (1 == strlen(priv_mode))
|
||||
+ {
|
||||
+ if (0 == strcmp(priv_mode, "a"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_APPEND;
|
||||
+ else if (0 == strcmp(priv_mode, "r"))
|
||||
+ flags = _O_RDONLY;
|
||||
+ else if (0 == strcmp(priv_mode, "w"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_TRUNC;
|
||||
+ else if ( !((0 == strcmp(priv_mode, "c")) || (0 == strcmp(priv_mode, "n"))))
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- retval = _wfopen (wfilename, wmode);
|
||||
- save_errno = errno;
|
||||
+ hFile = g_open (filename, flags, (_S_IREAD | _S_IWRITE));
|
||||
|
||||
- g_free (wfilename);
|
||||
- g_free (wmode);
|
||||
+ if (INVALID_HANDLE_VALUE == (HANDLE)hFile)
|
||||
+ /* 'errno' will have already been set by 'g_open()' */
|
||||
+ retval = NULL;
|
||||
+ else
|
||||
+ retval = _fdopen(hFile, mode);
|
||||
|
||||
- errno = save_errno;
|
||||
+out:
|
||||
return retval;
|
||||
#else
|
||||
return fopen (filename, mode);
|
|
@ -0,0 +1,26 @@
|
|||
From b7789bb144ff4545021fbd95ee93c98ec706891a Mon Sep 17 00:00:00 2001
|
||||
From: Nicola Murino <nicola.murino@gmail.com>
|
||||
Date: Fri, 17 Aug 2018 17:04:07 +0200
|
||||
Subject: [PATCH] gsocket: fix cross compilation
|
||||
|
||||
for some reason when cross compiling for windows BROKEN_IP_MREQ_SOURCE_STRUCT is defined but should not
|
||||
---
|
||||
gio/gsocket.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gio/gsocket.c b/gio/gsocket.c
|
||||
index 859e807cb..71a97b8cf 100644
|
||||
--- a/gio/gsocket.c
|
||||
+++ b/gio/gsocket.c
|
||||
@@ -2404,7 +2404,7 @@ g_socket_multicast_group_operation_ssm (GSocket *socket,
|
||||
memset (&mc_req_src, 0, sizeof (mc_req_src));
|
||||
|
||||
/* By default use the default IPv4 multicast interface. */
|
||||
- S_ADDR_FIELD(mc_req_src) = g_htonl (INADDR_ANY);
|
||||
+ mc_req_src.imr_interface.s_addr = g_htonl (INADDR_ANY);
|
||||
|
||||
if (iface)
|
||||
{
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
# Maintainer: drakkan <nicola.murino at gmail dot com>
|
||||
# Contributor: Filip Brcic <brcha@gna.org>
|
||||
# Contributor: ant32 <antreimer@gmail.com>
|
||||
# Contributor: Renato Silva <br.renatosilva@gmail.com>
|
||||
pkgname=mingw-w64-glib2
|
||||
pkgver=2.58.0
|
||||
pkgrel=1
|
||||
_commit=f0b57dd7a80425264e318f85c331a039a3cddd87 # tags/2.58.0
|
||||
arch=(any)
|
||||
pkgdesc="Low level core library (mingw-w64)"
|
||||
depends=(mingw-w64-libffi mingw-w64-pcre mingw-w64-gettext mingw-w64-zlib)
|
||||
makedepends=(mingw-w64-configure git python2)
|
||||
license=("LGPL2.1")
|
||||
options=(!strip !buildflags staticlibs !emptydirs)
|
||||
url="https://wiki.gnome.org/Projects/GLib"
|
||||
source=("git+https://gitlab.gnome.org/GNOME/glib.git#commit=$_commit"
|
||||
"0001-gsocket-fix-cross-compilation.patch"
|
||||
"0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch"
|
||||
"glib-formaterror.patch"
|
||||
"glib-include-time-h-for-localtime_r.patch"
|
||||
"glib-prefer-constructors-over-DllMain.patch")
|
||||
sha256sums=('SKIP'
|
||||
'44c8c6b4ca376177a8c333a00c3485d638f8641967503e15364606d4c4292ff3'
|
||||
'afd62a852a0b6aed4ce86eb97297e5080b26055cc878413b89d482c184b826b3'
|
||||
'ea529d5cbf8cf7ca66467664a3ead37473a1c009ac973d5694b06cc9d0b23df3'
|
||||
'ac567f7a9cad51ab97dba70bcdd6c0c16f93d2451c43fde380e4fdb20b2d4b31'
|
||||
'8a02502069fa88c667a4fd1599280f927cb1bcf61e9fcd369fec5bdb5440d480')
|
||||
|
||||
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
|
||||
|
||||
pkgver() {
|
||||
cd glib
|
||||
git describe --tags | sed 's/-/+/g'
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd glib
|
||||
patch -Np1 -i ../0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch
|
||||
patch -Np1 -i ../glib-prefer-constructors-over-DllMain.patch
|
||||
patch -Np1 -i ../glib-formaterror.patch
|
||||
patch -Np1 -i ../glib-include-time-h-for-localtime_r.patch
|
||||
patch -Np1 -i ../0001-gsocket-fix-cross-compilation.patch
|
||||
NOCONFIGURE=1 ./autogen.sh
|
||||
}
|
||||
|
||||
|
||||
build() {
|
||||
cd glib
|
||||
conf="--with-pcre=system --with-threads=win32 --disable-fam"
|
||||
for _arch in ${_architectures}; do
|
||||
mkdir -p build-${_arch}-static && pushd build-${_arch}-static
|
||||
${_arch}-configure \
|
||||
--disable-shared $conf
|
||||
make
|
||||
popd
|
||||
|
||||
mkdir -p build-${_arch}-shared && pushd build-${_arch}-shared
|
||||
${_arch}-configure \
|
||||
--disable-static $conf
|
||||
make
|
||||
popd
|
||||
done
|
||||
}
|
||||
|
||||
package() {
|
||||
for _arch in ${_architectures}; do
|
||||
cd "$srcdir/glib/build-${_arch}-shared"
|
||||
make DESTDIR="$pkgdir" install
|
||||
make -C "$srcdir/glib/build-${_arch}-static" DESTDIR="$pkgdir/static" install
|
||||
mv "$pkgdir/static/usr/${_arch}/lib/"*.a "$pkgdir/usr/${_arch}/lib/"
|
||||
find "$pkgdir/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip {} \;
|
||||
find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
|
||||
find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
|
||||
rm -r "$pkgdir/usr/${_arch}/lib/charset.alias"
|
||||
rm -r "$pkgdir/static"
|
||||
done
|
||||
}
|
||||
|
||||
# vim: ts=2 sw=2 et:
|
|
@ -0,0 +1,13 @@
|
|||
--- 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])
|
||||
+ -Werror=pointer-arith -Werror=init-self -Wno-error=format-security \
|
||||
+ -Wno-error=format=2 -Werror=missing-include-dirs])
|
||||
])
|
||||
AC_SUBST(GLIB_WARN_CFLAGS)
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
--- glib-2.43.2/glib/gdate.c.orig 2015-01-01 23:50:04.203252143 +0100
|
||||
+++ glib-2.43.2/glib/gdate.c 2015-01-01 23:50:28.329647373 +0100
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <windows.h>
|
||||
+#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "gdate.h"
|
|
@ -1,7 +1,21 @@
|
|||
diff -Naur glib-2.46.0-orig/glib/glib-init.c glib-2.46.0/glib/glib-init.c
|
||||
--- glib-2.46.0-orig/glib/glib-init.c 2015-09-12 18:13:45.000000000 +0300
|
||||
+++ glib-2.46.0/glib/glib-init.c 2015-09-22 09:09:00.512195800 +0300
|
||||
@@ -238,12 +238,14 @@
|
||||
From bc90511c1eb333e26e0bc0eaee62375d0e788db6 Mon Sep 17 00:00:00 2001
|
||||
From: Erik van Pienbroek <epienbro@fedoraproject.org>
|
||||
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 | 22 ++++++++++++++--------
|
||||
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
|
||||
@@ -272,12 +272,14 @@
|
||||
|
||||
#if defined (G_OS_WIN32)
|
||||
|
||||
|
@ -18,7 +32,7 @@ diff -Naur glib-2.46.0-orig/glib/glib-init.c glib-2.46.0/glib/glib-init.c
|
|||
BOOL WINAPI
|
||||
DllMain (HINSTANCE hinstDLL,
|
||||
DWORD fdwReason,
|
||||
@@ -253,11 +255,6 @@
|
||||
@@ -287,13 +289,6 @@
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
glib_dll = hinstDLL;
|
||||
|
@ -27,10 +41,12 @@ diff -Naur glib-2.46.0-orig/glib/glib-init.c glib-2.46.0/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:
|
||||
@@ -274,7 +271,10 @@
|
||||
@@ -317,7 +312,10 @@
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -42,7 +58,7 @@ diff -Naur glib-2.46.0-orig/glib/glib-init.c glib-2.46.0/glib/glib-init.c
|
|||
|
||||
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
|
||||
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(glib_init_ctor)
|
||||
@@ -284,6 +284,12 @@
|
||||
@@ -327,7 +325,15 @@
|
||||
static void
|
||||
glib_init_ctor (void)
|
||||
{
|
||||
|
@ -53,5 +69,8 @@ diff -Naur glib-2.46.0-orig/glib/glib-init.c glib-2.46.0/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
|
|
@ -1,7 +1,28 @@
|
|||
diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
||||
--- glib-2.46.0-orig/glib/gstdio.c 2015-02-26 15:57:09.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gstdio.c 2015-09-22 09:08:58.032066100 +0300
|
||||
@@ -192,6 +192,11 @@
|
||||
From 7f4f4354540440c0a8a37beaccbec8bc7fc15ec7 Mon Sep 17 00:00:00 2001
|
||||
From: Erik van Pienbroek <epienbro@fedoraproject.org>
|
||||
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 | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 233 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/glib/gstdio.c b/glib/gstdio.c
|
||||
index 6d763e1..c1d072f 100644
|
||||
--- a/glib/gstdio.c
|
||||
+++ b/glib/gstdio.c
|
||||
@@ -758,6 +758,11 @@
|
||||
int mode)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
|
@ -9,11 +30,11 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
+ DWORD dwDesiredAccess = 0;
|
||||
+ DWORD dwFlagsAndAttributes = 0;
|
||||
+ DWORD dwDisposition = OPEN_EXISTING;
|
||||
+ DWORD dwSharedAccess = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
|
||||
+ DWORD dwSharedAccess = FILE_SHARE_READ | FILE_SHARE_DELETE;
|
||||
wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
|
||||
int retval;
|
||||
int save_errno;
|
||||
@@ -202,12 +207,114 @@
|
||||
@@ -768,12 +773,114 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -29,45 +50,45 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
+ {
|
||||
+ /* Equates to _O_RDONLY */
|
||||
+ if (flags & _O_TRUNC)
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ g_free (wfilename);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ g_free (wfilename);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
- g_free (wfilename);
|
||||
+ dwDesiredAccess |= GENERIC_READ;
|
||||
+ dwSharedAccess |= FILE_SHARE_WRITE;
|
||||
+ dwDesiredAccess |= GENERIC_READ;
|
||||
+ dwSharedAccess |= FILE_SHARE_WRITE;
|
||||
+ }
|
||||
+ if (flags & _O_WRONLY)
|
||||
+ {
|
||||
+ if (flags & _O_RDWR)
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ g_free (wfilename);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
+ dwDesiredAccess |= GENERIC_WRITE;
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ g_free (wfilename);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ dwDesiredAccess |= GENERIC_WRITE;
|
||||
+ }
|
||||
+ if (flags & _O_RDWR)
|
||||
+ {
|
||||
+ dwDesiredAccess |= GENERIC_READ;
|
||||
+ dwDesiredAccess |= GENERIC_WRITE;
|
||||
+ dwDesiredAccess |= GENERIC_READ;
|
||||
+ dwDesiredAccess |= GENERIC_WRITE;
|
||||
+ }
|
||||
+ if (flags & _O_TRUNC)
|
||||
+ {
|
||||
+ if (flags & _O_CREAT)
|
||||
+ dwDisposition = CREATE_ALWAYS;
|
||||
+ else
|
||||
+ dwDisposition = TRUNCATE_EXISTING;
|
||||
+ dwDisposition = CREATE_ALWAYS;
|
||||
+ else
|
||||
+ dwDisposition = TRUNCATE_EXISTING;
|
||||
+ }
|
||||
+ if ((flags & _O_CREAT) && !(flags & _O_TRUNC))
|
||||
+ {
|
||||
+ if (flags & _O_EXCL)
|
||||
+ dwDisposition = CREATE_NEW;
|
||||
+ else
|
||||
+ dwDisposition = OPEN_ALWAYS;
|
||||
+ dwDisposition = CREATE_NEW;
|
||||
+ else
|
||||
+ dwDisposition = OPEN_ALWAYS;
|
||||
+ }
|
||||
+ if (flags & _O_CREAT)
|
||||
+ {
|
||||
|
@ -112,7 +133,7 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
+ }
|
||||
+ 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 */
|
||||
|
@ -131,7 +152,7 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
return retval;
|
||||
#else
|
||||
int fd;
|
||||
@@ -254,6 +361,8 @@
|
||||
@@ -821,6 +928,8 @@
|
||||
int mode)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
|
@ -140,7 +161,7 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
|
||||
int retval;
|
||||
int save_errno;
|
||||
@@ -264,12 +373,41 @@
|
||||
@@ -831,12 +940,41 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -185,12 +206,13 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
return retval;
|
||||
#else
|
||||
return creat (filename, mode);
|
||||
@@ -702,33 +840,102 @@
|
||||
@@ -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;
|
||||
-
|
||||
|
@ -200,7 +222,9 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- wmode = g_utf8_to_utf16 (mode, -1, NULL, NULL, NULL);
|
||||
- mode2 = _g_win32_get_mode_alias (mode);
|
||||
- wmode = g_utf8_to_utf16 (mode2, -1, NULL, NULL, NULL);
|
||||
- g_free (mode2);
|
||||
-
|
||||
- if (wmode == NULL)
|
||||
- {
|
||||
|
@ -208,12 +232,6 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
- errno = EINVAL;
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- retval = _wfopen (wfilename, wmode);
|
||||
- save_errno = errno;
|
||||
-
|
||||
- g_free (wfilename);
|
||||
- g_free (wmode);
|
||||
+ int hFile;
|
||||
+ int flags = 0;
|
||||
+ gchar priv_mode[4];
|
||||
|
@ -226,7 +244,7 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
+ }
|
||||
+ if ((strlen(mode) < 1) || (strlen(mode) > 3))
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ errno - EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
|
@ -253,10 +271,10 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
+ else if (0 == strcmp(priv_mode, "w+t"))
|
||||
+ flags = _O_RDWR | _O_CREAT |_O_TRUNC | _O_TEXT;
|
||||
+ else
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (2 == strlen(priv_mode))
|
||||
|
@ -280,10 +298,10 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
+ else if (0 == strcmp(priv_mode, "wt"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_TRUNC | _O_TEXT;
|
||||
+ else
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (1 == strlen(priv_mode))
|
||||
|
@ -295,14 +313,18 @@ diff -Naur glib-2.46.0-orig/glib/gstdio.c glib-2.46.0/glib/gstdio.c
|
|||
+ else if (0 == strcmp(priv_mode, "w"))
|
||||
+ flags = _O_WRONLY | _O_CREAT | _O_TRUNC;
|
||||
+ else if ( !((0 == strcmp(priv_mode, "c")) || (0 == strcmp(priv_mode, "n"))))
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ {
|
||||
+ errno = EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
||||
- retval = _wfopen (wfilename, wmode);
|
||||
- save_errno = errno;
|
||||
+ hFile = g_open (filename, flags, (_S_IREAD | _S_IWRITE));
|
||||
+
|
||||
|
||||
- g_free (wfilename);
|
||||
- g_free (wmode);
|
||||
+ if (INVALID_HANDLE_VALUE == (HANDLE)hFile)
|
||||
+ /* 'errno' will have already been set by 'g_open()' */
|
||||
+ retval = NULL;
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
From b7789bb144ff4545021fbd95ee93c98ec706891a Mon Sep 17 00:00:00 2001
|
||||
From: Nicola Murino <nicola.murino@gmail.com>
|
||||
Date: Fri, 17 Aug 2018 17:04:07 +0200
|
||||
Subject: [PATCH] gsocket: fix cross compilation
|
||||
|
||||
for some reason when cross compiling for windows BROKEN_IP_MREQ_SOURCE_STRUCT is defined but should not
|
||||
---
|
||||
gio/gsocket.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gio/gsocket.c b/gio/gsocket.c
|
||||
index 859e807cb..71a97b8cf 100644
|
||||
--- a/gio/gsocket.c
|
||||
+++ b/gio/gsocket.c
|
||||
@@ -2404,7 +2404,7 @@ g_socket_multicast_group_operation_ssm (GSocket *socket,
|
||||
memset (&mc_req_src, 0, sizeof (mc_req_src));
|
||||
|
||||
/* By default use the default IPv4 multicast interface. */
|
||||
- S_ADDR_FIELD(mc_req_src) = g_htonl (INADDR_ANY);
|
||||
+ mc_req_src.imr_interface.s_addr = g_htonl (INADDR_ANY);
|
||||
|
||||
if (iface)
|
||||
{
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,253 +0,0 @@
|
|||
diff -Naur glib-2.46.0-orig/glib/gbacktrace.c glib-2.46.0/glib/gbacktrace.c
|
||||
--- glib-2.46.0-orig/glib/gbacktrace.c 2014-12-20 00:49:48.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gbacktrace.c 2015-09-22 09:08:59.311126700 +0300
|
||||
@@ -254,7 +254,7 @@
|
||||
if (IsDebuggerPresent ())
|
||||
G_BREAKPOINT ();
|
||||
else
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
#endif
|
||||
}
|
||||
|
||||
diff -Naur glib-2.46.0-orig/glib/giowin32.c glib-2.46.0/glib/giowin32.c
|
||||
--- glib-2.46.0-orig/glib/giowin32.c 2014-12-20 00:49:48.000000000 +0300
|
||||
+++ glib-2.46.0/glib/giowin32.c 2015-09-22 09:08:59.357921600 +0300
|
||||
@@ -798,7 +798,7 @@
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
if (channel->debug)
|
||||
g_print ("\n");
|
||||
@@ -945,7 +945,7 @@
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1010,7 +1010,7 @@
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
if (channel->debug)
|
||||
g_print ("\n");
|
||||
@@ -1295,7 +1295,7 @@
|
||||
default:
|
||||
whence = -1; /* Keep the compiler quiet */
|
||||
g_assert_not_reached ();
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
tmp_offset = offset;
|
||||
@@ -1690,7 +1690,7 @@
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
/* always open 'untranslated' */
|
||||
@@ -1736,7 +1736,7 @@
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
return channel;
|
||||
@@ -2225,7 +2225,7 @@
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
fd->events = condition;
|
||||
diff -Naur glib-2.46.0-orig/glib/gmessages.c glib-2.46.0/glib/gmessages.c
|
||||
--- glib-2.46.0-orig/glib/gmessages.c 2015-09-21 06:33:23.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gmessages.c 2015-09-22 09:08:59.373519900 +0300
|
||||
@@ -323,7 +323,7 @@
|
||||
if (breakpoint)
|
||||
G_BREAKPOINT ();
|
||||
else
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
@@ -1176,7 +1176,7 @@
|
||||
line,
|
||||
pretty_function);
|
||||
_g_log_abort (FALSE);
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
/**
|
||||
diff -Naur glib-2.46.0-orig/glib/gslice.c glib-2.46.0/glib/gslice.c
|
||||
--- glib-2.46.0-orig/glib/gslice.c 2015-09-08 20:40:27.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gslice.c 2015-09-22 09:08:59.404716500 +0300
|
||||
@@ -1082,7 +1082,7 @@
|
||||
return;
|
||||
if (G_UNLIKELY (allocator->config.debug_blocks) &&
|
||||
!smc_notify_free (mem_block, mem_size))
|
||||
- abort();
|
||||
+ g_abort();
|
||||
if (G_LIKELY (acat == 1)) /* allocate through magazine layer */
|
||||
{
|
||||
ThreadMemory *tmem = thread_memory_from_self();
|
||||
@@ -1165,7 +1165,7 @@
|
||||
slice = *(gpointer*) (current + next_offset);
|
||||
if (G_UNLIKELY (allocator->config.debug_blocks) &&
|
||||
!smc_notify_free (current, mem_size))
|
||||
- abort();
|
||||
+ g_abort();
|
||||
if (G_UNLIKELY (thread_memory_magazine2_is_full (tmem, ix)))
|
||||
{
|
||||
thread_memory_swap_magazines (tmem, ix);
|
||||
@@ -1186,7 +1186,7 @@
|
||||
slice = *(gpointer*) (current + next_offset);
|
||||
if (G_UNLIKELY (allocator->config.debug_blocks) &&
|
||||
!smc_notify_free (current, mem_size))
|
||||
- abort();
|
||||
+ g_abort();
|
||||
if (G_UNLIKELY (g_mem_gc_friendly))
|
||||
memset (current, 0, chunk_size);
|
||||
slab_allocator_free_chunk (chunk_size, current);
|
||||
@@ -1200,7 +1200,7 @@
|
||||
slice = *(gpointer*) (current + next_offset);
|
||||
if (G_UNLIKELY (allocator->config.debug_blocks) &&
|
||||
!smc_notify_free (current, mem_size))
|
||||
- abort();
|
||||
+ g_abort();
|
||||
if (G_UNLIKELY (g_mem_gc_friendly))
|
||||
memset (current, 0, mem_size);
|
||||
g_free (current);
|
||||
@@ -1436,7 +1436,7 @@
|
||||
vfprintf (stderr, format, args);
|
||||
va_end (args);
|
||||
fputs ("\n", stderr);
|
||||
- abort();
|
||||
+ g_abort();
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
diff -Naur glib-2.46.0-orig/glib/gtester.c glib-2.46.0/glib/gtester.c
|
||||
--- glib-2.46.0-orig/glib/gtester.c 2014-12-20 00:49:48.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gtester.c 2015-09-22 09:08:59.420314800 +0300
|
||||
@@ -94,7 +94,7 @@
|
||||
terminate (void)
|
||||
{
|
||||
kill (getpid(), SIGTERM);
|
||||
- abort();
|
||||
+ g_abort();
|
||||
}
|
||||
|
||||
static void
|
||||
diff -Naur glib-2.46.0-orig/glib/gtestutils.c glib-2.46.0/glib/gtestutils.c
|
||||
--- glib-2.46.0-orig/glib/gtestutils.c 2015-09-01 06:34:13.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gtestutils.c 2015-09-22 09:08:59.576297800 +0300
|
||||
@@ -846,7 +846,7 @@
|
||||
{
|
||||
if (test_tap_log)
|
||||
g_print ("Bail out!\n");
|
||||
- abort();
|
||||
+ g_abort();
|
||||
}
|
||||
if (result == G_TEST_RUN_SKIPPED)
|
||||
test_skipped_count++;
|
||||
@@ -2426,7 +2426,7 @@
|
||||
_exit (1);
|
||||
}
|
||||
else
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2451,7 +2451,7 @@
|
||||
if (test_in_subprocess)
|
||||
_exit (1);
|
||||
else
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
void
|
||||
diff -Naur glib-2.46.0-orig/glib/gthread-posix.c glib-2.46.0/glib/gthread-posix.c
|
||||
--- glib-2.46.0-orig/glib/gthread-posix.c 2015-08-19 06:35:30.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gthread-posix.c 2015-09-22 09:08:59.560699500 +0300
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "gmessages.h"
|
||||
#include "gstrfuncs.h"
|
||||
#include "gmain.h"
|
||||
+#include "gutils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -77,7 +78,7 @@
|
||||
{
|
||||
fprintf (stderr, "GLib (gthread-posix.c): Unexpected error from C library during '%s': %s. Aborting.\n",
|
||||
function, strerror (status));
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
/* {{{1 GMutex */
|
||||
diff -Naur glib-2.46.0-orig/glib/gthread-win32.c glib-2.46.0/glib/gthread-win32.c
|
||||
--- glib-2.46.0-orig/glib/gthread-win32.c 2014-12-20 00:49:48.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gthread-win32.c 2015-09-22 09:08:59.467109700 +0300
|
||||
@@ -58,7 +58,7 @@
|
||||
{
|
||||
fprintf (stderr, "GLib (gthread-win32.c): Unexpected error from C library during '%s': %s. Aborting.\n",
|
||||
strerror (status), function);
|
||||
- abort ();
|
||||
+ g_abort ();
|
||||
}
|
||||
|
||||
/* Starting with Vista and Windows 2008, we have access to the
|
||||
diff -Naur glib-2.46.0-orig/glib/gutils.c glib-2.46.0/glib/gutils.c
|
||||
--- glib-2.46.0-orig/glib/gutils.c 2015-08-28 21:15:54.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gutils.c 2015-09-22 09:08:59.498306300 +0300
|
||||
@@ -2375,3 +2375,15 @@
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
+
|
||||
+/* Crashes the program. */
|
||||
+void
|
||||
+g_abort (void)
|
||||
+{
|
||||
+#ifdef G_OS_WIN32
|
||||
+ DebugBreak ();
|
||||
+ ExitProcess (127);
|
||||
+#else
|
||||
+ abort ();
|
||||
+#endif
|
||||
+}
|
||||
diff -Naur glib-2.46.0-orig/glib/gutils.h glib-2.46.0/glib/gutils.h
|
||||
--- glib-2.46.0-orig/glib/gutils.h 2015-08-21 03:20:48.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gutils.h 2015-09-22 09:08:59.529502900 +0300
|
||||
@@ -228,6 +228,9 @@
|
||||
GLIB_DEPRECATED_FOR(g_format_size)
|
||||
gchar *g_format_size_for_display (goffset size);
|
||||
|
||||
+GLIB_AVAILABLE_IN_2_30
|
||||
+void g_abort (void);
|
||||
+
|
||||
#ifndef G_DISABLE_DEPRECATED
|
||||
/**
|
||||
* GVoidFunc:
|
|
@ -1,23 +0,0 @@
|
|||
diff -Naur glib-2.46.0-orig/glib/gnulib/printf.c glib-2.46.0/glib/gnulib/printf.c
|
||||
--- glib-2.46.0-orig/glib/gnulib/printf.c 2014-12-20 00:49:48.000000000 +0300
|
||||
+++ glib-2.46.0/glib/gnulib/printf.c 2015-09-22 09:09:03.834633700 +0300
|
||||
@@ -88,16 +88,16 @@
|
||||
int _g_gnulib_vfprintf (FILE *file, char const *format, va_list args)
|
||||
{
|
||||
char *result;
|
||||
- size_t length;
|
||||
+ size_t length, rlength;
|
||||
|
||||
result = vasnprintf (NULL, &length, format, args);
|
||||
if (result == NULL)
|
||||
return -1;
|
||||
|
||||
- fwrite (result, 1, length, file);
|
||||
+ rlength = fwrite (result, 1, length, file);
|
||||
free (result);
|
||||
|
||||
- return length;
|
||||
+ return rlength;
|
||||
}
|
||||
|
||||
int _g_gnulib_vsprintf (char *string, char const *format, va_list args)
|
|
@ -1,20 +0,0 @@
|
|||
diff -Naur glib-2.46.0-orig/gio/gsocket.c glib-2.46.0/gio/gsocket.c
|
||||
--- glib-2.46.0-orig/gio/gsocket.c 2015-08-31 16:08:34.000000000 +0300
|
||||
+++ glib-2.46.0/gio/gsocket.c 2015-09-22 09:09:04.614548700 +0300
|
||||
@@ -1951,7 +1951,7 @@
|
||||
|
||||
#if !defined(HAVE_IF_NAMETOINDEX) && defined(G_OS_WIN32)
|
||||
static guint
|
||||
-if_nametoindex (const gchar *iface)
|
||||
+w32_if_nametoindex (const gchar *iface)
|
||||
{
|
||||
PIP_ADAPTER_ADDRESSES addresses = NULL, p;
|
||||
gulong addresses_len = 0;
|
||||
@@ -2004,6 +2004,7 @@
|
||||
}
|
||||
|
||||
#define HAVE_IF_NAMETOINDEX 1
|
||||
+#define if_nametoindex w32_if_nametoindex
|
||||
#endif
|
||||
|
||||
static gboolean
|
|
@ -1,12 +0,0 @@
|
|||
diff -Naur glib-2.46.0-orig/gio/glocalfileinfo.c glib-2.46.0/gio/glocalfileinfo.c
|
||||
--- glib-2.46.0-orig/gio/glocalfileinfo.c 2015-08-21 08:00:49.000000000 +0300
|
||||
+++ glib-2.46.0/gio/glocalfileinfo.c 2015-09-22 09:09:05.410062000 +0300
|
||||
@@ -1232,7 +1232,7 @@
|
||||
(symlink_broken || (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS)))
|
||||
return g_content_type_from_mime_type ("inode/symlink");
|
||||
else if (statbuf != NULL && S_ISDIR(statbuf->st_mode))
|
||||
- return g_content_type_from_mime_type ("inode/directory");
|
||||
+ return g_strdup ("inode/directory");
|
||||
#ifndef G_OS_WIN32
|
||||
else if (statbuf != NULL && S_ISCHR(statbuf->st_mode))
|
||||
return g_content_type_from_mime_type ("inode/chardevice");
|
|
@ -1,81 +1,63 @@
|
|||
# Maintainer: drakkan <nicola.murino at gmail dot com>
|
||||
# Contributor: Filip Brcic <brcha@gna.org>
|
||||
# Contributor: ant32 <antreimer@gmail.com>
|
||||
# Contributor: Renato Silva <br.renatosilva@gmail.com>
|
||||
# Contributor: Martchus <martchus@gmx.net>
|
||||
|
||||
pkgname=mingw-w64-glib2
|
||||
pkgver=2.48.2
|
||||
pkgver=2.58.0
|
||||
pkgrel=1
|
||||
_commit=f0b57dd7a80425264e318f85c331a039a3cddd87 # tags/2.58.0
|
||||
arch=(any)
|
||||
pkgdesc="Common C routines used by GTK+ and other libs (mingw-w64)"
|
||||
depends=(mingw-w64-gettext mingw-w64-zlib mingw-w64-libffi mingw-w64-pcre mingw-w64-freetype2)
|
||||
makedepends=(mingw-w64-configure python)
|
||||
license=("LGPL")
|
||||
pkgdesc="Low level core library (mingw-w64)"
|
||||
depends=(mingw-w64-libffi mingw-w64-pcre mingw-w64-gettext mingw-w64-zlib)
|
||||
makedepends=(mingw-w64-meson git)
|
||||
license=("LGPL2.1")
|
||||
options=(!strip !buildflags staticlibs !emptydirs)
|
||||
url="http://www.gtk.org/"
|
||||
source=("http://ftp.gnome.org/pub/GNOME/sources/glib/${pkgver%.*}/glib-$pkgver.tar.xz"
|
||||
"0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch"
|
||||
"0003-g_abort.all.patch"
|
||||
"0004-glib-prefer-constructors-over-DllMain.patch"
|
||||
"0027-no_sys_if_nametoindex.patch"
|
||||
"0028-inode_directory.patch"
|
||||
"revert-warn-glib-compile-schemas.patch"
|
||||
"use-pkgconfig-file-for-intl.patch")
|
||||
sha256sums=('f25e751589cb1a58826eac24fbd4186cda4518af772806b666a3f91f66e6d3f4'
|
||||
'ef81e82e15fb3a71bad770be17fe4fea3f4d9cdee238d6caa39807eeea5da3e3'
|
||||
'1b24cc928f69f73599f83269a7b3eb7bf7efbe114109251e6765053a1e1f4cd6'
|
||||
'7b099af0c562f397458542482d6d1debe437f220762aa2ed94b2e6c4d43dd8a6'
|
||||
'5cb481295ff86c2802030984d8b2bf6a3b1dcd5e5fe7b0be68b22d9116305837'
|
||||
'f7f06a90156fe0a308412512c359072922f7f0d19dd4bed30d863db18e48940b'
|
||||
'049240975cd2f1c88fbe7deb28af14d4ec7d2640495f7ca8980d873bb710cc97'
|
||||
'1991eaa0471ff8d0b3dd3bccccd560ca6cc8c0995c6145b9bc93d5e90755e3f4')
|
||||
url="https://wiki.gnome.org/Projects/GLib"
|
||||
source=("git+https://gitlab.gnome.org/GNOME/glib.git#commit=$_commit"
|
||||
"0001-gsocket-fix-cross-compilation.patch"
|
||||
"0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch"
|
||||
"glib-formaterror.patch"
|
||||
"glib-include-time-h-for-localtime_r.patch"
|
||||
"glib-prefer-constructors-over-DllMain.patch")
|
||||
sha256sums=('SKIP'
|
||||
'44c8c6b4ca376177a8c333a00c3485d638f8641967503e15364606d4c4292ff3'
|
||||
'afd62a852a0b6aed4ce86eb97297e5080b26055cc878413b89d482c184b826b3'
|
||||
'ea529d5cbf8cf7ca66467664a3ead37473a1c009ac973d5694b06cc9d0b23df3'
|
||||
'ac567f7a9cad51ab97dba70bcdd6c0c16f93d2451c43fde380e4fdb20b2d4b31'
|
||||
'8a02502069fa88c667a4fd1599280f927cb1bcf61e9fcd369fec5bdb5440d480')
|
||||
|
||||
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
|
||||
|
||||
pkgver() {
|
||||
cd glib
|
||||
git describe --tags | sed 's/-/+/g'
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd glib-$pkgver
|
||||
patch -Np1 -i .."/0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch"
|
||||
patch -Np1 -i .."/0003-g_abort.all.patch"
|
||||
patch -Np1 -i ../0004-glib-prefer-constructors-over-DllMain.patch
|
||||
patch -Np1 -i ../"0027-no_sys_if_nametoindex.patch"
|
||||
patch -Np1 -i ../"0028-inode_directory.patch"
|
||||
patch -Rp1 -i ../revert-warn-glib-compile-schemas.patch
|
||||
# Use pkgconfig file for intl dependency, otherwise transitive dependency
|
||||
# iconv is not added correctly when using pkgconfig --static flag
|
||||
patch -p0 -i ../use-pkgconfig-file-for-intl.patch
|
||||
NOCONFIGURE=1 ./autogen.sh
|
||||
cd glib
|
||||
patch -Np1 -i ../0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch
|
||||
patch -Np1 -i ../glib-prefer-constructors-over-DllMain.patch
|
||||
patch -Np1 -i ../glib-formaterror.patch
|
||||
patch -Np1 -i ../glib-include-time-h-for-localtime_r.patch
|
||||
patch -Np1 -i ../0001-gsocket-fix-cross-compilation.patch
|
||||
}
|
||||
|
||||
|
||||
build() {
|
||||
cd glib-$pkgver
|
||||
conf="--with-pcre=system --with-threads=win32 --disable-fam"
|
||||
for _arch in ${_architectures}; do
|
||||
mkdir -p build-${_arch}-static && pushd build-${_arch}-static
|
||||
${_arch}-configure \
|
||||
--disable-shared $conf
|
||||
make
|
||||
popd
|
||||
|
||||
mkdir -p build-${_arch}-shared && pushd build-${_arch}-shared
|
||||
${_arch}-configure \
|
||||
--disable-static $conf
|
||||
make
|
||||
popd
|
||||
mkdir -p "${srcdir}/glib/build-${_arch}"
|
||||
cd "${srcdir}/glib/build-${_arch}"
|
||||
${_arch}-meson \
|
||||
--default-library both ..
|
||||
ninja
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
package() {
|
||||
for _arch in ${_architectures}; do
|
||||
cd "$srcdir/glib-$pkgver/build-${_arch}-shared"
|
||||
make DESTDIR="$pkgdir" install
|
||||
make -C "$srcdir/glib-$pkgver/build-${_arch}-static" DESTDIR="$pkgdir/static" install
|
||||
mv "$pkgdir/static/usr/${_arch}/lib/"*.a "$pkgdir/usr/${_arch}/lib/"
|
||||
find "$pkgdir/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip {} \;
|
||||
find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
|
||||
find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
|
||||
rm "$pkgdir/usr/${_arch}/bin/"{glib-{gettextize,mkenums},gdbus-codegen}
|
||||
rm -r "$pkgdir/usr/${_arch}/lib/charset.alias"
|
||||
rm -r "$pkgdir/static"
|
||||
DESTDIR="${pkgdir}" ninja -C "${srcdir}/glib/build-${_arch}" install
|
||||
done
|
||||
}
|
||||
|
||||
# vim: ts=2 sw=2 et:
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
--- 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])
|
||||
+ -Werror=pointer-arith -Werror=init-self -Wno-error=format-security \
|
||||
+ -Wno-error=format=2 -Werror=missing-include-dirs])
|
||||
])
|
||||
AC_SUBST(GLIB_WARN_CFLAGS)
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
--- glib-2.43.2/glib/gdate.c.orig 2015-01-01 23:50:04.203252143 +0100
|
||||
+++ glib-2.43.2/glib/gdate.c 2015-01-01 23:50:28.329647373 +0100
|
||||
@@ -41,6 +41,7 @@
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#include <windows.h>
|
||||
+#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "gdate.h"
|
|
@ -0,0 +1,76 @@
|
|||
From bc90511c1eb333e26e0bc0eaee62375d0e788db6 Mon Sep 17 00:00:00 2001
|
||||
From: Erik van Pienbroek <epienbro@fedoraproject.org>
|
||||
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 | 22 ++++++++++++++--------
|
||||
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
|
||||
@@ -272,12 +272,14 @@
|
||||
|
||||
#if defined (G_OS_WIN32)
|
||||
|
||||
+HMODULE glib_dll = NULL;
|
||||
+
|
||||
+#if defined (DLL_EXPORT)
|
||||
+
|
||||
BOOL WINAPI DllMain (HINSTANCE hinstDLL,
|
||||
DWORD fdwReason,
|
||||
LPVOID lpvReserved);
|
||||
|
||||
-HMODULE glib_dll;
|
||||
-
|
||||
BOOL WINAPI
|
||||
DllMain (HINSTANCE hinstDLL,
|
||||
DWORD fdwReason,
|
||||
@@ -287,13 +289,6 @@
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
glib_dll = hinstDLL;
|
||||
- g_clock_win32_init ();
|
||||
-#ifdef THREADS_WIN32
|
||||
- g_thread_win32_init ();
|
||||
-#endif
|
||||
- glib_init ();
|
||||
- /* must go after glib_init */
|
||||
- g_console_win32_init ();
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
@@ -317,7 +312,10 @@
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
-#elif defined (G_HAS_CONSTRUCTORS)
|
||||
+#endif /* defined (DLL_EXPORT) */
|
||||
+#endif /* defined (G_OS_WIN32) */
|
||||
+
|
||||
+#if defined (G_HAS_CONSTRUCTORS)
|
||||
|
||||
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
|
||||
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(glib_init_ctor)
|
||||
@@ -327,7 +325,15 @@
|
||||
static void
|
||||
glib_init_ctor (void)
|
||||
{
|
||||
+#if defined (G_OS_WIN32)
|
||||
+ g_clock_win32_init ();
|
||||
+#ifdef THREADS_WIN32
|
||||
+ g_thread_win32_init ();
|
||||
+#endif /* defined (THREADS_WIN32) */
|
||||
+#endif /* defined (G_OS_WIN32) */
|
||||
glib_init ();
|
||||
+ /* must go after glib_init */
|
||||
+ g_console_win32_init ();
|
||||
}
|
||||
|
||||
#else
|
|
@ -1,33 +0,0 @@
|
|||
From 6560b37450cd19c4a7c7b690e279fe97b7bfdcaa Mon Sep 17 00:00:00 2001
|
||||
From: Ryan Lortie <desrt@desrt.ca>
|
||||
Date: Thu, 12 Apr 2012 23:55:34 +0000
|
||||
Subject: glib-compile-schemas: warn about bad dconf paths
|
||||
|
||||
For quite some time the recommended usage of GSettings and dconf has
|
||||
been to use paths like /org/gnome/example/. Use of /apps/ has spilled
|
||||
over from GConf and is continuing to make its way into a number of
|
||||
applications as they port.
|
||||
|
||||
glib-compile-schemas will now warn about these types of paths being
|
||||
used. This generates a lot of noise, but hopefully it will reduce the
|
||||
number of ported applications making this mistake.
|
||||
---
|
||||
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
|
||||
index cf02389..27d0181 100644
|
||||
--- a/gio/glib-compile-schemas.c
|
||||
+++ b/gio/glib-compile-schemas.c
|
||||
@@ -1204,6 +1204,12 @@ parse_state_start_schema (ParseState *state,
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (path && (g_str_has_prefix (path, "/apps/") ||
|
||||
+ g_str_has_prefix (path, "/desktop/") ||
|
||||
+ g_str_has_prefix (path, "/system/")))
|
||||
+ g_printerr ("warning: Schema '%s' has path '%s'. Paths starting with "
|
||||
+ "'/apps/', '/desktop/' or '/system/' are deprecated.\n", id, path);
|
||||
+
|
||||
state->schema_state = schema_state_new (path, gettext_domain,
|
||||
extends, extends_name, list_of);
|
||||
|
||||
--
|
||||
cgit v0.9.0.2
|
|
@ -1,23 +0,0 @@
|
|||
--- glib-2.0.pc.in.orig 2015-03-23 04:22:18.000000000 +0100
|
||||
+++ glib-2.0.pc.in 2016-08-12 21:31:44.654422794 +0200
|
||||
@@ -10,7 +10,8 @@
|
||||
Name: GLib
|
||||
Description: C Utility Library
|
||||
Version: @VERSION@
|
||||
-Requires.private: @PCRE_REQUIRES@
|
||||
+Requires: @INTL_REQUIRES@
|
||||
+Requires.private: @PCRE_REQUIRES@ @INTL_REQUIRES@
|
||||
Libs: -L${libdir} -lglib-2.0 @INTLLIBS@
|
||||
Libs.private: @G_THREAD_LIBS@ @G_LIBS_EXTRA@ @PCRE_LIBS@ @INTLLIBS@ @ICONV_LIBS@ @CARBON_LIBS@ @COCOA_LIBS@
|
||||
Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include @GLIB_EXTRA_CFLAGS@
|
||||
--- configure.ac.orig 2016-05-10 11:05:39.000000000 +0200
|
||||
+++ configure.ac 2016-08-12 21:39:53.980926453 +0200
|
||||
@@ -472,6 +472,8 @@
|
||||
fi
|
||||
|
||||
LIBS="$INTLLIBS $LIBS"
|
||||
+INTL_REQUIRES=intl
|
||||
+AC_SUBST(INTL_REQUIRES)
|
||||
|
||||
GETTEXT_PACKAGE=glib20
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
Loading…
Reference in New Issue