import mingw-glib2-2.66.7-2.el8

This commit is contained in:
CentOS Sources 2021-11-09 04:56:39 -05:00 committed by Stepan Oksanichenko
parent 5e8da4c7be
commit 0e04887a1e
6 changed files with 91 additions and 75 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/glib-2.56.1.tar.xz
SOURCES/glib-2.66.7.tar.xz

View File

@ -1 +1 @@
4db098c15b9d57c37bb504a6f58ebe717994e6f2 SOURCES/glib-2.56.1.tar.xz
734a6f1e1edb2292d08e658bfe7f49b41c7eb0c9 SOURCES/glib-2.66.7.tar.xz

View File

@ -1,13 +0,0 @@
diff --git a/gio/gdbus-2.0/codegen/codegen_main.py b/gio/gdbus-2.0/codegen/codegen_main.py
index 9d9099f..1cfe7c1 100755
--- a/gio/gdbus-2.0/codegen/codegen_main.py
+++ b/gio/gdbus-2.0/codegen/codegen_main.py
@@ -209,7 +209,7 @@ def codegen_main():
print_error('Using --body requires --output')
c_file = args.output
- header_name = os.path.splitext(c_file)[0] + '.h'
+ header_name = os.path.splitext(os.path.basename(c_file))[0] + '.h'
all_ifaces = []
for fname in args.files + args.xml_files:

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,
@@ -1045,6 +1045,11 @@ g_open (const gchar *filename,
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,
@@ -1055,12 +1060,114 @@ g_open (const gchar *filename,
return -1;
}
@ -152,7 +152,7 @@ index 6d763e1..c1d072f 100644
return retval;
#else
int fd;
@@ -248,6 +355,8 @@ g_creat (const gchar *filename,
@@ -1108,6 +1215,8 @@ g_creat (const gchar *filename,
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,
@@ -1118,12 +1227,41 @@ g_creat (const gchar *filename,
return -1;
}
@ -206,7 +206,7 @@ index 6d763e1..c1d072f 100644
return retval;
#else
return creat (filename, mode);
@@ -699,33 +837,102 @@ g_fopen (const gchar *filename,
@@ -1565,34 +1703,102 @@ g_fopen (const gchar *filename,
const gchar *mode)
{
#ifdef G_OS_WIN32
@ -216,6 +216,28 @@ index 6d763e1..c1d072f 100644
- int save_errno;
-
- 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];
@ -241,9 +263,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 +281,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 +308,7 @@ index 6d763e1..c1d072f 100644
+ errno = EINVAL;
+ goto out;
+ }
}
+ }
+ }
+ if (1 == strlen(priv_mode))
+ {
@ -311,20 +324,15 @@ index 6d763e1..c1d072f 100644
+ 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

View File

@ -33,15 +33,18 @@ index 0032ee8..dd6ccbf 100644
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
@@ -238,11 +240,6 @@ DllMain (HINSTANCE hinstDLL,
@@ -238,14 +240,6 @@ DllMain (HINSTANCE hinstDLL,
{
case DLL_PROCESS_ATTACH:
glib_dll = hinstDLL;
- g_crash_handler_win32_init ();
- 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:
@ -57,7 +60,7 @@ index 0032ee8..dd6ccbf 100644
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(glib_init_ctor)
@@ -269,6 +269,12 @@ G_DEFINE_CONSTRUCTOR(glib_init_ctor)
@@ -269,7 +266,15 @@ G_DEFINE_CONSTRUCTOR(glib_init_ctor)
static void
glib_init_ctor (void)
{
@ -68,7 +71,10 @@ index 0032ee8..dd6ccbf 100644
+#endif /* defined (THREADS_WIN32) */
+#endif /* defined (G_OS_WIN32) */
glib_init ();
+ /* must go after glib_init */
+ g_console_win32_init ();
}
#else
--
1.8.2

View File

@ -4,7 +4,7 @@
%global __python %{__python3}
Name: mingw-glib2
Version: 2.56.1
Version: 2.66.7
Release: 2%{?dist}
Summary: MinGW Windows GLib2 library
@ -17,7 +17,11 @@ Source0: http://download.gnome.org/sources/glib/%{release_version}/glib-%
BuildArch: noarch
ExclusiveArch: %{ix86} x86_64
BuildRequires: mingw32-filesystem >= 95
BuildRequires: meson
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: mingw32-filesystem >= 104
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
BuildRequires: mingw32-win-iconv
@ -26,7 +30,7 @@ BuildRequires: mingw32-libffi
BuildRequires: mingw32-pcre
BuildRequires: mingw32-zlib
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-filesystem >= 104
BuildRequires: mingw64-gcc
BuildRequires: mingw64-binutils
BuildRequires: mingw64-win-iconv
@ -41,10 +45,6 @@ BuildRequires: gettext
BuildRequires: glib2-devel >= 2.45.3
BuildRequires: python3-devel
# Include upstream patch to fix gdbus-codegen when used with meson 0.46
# https://gitlab.gnome.org/GNOME/glib/commit/cd1f82d8fc741a2203582c12cc21b4dacf7e1872
Patch0: 00-fix-gdbus-codegen.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=674214
Patch1: 0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch
@ -53,7 +53,7 @@ Patch1: 0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch
# http://lists.fedoraproject.org/pipermail/mingw/2013-March/006429.html
# http://lists.fedoraproject.org/pipermail/mingw/2013-March/006469.html
# https://bugzilla.gnome.org/show_bug.cgi?id=698118
Patch5: glib-prefer-constructors-over-DllMain.patch
Patch2: glib-prefer-constructors-over-DllMain.patch
%description
MinGW Windows Glib2 library.
@ -62,7 +62,8 @@ MinGW Windows Glib2 library.
%package -n mingw32-glib2
Summary: MinGW Windows Glib2 library for the win32 target
# glib-genmarshal and glib-mkenums are written in Python
Requires: python3
# plataform-python due: https://bugzilla.redhat.com/show_bug.cgi?id=1633614
Requires: platform-python
%description -n mingw32-glib2
MinGW Windows Glib2 library.
@ -79,7 +80,8 @@ Static version of the MinGW Windows GLib2 library.
%package -n mingw64-glib2
Summary: MinGW Windows Glib2 library for the win64 target
# glib-genmarshal and glib-mkenums are written in Python
Requires: python3
# plataform-python due: https://bugzilla.redhat.com/show_bug.cgi?id=1633614
Requires: platform-python
%description -n mingw64-glib2
MinGW Windows Glib2 library.
@ -98,26 +100,17 @@ Static version of the MinGW Windows GLib2 library.
%prep
%setup -q -n glib-%{version}
%patch0 -p1
%patch1 -p1
%patch5 -p1
%patch2 -p1
%build
#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
MINGW_BUILDDIR_SUFFIX=_static %mingw_make %{?_smp_mflags} V=1
MINGW_BUILDDIR_SUFFIX=_shared %mingw_make %{?_smp_mflags} V=1
%mingw_meson --default-library=both \
--buildtype=release
%mingw_ninja
%install
MINGW_BUILDDIR_SUFFIX=_static %mingw_make install DESTDIR=$RPM_BUILD_ROOT/build_static
MINGW_BUILDDIR_SUFFIX=_shared %mingw_make install DESTDIR=$RPM_BUILD_ROOT
# Move the static libraries to the right location
mv $RPM_BUILD_ROOT/build_static%{mingw32_libdir}/*.a $RPM_BUILD_ROOT%{mingw32_libdir}
mv $RPM_BUILD_ROOT/build_static%{mingw64_libdir}/*.a $RPM_BUILD_ROOT%{mingw64_libdir}
export DESTDIR=$RPM_BUILD_ROOT
%mingw_ninja install
# There's a small difference in the file glibconfig.h between the
# shared and the static build:
@ -141,8 +134,6 @@ mv $RPM_BUILD_ROOT/build_static%{mingw64_libdir}/*.a $RPM_BUILD_ROOT%{mingw64_li
# and -DGOBJECT_STATIC_COMPILATION to their CFLAGS to avoid compile failures
# Drop the folder which was temporary used for installing the static bits
rm -rf $RPM_BUILD_ROOT/build_static
rm -f $RPM_BUILD_ROOT/%{mingw32_libdir}/charset.alias
rm -f $RPM_BUILD_ROOT/%{mingw64_libdir}/charset.alias
@ -177,6 +168,12 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%mingw_find_lang glib20
# Manually invoke the python byte compile macro for each path that needs byte
# compilation.
%py_byte_compile %{__python3} %{buildroot}%{mingw32_datadir}/glib-2.0/gdb
%py_byte_compile %{__python3} %{buildroot}%{mingw32_datadir}/glib-2.0/codegen
%py_byte_compile %{__python3} %{buildroot}%{mingw64_datadir}/glib-2.0/gdb
%py_byte_compile %{__python3} %{buildroot}%{mingw64_datadir}/glib-2.0/codegen
# Win32
%files -n mingw32-glib2 -f mingw32-glib20.lang
@ -194,6 +191,7 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%{mingw32_bindir}/gsettings.exe
%{mingw32_bindir}/gspawn-win32-helper-console.exe
%{mingw32_bindir}/gspawn-win32-helper.exe
%{mingw32_bindir}/gtester-report
%{mingw32_bindir}/libgio-2.0-0.dll
%{mingw32_bindir}/libglib-2.0-0.dll
%{mingw32_bindir}/libgmodule-2.0-0.dll
@ -202,8 +200,6 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%{mingw32_includedir}/glib-2.0/
%{mingw32_includedir}/gio-win32-2.0/
%{mingw32_libdir}/glib-2.0/
%dir %{mingw32_libdir}/gio/
%dir %{mingw32_libdir}/gio/modules/
%{mingw32_libdir}/libgio-2.0.dll.a
%{mingw32_libdir}/libglib-2.0.dll.a
%{mingw32_libdir}/libgmodule-2.0.dll.a
@ -246,6 +242,7 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%{mingw64_bindir}/gsettings.exe
%{mingw64_bindir}/gspawn-win64-helper-console.exe
%{mingw64_bindir}/gspawn-win64-helper.exe
%{mingw64_bindir}/gtester-report
%{mingw64_bindir}/libgio-2.0-0.dll
%{mingw64_bindir}/libglib-2.0-0.dll
%{mingw64_bindir}/libgmodule-2.0-0.dll
@ -254,8 +251,6 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%{mingw64_includedir}/glib-2.0/
%{mingw64_includedir}/gio-win32-2.0/
%{mingw64_libdir}/glib-2.0/
%dir %{mingw64_libdir}/gio/
%dir %{mingw64_libdir}/gio/modules/
%{mingw64_libdir}/libgio-2.0.dll.a
%{mingw64_libdir}/libglib-2.0.dll.a
%{mingw64_libdir}/libgmodule-2.0.dll.a
@ -284,6 +279,26 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%changelog
* Thu Aug 05 2021 Uri Lublin <uril@redhat.com> - 2.66.7-2
- Rebuilt
Resolves: rhbz#1939111 (CVE-2021-27219)
Resolves: rhbz#1935248
* Sun Feb 21 2021 Basil Salman <bsalman@redhat.com> - 2.66.7-1
- Update to 2.66.7
- Rebuild from newer version that fixes CVE-2021-27219
- Resolves: rhbz#1928649
* Tue Feb 16 2021 Basil Salman <bsalman@redhat.com> - 2.66.4-1
- Update to 2.66.4
- Dropped upstreamed patches
- Switched to meson
Resolves: rhbz#1928649
* Thu Sep 27 2018 Victor Toso <victortoso@redhat.com> - 2.56.1-3
- Use platform-python in Require
Related: rhbz#1633614
* Thu Aug 16 2018 Snir Sheriber <ssheribe@redhat.com> - 2.56.1-2
- ExclusiveArch: i686, x86_64
Related: rhbz#1615874