[packages/crossmingw32-glib2/meson] - updated to 2.60.0 - updated win32 patch - now uses meson build system

qboosh qboosh at pld-linux.org
Mon Mar 18 21:01:34 CET 2019


commit 83471978e30a45874071eeb6bcff7c68fb5606e0
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Mar 18 21:07:19 2019 +0100

    - updated to 2.60.0
    - updated win32 patch
    - now uses meson build system

 crossmingw32-glib2.spec | 110 +++++++++++++++++++++++++++---------------------
 glib2-win32.patch       |  82 ++++++++++++++++++++++++++++++++----
 2 files changed, 136 insertions(+), 56 deletions(-)
---
diff --git a/crossmingw32-glib2.spec b/crossmingw32-glib2.spec
index b438181..d45ba05 100644
--- a/crossmingw32-glib2.spec
+++ b/crossmingw32-glib2.spec
@@ -12,36 +12,36 @@ Summary(tr.UTF-8):	Yararlı ufak yordamlar kitaplığı
 Summary(zh_CN.UTF-8):	实用工具函数库
 %define		realname   glib
 Name:		crossmingw32-glib2
-Version:	2.58.3
-Release:	2
+Version:	2.60.0
+Release:	1
 License:	LGPL v2+
 Group:		Development/Libraries
-Source0:	http://ftp.gnome.org/pub/GNOME/sources/glib/2.58/glib-%{version}.tar.xz
-# Source0-md5:	8058c7bde846dcffe5fa453eca366d73
+Source0:	http://ftp.gnome.org/pub/GNOME/sources/glib/2.60/glib-%{version}.tar.xz
+# Source0-md5:	7d36520dda58de65027abf5b4fb1241a
 Patch0:		glib2-win32.patch
 URL:		http://www.gtk.org/
-BuildRequires:	autoconf >= 2.62
-BuildRequires:	automake >= 1:1.11
 BuildRequires:	crossmingw32-gcc
 BuildRequires:	crossmingw32-gettext
 BuildRequires:	crossmingw32-libffi >= 3.0.0
 BuildRequires:	crossmingw32-libiconv
-BuildRequires:	crossmingw32-pcre >= 8.13
+BuildRequires:	crossmingw32-pcre >= 8.31
 # rand_s()
 BuildRequires:	crossmingw32-runtime >= 1:4.0.3-2
 # SetThreadErrorMode and more
-BuildRequires:	crossmingw32-w32api >= 1:5.0.2-2
+BuildRequires:	crossmingw32-w32api >= 1:5.0.2-4
 BuildRequires:	crossmingw32-zlib
 # host glib-genmarshall and glib-compile-schemas are needed for cross-compiling
 BuildRequires:	glib2 >= 1:2.32.0
 BuildRequires:	gtk-doc >= 1.20
-BuildRequires:	libtool >= 2:2.2
+BuildRequires:	meson >= 0.50.0-2
+BuildRequires:	ninja
 BuildRequires:	pkgconfig >= 1:0.16
-BuildRequires:	python >= 1:2.5
+BuildRequires:	python3 >= 1:3.4
+BuildRequires:	rpmbuild(macros) >= 1.736
 BuildRequires:	tar >= 1:1.22
 BuildRequires:	xz
 Requires:	crossmingw32-gettext
-Requires:	crossmingw32-pcre >= 8.13
+Requires:	crossmingw32-pcre >= 8.31
 ExcludeArch:	i386
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -56,10 +56,9 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define		_libdir			%{_prefix}/lib
 %define		_pkgconfigdir		%{_prefix}/lib/pkgconfig
 %define		_dlldir			/usr/share/wine/windows/system
-%define		__cc			%{target}-gcc
-%define		__cxx			%{target}-g++
 %define		__pkgconfig_provides	%{nil}
 %define		__pkgconfig_requires	%{nil}
+# for meson 0.50+, keep __cc/__cxx as host compiler and pass %{target}-* in meson-cross.txt
 
 %ifnarch %{ix86}
 # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc.
@@ -123,53 +122,69 @@ arquivos de inclusão estão em glib-devel.
 Yararlı yordamlar kitaplığı. Geliştirme kitaplıkları ve başlık
 dosyaları glib-devel paketinde yer almaktadır.
 
+%package static
+Summary:	Static GLib 2 libraries (cross MinGW32 version)
+Summary(pl.UTF-8):	Statyczne biblioteki GLib 2 (wersja skrośna MinGW32)
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description static
+Static GLib 2 libraries (cross MinGW32 version).
+
+%description static -l pl.UTF-8
+Statyczne biblioteki GLib 2 (wersja skrośna MinGW32).
+
 %package dll
-Summary:	DLL glib2 libraries for Windows
-Summary(pl.UTF-8):	Biblioteki DLL glib2 dla Windows
+Summary:	DLL GLib 2 libraries for Windows
+Summary(pl.UTF-8):	Biblioteki DLL GLib 2 dla Windows
 Group:		Applications/Emulators
 Requires:	crossmingw32-gettext-dll
 Requires:	crossmingw32-libffi-dll >= 3.0.0
