[packages/python-pyicu] - force C++11 (in case it's not compiler default, e.g. gcc 4 or 5) - fix tests without pyicu install

qboosh qboosh at pld-linux.org
Thu Apr 27 20:47:53 CEST 2017


commit a93faa77a7e46e35a3aaeef99451c30fb708f7f9
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Apr 27 20:47:52 2017 +0200

    - force C++11 (in case it's not compiler default, e.g. gcc 4 or 5)
    - fix tests without pyicu installed

 python-pyicu.spec | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/python-pyicu.spec b/python-pyicu.spec
index 03e8169..b2284e8 100644
--- a/python-pyicu.spec
+++ b/python-pyicu.spec
@@ -14,13 +14,14 @@ Group:		Development/Languages/Python
 Source0:	https://pypi.python.org/packages/bc/78/f4e26f67c9b6b9074baa576ae67947e42fb86039199a65e9ab91ddb51d26/PyICU-%{version}.tar.gz
 # Source0-md5:	bb7838411ba9c7363503745220c754e9
 URL:		https://pypi.python.org/pypi/PyICU
-BuildRequires:	libicu-devel >= 3.6
-BuildRequires:	libstdc++-devel
+BuildRequires:	libicu-devel >= 59
+BuildRequires:	libstdc++-devel >= 6:4.7
 %if %{with python2}
 BuildRequires:	python-devel >= 1:2.3
 BuildRequires:	python-modules >= 1:2.3
 %endif
 %if %{with python3}
+BuildRequires:	python3-2to3 >= 1:3.2
 BuildRequires:	python3-devel >= 1:3.2
 BuildRequires:	python3-modules >= 1:3.2
 %endif
@@ -59,15 +60,21 @@ Ten pakiet zawiera moduł Pythona 3.
 %setup -q -n PyICU-%{version}
 
 %build
+# uses ICU C++ API, which (in case if icu 59+) needs char16_t as distinct type, i.e. C++ 11
+CFLAGS="%{rpmcxxflags} %{rpmcppflags} -std=c++11"
+
 %if %{with python2}
-%py_build %{?with_tests:test}
+%py_build
+
+# tests need module already built
+%{?with_tests:PYTHONPATH=$(pwd)/$(echo build-2/lib.*) %{__python} -m unittest discover -s test}
 %endif
 
 %if %{with python3}
 %py3_build
 
-# tests are 2to3'ed after setup()
-%{?with_tests:%py3_build test}
+# tests to be 2to3'ed (by setup) and module already built
+%{?with_tests:PYTHONPATH=$(pwd)/$(echo build-3/lib.*) %{__python3} -m unittest discover -s test}
 %endif
 
 %install
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pyicu.git/commitdiff/a93faa77a7e46e35a3aaeef99451c30fb708f7f9



More information about the pld-cvs-commit mailing list