14
0
forked from pool/python-pygame
Files
python-pygame/python-pygame.spec
Daniel Garcia 9214d79096 - Update to 2.1.3:
* 2.1.2 by @illume in #2957
  * Fix path dependencies by @SergioArnaud in #2975
  * Add test for pygame.locals by @ankith26 in #2958
  * Fix Pygame imported class typehints by @MightyJosip in #2965
  * Fix some bugs in camera.py by @ankith26 in #2961
  * Clean modinit C code, fix bugs, use recommended API by @ankith26 in #2952
  * Python2 to Python3 code modernization by @novialriptide in #2984
  * SDL 2.0.20 by @illume in #2983
  * Update the image doc, delineate bytes and str by @Starbuck5 in #2959
  * Add pixel format name into display info by @MyreMylar in #2964
  * Add missing copy test for Vector3 by @JovialKnoll in #3000
  * New black formatting by @novialriptide in #3013
  * Misc fixes: Fix UCS_4 UCS4 typo, incorrect color methods export and display.c error handling bugs by @ankith26 in #2987
  * Snake casify _sdl2.video.Image.flipX and .flipY by @avaxar in #2978
  * Removed unused imports by @novialriptide in #3016
  * Fix warnings, make warnings error on CI by @ankith26 in #2919
  * Added Rect typing and docs that it is iterable by @novialriptide in #2969
  * Fix there typo in tests.rst by @eoghanriley in #3022
  * C code cleanups + cdrom/overlay removal by @Starbuck5 in #3014
  * Make sure surfaces start as opaque black. (MacOS) by @Starbuck5 in #2973
  * Add transform.scale_by, transform.smoothscale_by functions by @Starbuck5 in #2723
  * Fix typo in C_api display docs by @gresm in #3027
  * Font rwops by @Starbuck5 in #2911
  * transform.average_color: Add optional parameter 'consider_alpha' to remove black artifacts if alpha present by @dr0id in #2968
  * pygame.docs: remove warning in docs generation due to a reference to… by @dr0id in #3029
  * Add __new__ and __init__ functions for some types by @zoldalma999 in #3001
  * Regenerate cython files by @ankith26 in #3032
  * 2.1.3.dev2 by @illume in #3039
  * Add .move_towards() for Vector2 and Vector3 by @novialriptide in #2929

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygame?expand=0&rev=41
2023-02-23 12:37:35 +00:00

147 lines
4.8 KiB
RPMSpec

#
# spec file for package python-pygame
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define skip_python36 1
Name: python-pygame
Version: 2.1.3
Release: 0
Summary: A Python Module for Interfacing with the SDL Multimedia Library
License: LGPL-2.1-or-later
URL: https://github.com/pygame/pygame
Source0: https://files.pythonhosted.org/packages/source/p/pygame/pygame-%{version}.tar.gz
# PATCH-FIX-UPSTREAM adjust-surface-mask.patch gh#pygame/pygame#3577
Patch0: adjust-surface-mask.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module setuptools}
BuildRequires: bitstream-vera-fonts
BuildRequires: fdupes
BuildRequires: fontconfig
BuildRequires: libtiff-devel
BuildRequires: libudev-devel
BuildRequires: libv4l-devel >= 0.8.4
BuildRequires: pkgconfig
BuildRequires: portmidi-devel
BuildRequires: python-rpm-macros
BuildRequires: xorg-x11
BuildRequires: xorg-x11-devel
BuildRequires: xorg-x11-fonts
BuildRequires: xorg-x11-fonts-100dpi
BuildRequires: xorg-x11-fonts-75dpi
BuildRequires: xorg-x11-fonts-core
BuildRequires: xorg-x11-fonts-cyrillic
BuildRequires: config(fluid-soundfont-gm)
BuildRequires: pkgconfig(SDL2_image)
BuildRequires: pkgconfig(SDL2_mixer)
BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libmpg123)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(x11)
Requires: fontconfig
Requires: python-numpy
%ifpython2
Provides: pygame = %{version}
Obsoletes: pygame < %{version}
%endif
%python_subpackages
%description
Pygame is a Python wrapper module for the SDL multimedia library. It
contains Python functions and classes that allow you to use SDL's
support for playing CD-ROMs, audio and video output, and keyboard,
mouse and joystick input. Pygame also includes support for the
Numerical Python extension. Pygame is the successor to the pySDL
wrapper project, written by Mark Baker.
%package devel
Summary: Pygame development package
Group: Development/Libraries/Python
Requires: python-pygame = %{version}
%description devel
This package contains the header files for developers of Pygame.
%package -n %{name}-doc
Summary: Pygame documentation and example programs
Group: Documentation/Other
Provides: pygame-doc = %{version}
Obsoletes: pygame-doc < %{version}
Provides: %{python_module pygame-doc = %{version}}
%description -n %{name}-doc
This package contains documentation and example programs for Pygame.
%prep
%autosetup -p1 -n pygame-%{version}
sed -i 's/\r$//' docs/reST/ref/code_examples/draw_module_example.py
sed -i 's/\r$//' docs/licenses/LICENSE*.txt
# Fix wrong-script-interpreter
find examples -name '*.py' -exec sed -i "s|^#!.*env python.*$|#!%{_bindir}/python3|" {} \;
chmod a+x examples/*.py
chmod a-x docs/licenses/LICENSE.sdl_gfx.txt
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export PORTMIDI_INC_PORTTIME=1
%python_build
%install
export CFLAGS="%{optflags} -fno-strict-aliasing"
%python_install
%{python_expand pushd %{buildroot}%{$python_sitearch}
sed -i "s|^#!.*env python.*$|#!%{_bindir}/$python|" pygame/tests/test_utils/png.py
chmod a+x pygame/tests/test_utils/png.py
chmod a+x pygame/examples/*.py
chmod a-x pygame/examples/__init__.py
popd
}
%python_compileall
%python_expand %fdupes %{buildroot}%{$python_sitearch}
# install docs and examples for doc package and deduplicate
mkdir -p %{buildroot}%{_docdir}/%{name}-doc
cp -r examples docs %{buildroot}%{_docdir}/%{name}-doc/
rm %{buildroot}%{_docdir}/%{name}-doc/examples/.editorconfig
%fdupes %{buildroot}%{_docdir}/%{name}-doc/
%check
export SDL_VIDEODRIVER=dummy
export SDL_AUDIODRIVER=disk
export LANG=en_US.UTF-8
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}
$python -m pygame.tests.__main__ -v --exclude opengl --time_out 300
}
%files %{python_files}
%doc README.rst
%license docs/LGPL.txt
%{python_sitearch}/pygame/
%{python_sitearch}/pygame-%{version}*-info
%files %{python_files devel}
%license docs/LGPL.txt
%{python_sysconfig_var INCLUDEPY}/pygame/
%files -n %{name}-doc
%doc %{_docdir}/%{name}-doc/
%changelog