-Requires:	crossmingw32-pcre-dll >= 8.13
+Requires:	crossmingw32-pcre-dll >= 8.31
 Requires:	wine
 
 %description dll
-DLL glib2 libraries for Windows.
+DLL GLib 2 libraries for Windows.
 
 %description dll -l pl.UTF-8
-Biblioteki DLL glib2 dla Windows.
+Biblioteki DLL GLib 2 dla Windows.
 
 %prep
 %setup -q -n %{realname}-%{version}
 %patch0 -p1
 
+cat > meson-cross.txt <<'EOF'
+[host_machine]
+system = 'windows'
+cpu_family = 'x86'
+cpu = 'i386'
+endian='little'
+[binaries]
+c = '%{target}-gcc'
+cpp = '%{target}-g++'
+ar = '%{target}-ar'
+windres = '%{target}-windres'
+pkgconfig = 'pkg-config'
+[properties]
+c_args = ['%(echo %{rpmcflags} | sed -e "s/ \+/ /g;s/ /', '/g")']
+EOF
+
 %build
 export PKG_CONFIG_LIBDIR=%{_prefix}/lib/pkgconfig
-%{__gtkdocize}
-%{__libtoolize}
-%{__aclocal} -I m4macros
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure \
-	DBUS_DAEMON=no \
-	--target=%{target} \
-	--host=%{target} \
-	--disable-dtrace \
-	--disable-gtk-doc \
-	--disable-silent-rules \
-	--enable-shared \
-	--with-pcre=system
-
-%{__make}
+%meson build \
+	--cross-file meson-cross.txt \
+	%{?debug:--debug} \
+	-Dselinux=disabled
+
+%ninja_build -C build
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
-	DESTDIR=$RPM_BUILD_ROOT
+%ninja_install -C build
 
 install -d $RPM_BUILD_ROOT%{_dlldir}
-mv -f $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
+%{__mv} $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
 
 %if 0%{!?debug:1}
 %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll
@@ -177,10 +192,9 @@ mv -f $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir}
 %endif
 
 # use system glib2-devel instead
-%{__rm} $RPM_BUILD_ROOT%{_bindir}/{gdbus-codegen,glib-genmarshal,glib-gettextize,glib-mkenums,*.exe}
-%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/{aclocal,bash-completion,gdb,gettext,glib-2.0,man}
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/{gdbus-codegen,glib-genmarshal,glib-gettextize,glib-mkenums,gtester-report,*.exe}
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/{aclocal,bash-completion,gettext,glib-2.0}
 # runtime
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/charset.alias
 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale
 
 %clean
@@ -193,12 +207,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libgmodule-2.0.dll.a
 %{_libdir}/libgobject-2.0.dll.a
 %{_libdir}/libgthread-2.0.dll.a
-%{_libdir}/libgio-2.0.la
-%{_libdir}/libglib-2.0.la
-%{_libdir}/libgmodule-2.0.la
-%{_libdir}/libgobject-2.0.la
-%{_libdir}/libgthread-2.0.la
-%{_libdir}/gthread-2.0.def
 %{_includedir}/gio-win32-2.0
 %{_includedir}/glib-2.0
 %dir %{_libdir}/glib-2.0
@@ -213,6 +221,14 @@ rm -rf $RPM_BUILD_ROOT
 %{_pkgconfigdir}/gobject-2.0.pc
 %{_pkgconfigdir}/gthread-2.0.pc
 
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libgio-2.0.a
+%{_libdir}/libglib-2.0.a
+%{_libdir}/libgmodule-2.0.a
+%{_libdir}/libgobject-2.0.a
+%{_libdir}/libgthread-2.0.a
+
 %files dll
 %defattr(644,root,root,755)
 %{_dlldir}/libgio-2.0-0.dll
