[packages/crossmingw32-std-threads] - updated to 20180912 snapshot - updated include patch (one out, one in) - added errors patch (adjus

qboosh qboosh at pld-linux.org
Fri Oct 5 16:26:30 CEST 2018


commit c008a2b06514fcd2bfccd0175ea563e6d905c68c
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Oct 5 16:29:53 2018 +0200

    - updated to 20180912 snapshot
    - updated include patch (one out, one in)
    - added errors patch (adjust to error codes existing in mingw32 libstdc++)

 crossmingw32-std-threads.spec   | 44 ++++++++++++++++++++++++++++++++++++++---
 mingw-std-threads-errors.patch  | 25 +++++++++++++++++++++++
 mingw-std-threads-include.patch | 29 ++++++++++-----------------
 3 files changed, 76 insertions(+), 22 deletions(-)
---
diff --git a/crossmingw32-std-threads.spec b/crossmingw32-std-threads.spec
index 48a3db9..2a95a89 100644
--- a/crossmingw32-std-threads.spec
+++ b/crossmingw32-std-threads.spec
@@ -1,16 +1,24 @@
+#
+# Conditional build:
+%bcond_without	tests	# perform test build
+#
 Summary:	C++11 threading classes implementation for MinGW
 Summary(pl.UTF-8):	Implementacja klas C++11 związanych z wątkami dla MinGW
 Name:		crossmingw32-std-threads
 Version:	0
-%define	gitref	b7e670d91d33b7ce5836c6255d37e69f17eb3687
-%define	snap	20160317
+%define	gitref	ee67ef384470e998c8e0b7301f7a79b5019251a2
+%define	snap	20180912
 Release:	0.%{snap}.1
 License:	BSD
 Group:		Development/Libraries
 Source0:	https://github.com/meganz/mingw-std-threads/archive/%{gitref}/mingw-std-threads-%{snap}.tar.gz
-# Source0-md5:	e5f0fcdb69d99ab493f45e65767f9346
+# Source0-md5:	c55d7a463149d803535b71c6bb1346cb
 Patch0:		mingw-std-threads-include.patch
+Patch1:		mingw-std-threads-errors.patch
 URL:		https://github.com/meganz/mingw-std-threads
+%if %{with tests}
+BuildRequires:	crossmingw32-gcc-c++ >= 1:4.7
+%endif
 Requires:	crossmingw32-gcc-c++ >= 1:4.7
 Requires:	crossmingw32-runtime
 Requires:	crossmingw32-w32api
@@ -21,9 +29,22 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define		target			i386-mingw32
 %define		target_platform 	i386-pc-mingw32
 
+%define		__cc			%{target}-gcc
+%define		__cxx			%{target}-g++
+
 %define		_sysprefix		/usr
 %define		_prefix			%{_sysprefix}/%{target}
 
+%ifnarch %{ix86}
+# arch-specific flags (like alpha's -mieee) are not valid for i386 gcc.
+# now at least i486 is required for atomic operations
+%define		optflags	-O2
+%endif
+# -z options are invalid for mingw linker, most of -f options are Linux-specific
+%define		filterout_ld	-Wl,-z,.*
+%define		filterout_c	-f[-a-z0-9=]*
+%define		filterout_cxx	-f[-a-z0-9=]*
+
 %description
 Standard C++11 threading classes (std::condition_variable, std::mutex,
 std::thread) implementation, which are currently still missing on
@@ -37,6 +58,23 @@ brakujących w GCC dla MinGW.
 %prep
 %setup -q -n mingw-std-threads-%{gitref}
 %patch0 -p1
+%patch1 -p1
+
+%build
+%if %{with tests}
+install -d tests/build
+cd tests/build
+CC="%{__cc}" \
+CXX="%{__cxx}" \
+cmake .. \
+	-DCMAKE_BUILD_TYPE=PLD \
+	-DCMAKE_CXX_FLAGS_PLD="%{rpmcxxflags} -DWINVER=0x0501" \
+	-DCMAKE_SYSTEM_NAME=Windows \
+	-DCMAKE_SYSTEM_PROCESSOR=i386 \
+	-DCMAKE_VERBOSE_MAKEFILE=ON
+
+%{__make}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
diff --git a/mingw-std-threads-errors.patch b/mingw-std-threads-errors.patch
new file mode 100644
index 0000000..927111e
--- /dev/null
+++ b/mingw-std-threads-errors.patch
@@ -0,0 +1,25 @@
+--- mingw-std-threads-ee67ef384470e998c8e0b7301f7a79b5019251a2/mingw.condition_variable.h.orig	2018-09-11 17:06:14.000000000 +0200
++++ mingw-std-threads-ee67ef384470e998c8e0b7301f7a79b5019251a2/mingw.condition_variable.h	2018-10-03 21:35:48.633130795 +0200
+@@ -105,7 +105,7 @@
+         else
+         {
+             using namespace std;
+-            throw system_error(make_error_code(errc::protocol_error));
++            throw system_error(make_error_code(errc::invalid_argument));
+         }
+     }
+ public:
+--- reads-ee67ef384470e998c8e0b7301f7a79b5019251a2/mingw.mutex.h.orig	2018-09-11 17:06:14.000000000 +0200
++++ reads-ee67ef384470e998c8e0b7301f7a79b5019251a2/mingw.mutex.h	2018-10-03 21:40:38.086460829 +0200
+@@ -300,9 +300,9 @@
+         case WAIT_OBJECT_0:
+             return true;
+         case WAIT_ABANDONED:
+-            throw system_error(make_error_code(errc::owner_dead));
++            throw system_error(make_error_code(errc::no_such_process));
+         default:
+-            throw system_error(make_error_code(errc::protocol_error));
++            throw system_error(make_error_code(errc::invalid_argument));
+         }
+     }
+ protected:
diff --git a/mingw-std-threads-include.patch b/mingw-std-threads-include.patch
index ddbce84..009f11d 100644
--- a/mingw-std-threads-include.patch
+++ b/mingw-std-threads-include.patch
@@ -1,19 +1,10 @@
---- mingw-std-threads-b7e670d91d33b7ce5836c6255d37e69f17eb3687/mingw.mutex.h.orig	2016-03-16 15:05:58.000000000 +0100
-+++ mingw-std-threads-b7e670d91d33b7ce5836c6255d37e69f17eb3687/mingw.mutex.h	2016-06-25 09:17:48.884289745 +0200
-@@ -41,6 +41,7 @@
- 
- #include <windows.h>
- #include <chrono>
-+#include <cstdio>
- #include <system_error>
- 
- #ifndef EPROTO
-@@ -105,7 +106,7 @@
-         DWORD self = GetCurrentThreadId();
-         if (mOwnerThread == self)
-         {
--            fprintf(stderr, "FATAL: Recursive locking or non-recursive mutex detected. Throwing sysetm exception\n");
-+            fprintf(stderr, "FATAL: Recursive locking or non-recursive mutex detected. Throwing system exception\n");
-             fflush(stderr);
-             throw system_error(EDEADLK, generic_category());
-         }
+--- mingw-std-threads-ee67ef384470e998c8e0b7301f7a79b5019251a2/mingw.shared_mutex.h.orig	2018-09-11 17:06:14.000000000 +0200
++++ mingw-std-threads-ee67ef384470e998c8e0b7301f7a79b5019251a2/mingw.shared_mutex.h	2018-10-04 20:56:12.195504727 +0200
+@@ -32,6 +32,7 @@
+ #endif
+ 
+ #include <cassert>
++#include <climits>
+ 
+ //    Use MinGW's shared_lock class template, if it's available. Requires C++14.
+ //  If unavailable (eg. because this library is being used in C++11), then an
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/crossmingw32-std-threads.git/commitdiff/c008a2b06514fcd2bfccd0175ea563e6d905c68c



More information about the pld-cvs-commit mailing list