]> git.pld-linux.org Git - packages/python-pyicu.git/blobdiff - python-pyicu.spec
- force C++11 (in case it's not compiler default, e.g. gcc 4 or 5)
[packages/python-pyicu.git] / python-pyicu.spec
index 03e8169860eea52120f476cf5d5761a37448072d..b2284e832a93cb511984f9580cfcc5d785920da5 100644 (file)
@@ -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
This page took 0.045515 seconds and 4 git commands to generate.