diff --git a/glib2-win32.patch b/glib2-win32.patch
index 09d2779..fa6dae5 100644
--- a/glib2-win32.patch
+++ b/glib2-win32.patch
@@ -41,19 +41,21 @@
  typedef enum _KEY_INFORMATION_CLASS {
    KeyBasicInformation,
    KeyNodeInformation,
---- glib-2.58.0/glib/gstdio.c.orig	2018-08-30 19:12:08.000000000 +0200
-+++ glib-2.58.0/glib/gstdio.c	2018-09-14 18:41:52.350477519 +0200
-@@ -36,6 +36,9 @@
- #include <direct.h>
+--- glib-2.60.0/glib/gstdio.c.orig	2019-03-04 21:06:14.000000000 +0100
++++ glib-2.60.0/glib/gstdio.c	2019-03-17 08:35:17.205976417 +0100
+@@ -37,6 +37,11 @@
  #include <io.h>
  #include <sys/utime.h>
+ #include <stdlib.h> /* for MB_CUR_MAX */
++#include <ctype.h>
++#include <malloc.h>
 +#ifdef __MINGW32__
 +#include <winioctl.h>
 +#endif
  #else
  #include <utime.h>
  #include <errno.h>
-@@ -54,6 +57,7 @@
+@@ -55,6 +60,7 @@
  #endif
  
  #if defined (G_OS_WIN32)
@@ -61,7 +63,7 @@
  
  /* We can't include Windows DDK and Windows SDK simultaneously,
   * so let's copy this here from MinGW-w64 DDK.
-@@ -90,6 +94,7 @@
+@@ -91,6 +97,7 @@
      } GenericReparseBuffer;
    };
  } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
@@ -69,6 +71,29 @@
  
  static int
  w32_error_to_errno (DWORD error_code)
+@@ -145,7 +152,7 @@
+   return (result - filetime_unix_epoch_offset) / hundreds_of_usec_per_sec;
+ }
+ 
+-#  ifdef _MSC_VER
++#  if defined(_MSC_VER) || defined(__MINGW32__)
+ #    ifndef S_IXUSR
+ #      define _S_IRUSR _S_IREAD
+ #      define _S_IWUSR _S_IWRITE
+@@ -153,9 +160,13 @@
+ #      define S_IRUSR _S_IRUSR
+ #      define S_IWUSR _S_IWUSR
+ #      define S_IXUSR _S_IXUSR
++#    endif
++#    ifndef S_IXGRP
+ #      define S_IRGRP (S_IRUSR >> 3)
+ #      define S_IWGRP (S_IWUSR >> 3)
+ #      define S_IXGRP (S_IXUSR >> 3)
++#    endif
++#    ifndef S_IXOTH
+ #      define S_IROTH (S_IRGRP >> 3)
+ #      define S_IWOTH (S_IWGRP >> 3)
+ #      define S_IXOTH (S_IXGRP >> 3)
 --- glib-2.58.0/glib/giowin32.c.orig	2018-08-30 19:12:08.000000000 +0200
 +++ glib-2.58.0/glib/giowin32.c	2018-09-15 10:12:54.423173008 +0200
 @@ -70,6 +70,7 @@
@@ -89,16 +114,20 @@
  #include <winsock2.h>
  #endif
  
---- glib-2.58.0/gio/gnetworking.h.in.orig	2018-08-30 19:12:08.000000000 +0200
-+++ glib-2.58.0/gio/gnetworking.h.in	2018-09-18 19:33:44.179829189 +0200
-@@ -29,6 +29,7 @@
+--- glib-2.60.0/gio/gnetworking.h.in.orig	2018-08-30 19:12:08.000000000 +0200
++++ glib-2.60.0/gio/gnetworking.h.in	2018-09-18 19:33:44.179829189 +0200
+@@ -29,8 +29,11 @@
  #include <winsock2.h>
  #include <ws2tcpip.h>
  #include <windns.h>
 +#include <winerror.h>
  #include <mswsock.h>
++#ifndef __MINGW32__
  @WSPIAPI_INCLUDE@
++#endif
  #include <iphlpapi.h>
+ #undef interface
+ 
 --- glib-2.58.0/gio/gwin32networkmonitor.c.orig	2018-08-30 19:12:08.000000000 +0200
 +++ glib-2.58.0/gio/gwin32networkmonitor.c	2018-09-26 17:22:59.000209749 +0200
 @@ -28,6 +28,7 @@
@@ -120,3 +149,38 @@
  int atexit (void (*)(void));
  #endif
  #define g_atexit(func) atexit(func)
+--- glib-2.60.0/glib/gstdio-private.c.orig	2019-03-04 21:06:14.000000000 +0100
++++ glib-2.60.0/glib/gstdio-private.c	2019-03-17 08:40:17.301017330 +0100
+@@ -17,6 +17,8 @@
+  * along with this library; if not, see <http://www.gnu.org/licenses/>.
+  */
+ 
++#include <wctype.h>
++
+ /* Strips "\\\\?\\" extended prefix or
+  * "\\??\\" NT Object Manager prefix from
+  * @str in-place, using memmove.
+--- glib-2.60.0/gio/tests/g-file-info.c.orig	2019-03-04 21:06:14.000000000 +0100
++++ glib-2.60.0/gio/tests/g-file-info.c	2019-03-17 20:58:44.544317727 +0100
+@@ -30,6 +30,9 @@
+ #include <stdio.h>
+ #include <glib/gstdio.h>
+ #include <windows.h>
++#ifdef __MINGW32__
++#include <winioctl.h>
++#endif
+ #include <shlobj.h>
+ #include <io.h> /* for _get_osfhandle */
+ #endif
+--- glib-2.60.0/gio/tests/network-address.c.orig	2019-03-04 21:06:14.000000000 +0100
++++ glib-2.60.0/gio/tests/network-address.c	2019-03-17 21:18:09.974670716 +0100
+@@ -3,6 +3,9 @@
+ 
+ #include <gio/gio.h>
+ #include <gio/gnetworking.h>
++#ifdef __MINGW32__
++#include <ntddndis.h>
++#endif
+ 
+ static void
+ test_basic (void)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crossmingw32-glib2.git/commitdiff/83471978e30a45874071eeb6bcff7c68fb5606e0



More information about the pld-cvs-commit mailing list