From 455e0e5203eca018cd35af3e9813b3e0a7247997 Mon Sep 17 00:00:00 2001 From: xulchris Date: May 13 2007 03:47:47 +0000 Subject: apply 64-bit patch from hans bz#239899 --- diff --git a/pygame-1.7.1-64bit-2.patch b/pygame-1.7.1-64bit-2.patch new file mode 100644 index 0000000..61ad637 --- /dev/null +++ b/pygame-1.7.1-64bit-2.patch @@ -0,0 +1,74 @@ +--- pygame-1.7.1release/src/surface.c~ 2007-05-12 09:55:02.000000000 +0200 ++++ pygame-1.7.1release/src/surface.c 2007-05-12 09:55:02.000000000 +0200 +@@ -1353,7 +1353,7 @@ + if(rect && kw) + { + PyObject *key, *value; +- int pos=0; ++ Py_ssize_t pos=0; + while(PyDict_Next(kw, &pos, &key, &value)) + { + if((PyObject_SetAttr(rect, key, value) == -1)) +--- pygame-1.7.1release/src/event.c~ 2007-05-12 09:53:06.000000000 +0200 ++++ pygame-1.7.1release/src/event.c 2007-05-12 09:53:06.000000000 +0200 +@@ -534,7 +534,7 @@ + if(keywords) + { + PyObject *key, *value; +- int pos = 0; ++ Py_ssize_t pos = 0; + while(PyDict_Next(keywords, &pos, &key, &value)) + PyDict_SetItem(dict, key, value); + } +--- pygame-1.7.1release/src/image.c~ 2007-05-12 10:01:24.000000000 +0200 ++++ pygame-1.7.1release/src/image.c 2007-05-12 10:01:24.000000000 +0200 +@@ -291,7 +291,8 @@ + PyObject *surfobj, *string=NULL; + char *format, *data, *pixels; + SDL_Surface *surf, *temp=NULL; +- int w, h, color, len, flipped=0; ++ int w, h, color, flipped=0; ++ Py_ssize_t len; + int Rmask, Gmask, Bmask, Amask, Rshift, Gshift, Bshift, Ashift, Rloss, Gloss, Bloss, Aloss; + int hascolorkey, colorkey; + +@@ -605,7 +606,8 @@ + PyObject *string; + char *format, *data; + SDL_Surface *surf = NULL; +- int w, h, len, flipped=0; ++ int w, h, flipped=0; ++ Py_ssize_t len; + int loopw, looph; + + if(!PyArg_ParseTuple(arg, "O!(ii)s|i", &PyString_Type, &string, &w, &h, &format, &flipped)) +@@ -729,7 +731,8 @@ + PyObject *buffer; + char *format, *data; + SDL_Surface *surf = NULL; +- int w, h, len; ++ int w, h; ++ Py_ssize_t len; + PyObject *surfobj; + + if(!PyArg_ParseTuple(arg, "O(ii)s|i", &buffer, &w, &h, &format)) +--- pygame-1.7.1release/src/rect.c~ 2007-05-12 09:54:41.000000000 +0200 ++++ pygame-1.7.1release/src/rect.c 2007-05-12 09:54:41.000000000 +0200 +@@ -589,7 +589,7 @@ + { + PyRectObject* self = (PyRectObject*)oself; + GAME_Rect *argrect, temp; +- int loop=0; ++ Py_ssize_t loop=0; + PyObject* dict, *key, *val; + PyObject* ret = NULL; + +@@ -640,7 +640,7 @@ + { + PyRectObject* self = (PyRectObject*)oself; + GAME_Rect *argrect, temp; +- int loop=0; ++ Py_ssize_t loop=0; + PyObject* dict, *key, *val; + PyObject* ret = NULL; + diff --git a/pygame.spec b/pygame.spec index ca16d18..fc2cb26 100644 --- a/pygame.spec +++ b/pygame.spec @@ -2,15 +2,18 @@ Name: pygame Version: 1.7.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Python modules for writing games + Group: Development/Languages License: LGPL URL: http://www.pygame.org Patch0: %{name}-%{version}-config.patch Patch1: %{name}-%{version}-64bit.patch +Patch2: %{name}-%{version}-64bit-2.patch Source0: http://pygame.org/ftp/%{name}-%{version}release.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + BuildRequires: python-devel python-numeric BuildRequires: SDL_ttf-devel SDL_image-devel SDL_mixer-devel Requires: python-numeric @@ -39,33 +42,40 @@ Provides: python-pygame-devel = %{version}-%{release} This package contains headers required to build applications that use pygame. + %prep -%setup -q -n %{name}-%{version}release -%patch0 -p0 -b .config -%patch1 -p0 -b .64bit +%setup -qn %{name}-%{version}release +%patch0 -p0 -b .config~ +%patch1 -p0 -b .64bit~ +%patch2 -p1 -b .64bit-2~ # rpmlint fixes -rm -f examples/.#stars.py.1.7 +rm -f "examples/.#stars.py.1.7" # These files must be provided by pygame-nonfree(-devel) packages on a # repository that does not have restrictions on providing non-free software rm -f src/ffmovie.[ch] + %build -CFLAGS="%{optflags}" %{__python} setup.py build +CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build + %install -rm -rf %{buildroot} -%{__python} setup.py install -O1 --skip-build --root %{buildroot} +rm -rf $RPM_BUILD_ROOT +%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT + %check # base_test fails in mock, unable to find soundcard -PYTHONPATH="%{buildroot}%{python_sitearch}" %{__python} test/base_test.py || : -PYTHONPATH="%{buildroot}%{python_sitearch}" %{__python} test/image_test.py -PYTHONPATH="%{buildroot}%{python_sitearch}" %{__python} test/rect_test.py +PYTHONPATH="$RPM_BUILD_ROOT%{python_sitearch}" %{__python} test/base_test.py || : +PYTHONPATH="$RPM_BUILD_ROOT%{python_sitearch}" %{__python} test/image_test.py +PYTHONPATH="$RPM_BUILD_ROOT%{python_sitearch}" %{__python} test/rect_test.py + %clean -rm -rf %{buildroot} +rm -rf $RPM_BUILD_ROOT + %files %defattr(-,root,root,-) @@ -85,7 +95,12 @@ rm -rf %{buildroot} %dir %{_includedir}/python*/%{name} %{_includedir}/python*/%{name}/*.h + %changelog +* Sat May 12 2007 Christopher Stone 1.7.1-13 +- Apply 64-bit patch for python 2.5 (bz #239899) +- Some minor spec file cleanups + * Mon Apr 23 2007 Christopher Stone 1.7.1-12 - Revert back to version 1.7.1-9