From db9d72ad854f5713bbb41da43ae388a99ea5ada2 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Nov 12 2020 19:12:56 +0000 Subject: 2.0.0, move to SDL2, fix build for Python 3.10. --- diff --git a/.gitignore b/.gitignore index d1f5e20..d5a6abd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ pygame-1.9.1release.tar.gz /pygame-1.9.3.tar.gz /pygame-1.9.4.tar.gz /pygame-1.9.6.tar.gz +/pygame-2.0.0.tar.gz diff --git a/pygame.spec b/pygame.spec index 3375d3f..928e1eb 100644 --- a/pygame.spec +++ b/pygame.spec @@ -1,17 +1,16 @@ Name: pygame -Version: 1.9.6 -Release: 9%{?dist} +Version: 2.0.0 +Release: 1%{?dist} Summary: Python modules for writing games License: LGPLv2+ URL: http://www.pygame.org -Source0: https://files.pythonhosted.org/packages/source/e/pygame/pygame-%{version}.tar.gz -Patch0: python-39.patch +Source0: https://files.pythonhosted.org/packages/bc/0c/d164411381bada8feae57359aa9296defbed3035f4b55bef6a271cb0573c/pygame-2.0.0.tar.gz BuildRequires: python%{python3_pkgversion}-devel python%{python3_pkgversion}-numpy python%{python3_pkgversion}-Cython BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: SDL_ttf-devel SDL_image-devel SDL_mixer-devel -BuildRequires: SDL-devel freetype-devel +BuildRequires: SDL2_ttf-devel SDL2_image-devel SDL2_mixer-devel +BuildRequires: SDL2-devel freetype-devel BuildRequires: libpng-devel libjpeg-devel libX11-devel BuildRequires: portmidi-devel BuildRequires: gcc @@ -28,7 +27,7 @@ operating system. %package devel Summary: Files needed for developing programs which use pygame Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} -Requires: SDL_ttf-devel SDL_mixer-devel +Requires: SDL2_ttf-devel SDL2_mixer-devel Requires: python3-devel %description devel @@ -52,12 +51,6 @@ operating system. %prep %setup -q -%patch0 -p0 - -# cythonize it -rm src_c/pypm.c -%{__python3} -m cython src_c/pypm.pyx - # rpmlint fixes find examples/ -type f -print0 | xargs -0 chmod -x find docs/ -type f -print0 | xargs -0 chmod -x @@ -73,8 +66,7 @@ rm -f src_c/ffmovie.[ch] %build -%py3_build - +%py3_build cython %install %py3_install @@ -89,8 +81,9 @@ chmod 755 $RPM_BUILD_ROOT%{python3_sitearch}/%{name}/*.so %check # base_test fails in mock, unable to find soundcard PYTHONPATH="$RPM_BUILD_ROOT%{python3_sitearch}" %{__python3} test/base_test.py || : -PYTHONPATH="$RPM_BUILD_ROOT%{python3_sitearch}" %{__python3} test/image_test.py PYTHONPATH="$RPM_BUILD_ROOT%{python3_sitearch}" %{__python3} test/rect_test.py +#image_test now fails in mock, unable to find video device. +#PYTHONPATH="$RPM_BUILD_ROOT%{python3_sitearch}" %{__python3} test/image_test.py %files -n python%{python3_pkgversion}-pygame %doc docs/ README* WHATSNEW* @@ -100,10 +93,12 @@ PYTHONPATH="$RPM_BUILD_ROOT%{python3_sitearch}" %{__python3} test/rect_test.py %files devel %doc examples/ %dir %{_includedir}/python*/%{name} -%{_includedir}/python*/%{name}/*.h - +%{_includedir}/python*/%{name}/ %changelog +* Thu Nov 12 2020 Gwyn Ciesla - 2.0.0-1 +- 2.0.0 + * Tue Jul 28 2020 Fedora Release Engineering - 1.9.6-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/python-39.patch b/python-39.patch deleted file mode 100644 index cae887c..0000000 --- a/python-39.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- test/image_test.py~ 2019-04-25 01:10:33.000000000 -0500 -+++ test/image_test.py 2020-01-17 14:33:13.945169326 -0600 -@@ -387,7 +387,7 @@ - byte_buf[i*4 + 2] = byte_buf[i*4 + 1] - byte_buf[i*4 + 1] = byte_buf[i*4 + 0] - byte_buf[i*4 + 0] = alpha -- return byte_buf.tostring() -+ return byte_buf.tobytes() - - #################################################################### - def RotateARGBtoRGBA(str_buf): -@@ -399,7 +399,7 @@ - byte_buf[i*4 + 1] = byte_buf[i*4 + 2] - byte_buf[i*4 + 2] = byte_buf[i*4 + 3] - byte_buf[i*4 + 3] = alpha -- return byte_buf.tostring() -+ return byte_buf.tobytes() - - #################################################################### - test_surface = pygame.Surface((64, 256), flags=pygame.SRCALPHA, ---- test/test_utils/png.py~ 2019-04-25 01:10:33.000000000 -0500 -+++ test/test_utils/png.py 2020-01-17 15:00:20.714814225 -0600 -@@ -202,7 +202,7 @@ - """Convert row of bytes to string. Expects `row` to be an - ``array``. - """ -- return row.tostring() -+ return row.tobytes() - - # Conditionally convert to bytes. Works on Python 2 and Python 3. - try: diff --git a/sources b/sources index 43bbfd2..ef4b68f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pygame-1.9.6.tar.gz) = 39f09567f818c57756f9001b3b497ee4ca19bd2b5af083f480e5498cb44ef4f5d39b84b1e7d109d412c5764f0ed13e931468eb883f134f5361272466ac5e0f40 +SHA512 (pygame-2.0.0.tar.gz) = 3f65924d0e1d2863b84118a4e468b521a289e2cf174405c6f3ee2b2a2ed399cde7f9f310d57c4166351f84caaea02dd7408ee852dbcee7c205bb2955b6078fda