14
0

Accepting request 724517 from home:jayvdb:branches:devel:languages:python

Add patch to work with latest beta

OBS-URL: https://build.opensuse.org/request/show/724517
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-opengl-accelerate?expand=0&rev=11
This commit is contained in:
Tomáš Chvátal
2019-08-19 09:12:08 +00:00
committed by Git OBS Bridge
parent b927279aa6
commit 6d433a4a36
5 changed files with 76 additions and 7 deletions

25
commit1080.patch Normal file
View File

@@ -0,0 +1,25 @@
=== modified file 'accelerate/src/numpy_formathandler.pyx'
--- accelerate/src/numpy_formathandler.pyx 2018-08-12 01:47:52 +0000
+++ accelerate/src/numpy_formathandler.pyx 2018-11-05 06:18:00 +0000
@@ -52,16 +52,18 @@
np.float16,
np.float32,
np.float64,
- np.float128,
np.complex64,
np.complex128,
- np.complex256,
np.bytes_,
np.str_,
np.void,
np.datetime64,
np.timedelta64,
)
+ if hasattr(np,'float128'):
+ HANDLED_TYPES += (np.float128,)
+ if hasattr(np,'complex256'):
+ HANDLED_TYPES += (np.complex256,)
def __init__( self, ERROR_ON_COPY=None, a_to_gl=None, gl_to_a=None ):
if ERROR_ON_COPY is None:

13
formathandler.pxd Normal file
View File

@@ -0,0 +1,13 @@
"""Cython import description for formathandler types"""
cdef class FormatHandler:
cdef public int ERROR_ON_COPY
cdef object c_from_param( self, object instance, object typeCode)
cdef object c_dataPointer( self, object instance )
cdef c_zeros( self, object dims, object typeCode )
cdef c_arraySize( self, object instance, object typeCode )
cdef c_arrayByteCount( self, object instance )
cdef c_arrayToGLType( self, object value )
cdef c_asArray( self, object instance, object typeCode)
cdef c_unitSize( self, object instance, typeCode )
cdef c_dimensions( self, object instance)

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Aug 19 05:37:59 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Add commit1080.patch to make source compatible with opengl 3.1.3b2
needed for Python 3.7 compatibility
- Add wrapper.pxd and formathandler.pxd needed to rebuild from source
-------------------------------------------------------------------
Thu Oct 25 12:41:21 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-opengl-accelerate
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,22 +18,30 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define tarname PyOpenGL-accelerate
%define _version 3.1.3b1
Name: python-opengl-accelerate
Version: 3.1.3b1
Version: %{_version}.post1
Release: 0
Summary: Acceleration for python-opengl
License: BSD-3-Clause
Group: Development/Libraries/Python
URL: http://pyopengl.sourceforge.net
Source0: https://files.pythonhosted.org/packages/source/P/%{tarname}/%{tarname}-%{version}.tar.gz
Source0: https://files.pythonhosted.org/packages/source/P/%{tarname}/%{tarname}-%{_version}.tar.gz
# Missing pxd only needed to rebuild .c https://github.com/mcfletch/pyopengl/issues/12
Source2: https://raw.githubusercontent.com/mcfletch/pyopengl/master/accelerate/OpenGL_accelerate/formathandler.pxd
Source3: https://raw.githubusercontent.com/mcfletch/pyopengl/master/accelerate/OpenGL_accelerate/wrapper.pxd
# Newer numpy_formathandler.pyx needed to match opengl 3.1.3b2
# https://github.com/mcfletch/pyopengl/issues/28
# Patch is subset of https://bazaar.launchpad.net/~mcfletch/pyopengl/trunk/diff/1099
Patch0: commit1080.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module opengl == %{version}}
BuildRequires: %{python_module opengl >= %{version}}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-numpy
Requires: python-opengl = %{version}
Requires: python-opengl >= %{version}
%python_subpackages
%description
@@ -43,7 +51,14 @@ arrays extensively speed-up is around 10% compared to unaccelerated
code.
%prep
%setup -q -n %{tarname}-%{version}
%setup -q -n %{tarname}-%{_version}
%patch0 -p1
sed -i 's/\t/ /g' src/numpy_formathandler.pyx
cp %{SOURCE2} %{SOURCE3} OpenGL_accelerate/
# Force Cython to rebuild .c files
rm src/*.c
%build
export CFLAGS="%{optflags} -DGLX_GLXEXT_LEGACY"
@@ -57,6 +72,6 @@ export CFLAGS="%{optflags} -DGLX_GLXEXT_LEGACY"
%license license.txt
%doc README.txt
%{python_sitearch}/OpenGL_accelerate/
%{python_sitearch}/PyOpenGL_accelerate-%{version}-py%{python_version}.egg-info
%{python_sitearch}/PyOpenGL_accelerate-*-py%{python_version}.egg-info
%changelog

9
wrapper.pxd Normal file
View File

@@ -0,0 +1,9 @@
"""Importable Cython declarations for wrapper module"""
cdef class cArgConverter:
cdef object c_call( self, tuple pyArgs, int index, object baseOperation )
cdef class pyArgConverter:
cdef object c_call( self, object incoming, object function, tuple arguments )
cdef class cArgumentConverter:
cdef object c_call( self, object incoming )
cdef class returnConverter:
cdef object c_call( self, object result, object baseOperation, tuple pyArgs, tuple cArgs )