[packages/python-pygame] - updated to 1.9.6, separated -examples (size >> -devel size)
qboosh
qboosh at pld-linux.org
Thu Sep 26 18:06:16 CEST 2024
commit 67efd172718d75331473550b1c15bdc724cfb778
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Thu Sep 26 18:09:05 2024 +0200
- updated to 1.9.6, separated -examples (size >> -devel size)
python-pygame-porttime.patch | 26 -------
python-pygame-remove-v4l.patch | 172 -----------------------------------------
python-pygame.spec | 75 +++++++++++-------
x32.patch | 33 +++-----
4 files changed, 59 insertions(+), 247 deletions(-)
---
diff --git a/python-pygame.spec b/python-pygame.spec
index d989f60..45ac2f8 100644
--- a/python-pygame.spec
+++ b/python-pygame.spec
@@ -1,40 +1,39 @@
#
-# TODO: - unpackaged files:
-# _site-packages/pygame/docs/*
-# _site-packages/pygame/examples/*
-# _site-packages/pygame/gp2x/*
-# _site-packages/pygame/tests/*
-#
+# Conditional build:
+%bcond_with apidocs # Sphinx documentation (encoding errors as of 1.9.6 / Sphinx 1.8)
%define module pygame
Summary: Python modules designed for writing games
Summary(pl.UTF-8): Moduły Pythona dla piszących gry
Name: python-%{module}
-Version: 1.9.1
-Release: 16
+Version: 1.9.6
+Release: 1
License: LGPL v2.1+
Group: Libraries/Python
-Source0: http://www.pygame.org/ftp/pygame-%{version}release.tar.gz
-# Source0-md5: 1c4cdc708d17c8250a2d78ef997222fc
-Patch0: %{name}-porttime.patch
-Patch1: %{name}-remove-v4l.patch
+Source0: https://files.pythonhosted.org/packages/source/p/pygame/pygame-%{version}.tar.gz
+# Source0-md5: 36f8817874f9e63acdf12914340b60e9
Patch2: x32.patch
-URL: http://www.pygame.org/
+URL: https://www.pygame.org/
BuildRequires: SDL-devel
BuildRequires: SDL_image-devel
BuildRequires: SDL_mixer-devel
BuildRequires: SDL_ttf-devel >= 2.0
+BuildRequires: freetype-devel >= 2.0
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: portmidi-devel >= 217
+BuildRequires: python-devel >= 1:2.7
+BuildRequires: python-modules >= 1:2.7
BuildRequires: python-numpy-devel
-BuildRequires: python-devel >= 2.2.1
-BuildRequires: python-modules
+BuildRequires: rpm-build >= 4.6
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.710
-BuildRequires: smpeg-devel
-%pyrequires_eq python
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with apidocs}
+BuildRequires: sphinx-pdg-2
+%endif
+BuildRequires: xorg-lib-libX11-devel
+Requires: python-modules >= 1:2.7
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -54,8 +53,9 @@ Python.
Summary: C header files for pygame modules
Summary(pl.UTF-8): Pliki nagłówkowe języka C modułów pygame
Group: Development/Languages/Python
-%pyrequires_eq python
Requires: %{name} = %{version}-%{release}
+Requires: python-devel >= 1:2.7
+BuildArch: noarch
%description devel
C header files for pygame modules.
@@ -63,16 +63,32 @@ C header files for pygame modules.
%description devel -l pl.UTF-8
Pliki nagłówkowe języka C modułów pygame.
+%package examples
+Summary: Examples for Python pygame modules
+Summary(pl.UTF-8): Przykłady do modułów Pythona pygame
+Group: Development/Languages/Python
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+
+%description examples
+Examples for Python pygame modules.
+
+%description examples -l pl.UTF-8
+Przykłady do modułów Pythona pygame.
+
%prep
-%setup -q -n %{module}-%{version}release
-%patch0 -p1
-%patch1 -p1
+%setup -q -n %{module}-%{version}
%patch2 -p1
%build
-CFLAGS="%{rpmcflags} -I/usr/include/smpeg"; export CFLAGS
+export PORTMIDI_INC_PORTTIME=1
%py_build
+%if %{with apidocs}
+LC_ALL=en.UTF-8 \
+sphinx-build-2 -b html docs/reST docs/_build/html
+%endif
+
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
@@ -81,24 +97,29 @@ install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
-%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_postclean
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/%{module}/{docs,examples,tests}
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/pygame.ico
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/%{module}/pygame_icon.*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc WHATSNEW docs/*
+%doc README.rst
%dir %{py_sitedir}/%{module}
%{py_sitedir}/%{module}/*.ttf
%attr(755,root,root) %{py_sitedir}/%{module}/*.so
%{py_sitedir}/%{module}/*.py[co]
-%dir %{py_sitedir}/%{module}/threads/
+%dir %{py_sitedir}/%{module}/threads
%{py_sitedir}/%{module}/threads/*.py[co]
+%{py_sitedir}/pygame-%{version}-py*.egg-info
%files devel
%defattr(644,root,root,755)
%{py_incdir}/%{module}
+
+%files examples
+%defattr(644,root,root,755)
%{_examplesdir}/%{name}-%{version}
diff --git a/python-pygame-porttime.patch b/python-pygame-porttime.patch
deleted file mode 100644
index 92dd180..0000000
--- a/python-pygame-porttime.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/config_unix.py b/config_unix.py
-index c888c28..942a750 100644
---- a/config_unix.py
-+++ b/config_unix.py
-@@ -147,7 +147,7 @@ def main():
- Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
- Dependency('SCRAP', '', 'libX11', ['X11']),
- Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.so', ['portmidi']),
-- Dependency('PORTTIME', 'porttime.h', 'libporttime.so', ['porttime']),
-+ Dependency('PORTTIME', 'porttime.h', 'libportmidi.so', ['portmidi']),
- #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
- ]
- if not DEPS[0].found:
-diff --git a/Setup.in b/Setup.in
-index 4bb6c1c..c90174f 100644
---- a/Setup.in
-+++ b/Setup.in
-@@ -16,7 +16,7 @@ PNG = -lpng
- JPEG = -ljpeg
- SCRAP = -lX11
- PORTMIDI = -lportmidi
--PORTTIME = -lporttime
-+PORTTIME =
- #--EndConfig
-
- #DEBUG = -C-W -C-Wall
diff --git a/python-pygame-remove-v4l.patch b/python-pygame-remove-v4l.patch
deleted file mode 100644
index 55d6841..0000000
--- a/python-pygame-remove-v4l.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-based on https://bitbucket.org/pygame/pygame/changeset/8296cad31717/raw/
-
-# HG changeset patch
-# User Nirav Patel <nrp at eclecti.cc>
-# Date 1303583959 0
-# Node ID 8296cad317177b84fa52e6757c198391804e1b1b
-# Parent 15eeb4b2082188e15502286ad439d30cb9195504
-Patch from Martijn Schmidt. Remove V4L support.
-
-With modifications by Nirav Patel. V4L has effectively
-been deprecated from the Linux kernel as of 2.6.38. Support
-in pygame was just a placeholder, and removing it
-will not change any functionality.
-
---- pygame-1.9.1release/Setup.in.orig 2024-09-24 22:12:09.045405793 +0200
-+++ pygame-1.9.1release/Setup.in 2024-09-24 22:12:46.358536984 +0200
-@@ -34,7 +34,7 @@ _numericsurfarray src/_numericsurfarray.
- _numericsndarray src/_numericsndarray.c $(SDL) $(MIXER) $(DEBUG)
- movie src/movie.c $(SDL) $(SMPEG) $(DEBUG)
- scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
--_camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG)
-+_camera src/_camera.c src/camera_v4l2.c $(SDL) $(DEBUG)
- pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
-
- GFX = src/SDL_gfx/SDL_gfxPrimitives.c
---- pygame-1.9.1release/src/_camera.c.orig 2009-03-15 20:30:41.000000000 +0100
-+++ pygame-1.9.1release/src/_camera.c 2024-09-24 22:13:54.234835933 +0200
-@@ -22,7 +22,7 @@
- * Author: Nirav Patel
- *
- * This module allows for use of v4l2 webcams in pygame. The code is written
-- * such that adding support for v4l or vfw cameras should be possible without
-+ * such that adding support for vfw cameras should be possible without
- * much modification of existing functions. v4l2 functions are kept seperate
- * from functions available to pygame users and generic functions like
- * colorspace conversion.
-@@ -160,20 +160,8 @@ PyObject* camera_start (PyCameraObject*
- {
- #if defined(__unix__)
- if (v4l2_open_device(self) == 0) {
-- if (v4l_open_device(self) == 0) {
-- v4l2_close_device(self);
-- return NULL;
-- } else {
-- self->camera_type = CAM_V4L;
-- if (v4l_init_device(self) == 0) {
-- v4l2_close_device(self);
-- return NULL;
-- }
-- if (v4l_start_capturing(self) == 0) {
-- v4l2_close_device(self);
-- return NULL;
-- }
-- }
-+ v4l2_close_device(self);
-+ return NULL;
- } else {
- self->camera_type = CAM_V4L2;
- if (v4l2_init_device(self) == 0) {
---- pygame-1.9.1release/src/camera.h.orig 2008-10-10 04:37:10.000000000 +0200
-+++ pygame-1.9.1release/src/camera.h 2024-09-24 22:14:57.011162511 +0200
-@@ -39,7 +39,6 @@
-
- #include <asm/types.h> /* for videodev2.h */
-
-- #include <linux/videodev.h>
- #include <linux/videodev2.h>
- #endif
-
-@@ -51,7 +50,7 @@
- #define RGB_OUT 1
- #define YUV_OUT 2
- #define HSV_OUT 4
--#define CAM_V4L 1
-+#define CAM_V4L 1 /* deprecated. the incomplete support in pygame was removed */
- #define CAM_V4L2 2
-
- struct buffer
-@@ -111,8 +110,4 @@ int v4l2_init_device (PyCameraObject* se
- int v4l2_close_device (PyCameraObject* self);
- int v4l2_open_device (PyCameraObject* self);
-
--/* internal functions specific to v4l */
--int v4l_open_device (PyCameraObject* self);
--int v4l_init_device(PyCameraObject* self);
--int v4l_start_capturing(PyCameraObject* self);
- #endif
-diff -r 15eeb4b2082188e15502286ad439d30cb9195504 -r 8296cad317177b84fa52e6757c198391804e1b1b src/camera_v4l.c
---- a/src/camera_v4l.c Fri Apr 15 20:47:04 2011 +0000
-+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
-@@ -1,81 +0,0 @@
--/*
-- pygame - Python Game Library
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Library General Public
-- License as published by the Free Software Foundation; either
-- version 2 of the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- Library General Public License for more details.
--
-- You should have received a copy of the GNU Library General Public
-- License along with this library; if not, write to the Free
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
--*/
--#if defined(__unix__)
--#include "camera.h"
--
--/*
-- * V4L functions
-- */
--
--int v4l_open_device (PyCameraObject* self)
--{
-- struct stat st;
-- struct video_capability cap;
-- struct video_mbuf buf;
--
-- if (-1 == stat (self->device_name, &st)) {
-- PyErr_Format(PyExc_SystemError, "Cannot identify '%s': %d, %s",
-- self->device_name, errno, strerror (errno));
-- return 0;
-- }
--
-- if (!S_ISCHR (st.st_mode)) {
-- PyErr_Format(PyExc_SystemError, "%s is no device",self->device_name);
-- return 0;
-- }
--
-- self->fd = open (self->device_name, O_RDWR /* required | O_NONBLOCK */, 0);
--
-- if (-1 == self->fd) {
-- PyErr_Format(PyExc_SystemError, "Cannot open '%s': %d, %s",
-- self->device_name, errno, strerror (errno));
-- return 0;
-- }
--
-- if(ioctl(self->fd, VIDIOCGCAP, cap) == -1) {
-- PyErr_Format(PyExc_SystemError, "%s is not a V4L device",
-- self->device_name);
-- return 0;
-- }
--
-- if(!(cap.type & VID_TYPE_CAPTURE)) {
-- PyErr_Format(PyExc_SystemError, "%s is not a video capture device",
-- self->device_name);
-- return 0;
-- }
--
-- if( ioctl(self->fd , VIDIOCGMBUF , buf ) == -1 ) {
-- PyErr_Format(PyExc_SystemError, "%s does not support streaming i/o",
-- self->device_name);
-- return 0;
-- }
--
-- return 1;
--}
--
--int v4l_init_device(PyCameraObject* self)
--{
-- return 0;
--}
--
--int v4l_start_capturing(PyCameraObject* self)
--{
-- return 0;
--}
--#endif
diff --git a/x32.patch b/x32.patch
index fc8122f..9cb59c6 100644
--- a/x32.patch
+++ b/x32.patch
@@ -1,22 +1,11 @@
---- pygame-1.9.1release/config_unix.py~ 2015-05-10 12:40:56.000000000 +0200
-+++ pygame-1.9.1release/config_unix.py 2015-05-10 12:47:41.989724259 +0200
-@@ -17,7 +17,7 @@
- #these get prefixes with '/usr' and '/usr/local' or the $LOCALBASE
- origincdirs = ['/include', '/include/SDL', '/include/SDL',
- '/include/smpeg' ]
--origlibdirs = ['/lib','/lib64','/X11R6/lib']
-+origlibdirs = ['/lib','/lib64','/libx32']
-
- def confirm(message):
- "ask a yes/no question, return result"
---- pygame-1.9.1release/src/scale_mmx.c~ 2009-05-26 23:15:24.000000000 +0200
-+++ pygame-1.9.1release/src/scale_mmx.c 2015-05-10 12:52:36.495345985 +0200
-@@ -29,7 +29,7 @@
- * Including source code like this may be frowned upon by some,
- * but the alternative is ungainly conditionally compiled code.
- */
--# if defined(__x86_64__)
-+# if defined(__x86_64__) && !defined(__ILP32__)
- # include "scale_mmx64.c"
- # elif defined(__i386__)
- # include "scale_mmx32.c"
+--- pygame-1.9.6/buildconfig/config_unix.py.orig 2019-04-25 08:14:17.000000000 +0200
++++ pygame-1.9.6/buildconfig/config_unix.py 2024-09-26 17:35:08.789307494 +0200
+@@ -149,7 +149,7 @@ def main(sdl2=False):
+ #these get prefixes with '/usr' and '/usr/local' or the $LOCALBASE
+ if sdl2:
+ origincdirs = ['/include', '/include/SDL2']
+- origlibdirs = ['/lib','/lib64','/X11R6/lib',
++ origlibdirs = ['/lib','/lib64','/libx32',
+ '/lib/i386-linux-gnu', '/lib/x86_64-linux-gnu']
+ else:
+ origincdirs = ['/include', '/include/SDL', '/include/SDL']
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-pygame.git/commitdiff/67efd172718d75331473550b1c15bdc724cfb778
More information about the pld-cvs-commit
mailing list