Accepting request 145171 from devel:languages:python

- fixed using numpy with python 3.3.
- matplot build fail (bnc#793557) fixed by these changes.
- with python-bleeding edge repo still broken, fixed only for factory (forwarded request 145145 from HighwayStar)

OBS-URL: https://build.opensuse.org/request/show/145171
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-numpy?expand=0&rev=27
This commit is contained in:
Stephan Kulow 2012-12-14 09:43:43 +00:00 committed by Git OBS Bridge
parent ecb12a2a9e
commit 9512ffddf4
2 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Dec 12 02:25:57 UTC 2012 - highwaystar.ru@gmail.com
- regenerate mtrand.c with cython, needed for python3.3 compatibility
-------------------------------------------------------------------
Thu Nov 22 13:47:34 UTC 2012 - toddrme2178@gmail.com

View File

@ -34,6 +34,8 @@ BuildRequires: lapack-devel
BuildRequires: python3
BuildRequires: python3-2to3
BuildRequires: python3-devel
# Cython needed for mtrand.c regenerating (python3.3)
BuildRequires: python3-Cython
# FIXME: atlas is horribly broken
# %if 0%{?suse_version} <= 1210
# BuildRequires: libatlas3-devel
@ -88,6 +90,21 @@ This package contains files for developing applications using %{modname}.
%patch3 -p1
sed -i "1d" %{modname}/{compat/setup{,scons},distutils/{conv_template,cpuinfo,exec_command,from_template,setup,setupscons,system_info},f2py/{auxfuncs,capi_maps,cb_rules,cfuncs,common_rules,crackfortran,diagnose,docs/usersguide/setup_example,f2py2e,f90mod_rules,func2subr,__init__,rules,setup,setupscons,use_rules},ma/setup{,scons},matrixlib/setup{,scons},setup,setupscons,testing/print_coercion_tables,testing/setup{,scons}}.py # Fix non-executable scripts
# Fix from Fedora:
# Regenerate Cython c sources
# This is needed with numpy-1.6.2.tar.gz with python 3.3 to avoid an exception
# with an import call in the generated .c file in the tarball that uses the
# old default of -1:
# File "mtrand.pyx", line 126, in init mtrand (numpy/random/mtrand/mtrand.c:20679)
# ValueError: level must be >= 0
# due to the changes in import in 3.3
# Regenerating with a newer Cython fixes it:
%if 0%{?suse_version} && 0%{?suse_version} >= 1230
pushd numpy/random/mtrand/
rm -v mtrand.c
cython-%{py3_ver} mtrand.pyx
popd
%endif
%build
CFLAGS="%{optflags} -fno-strict-aliasing" python3 setup.py build