2017-11-10 19:59:47 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-PySDL2
|
|
|
|
#
|
2024-02-02 12:22:05 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2017-11-10 19:59:47 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-12-04 13:54:24 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2017-11-10 19:59:47 +00:00
|
|
|
|
|
|
|
|
2018-12-04 17:19:51 +00:00
|
|
|
%define X_display ":98"
|
2017-11-10 19:59:47 +00:00
|
|
|
Name: python-PySDL2
|
2023-07-17 06:39:36 +00:00
|
|
|
Version: 0.9.16
|
2017-11-10 19:59:47 +00:00
|
|
|
Release: 0
|
2022-03-21 07:24:13 +00:00
|
|
|
Summary: Python ctypes wrapper around SDL2
|
2018-12-04 13:54:24 +00:00
|
|
|
License: SUSE-Public-Domain
|
2022-03-21 07:24:13 +00:00
|
|
|
URL: https://github.com/py-sdl/py-sdl2
|
2017-11-10 19:59:47 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-%{version}.tar.gz
|
2023-08-21 09:32:52 +00:00
|
|
|
# PATCH-FIX-UPSTREAM fix-tests-SDL_GetError.patch -- based on commit 1c865e3
|
|
|
|
Patch0: https://github.com/py-sdl/py-sdl2/commit/1c865e3f751e678f3ad2d8f3fca17a0755fbeaf7.patch#/fix-tests-SDL_GetError.patch
|
|
|
|
# PATCH-FIX-UPSTREAM fix-test-SDL_hid_enumerate.patch -- based on commit d7c0604
|
|
|
|
Patch1: https://github.com/py-sdl/py-sdl2/commit/d7c0604381f6cbefa2c8b51c84b879e2f927e91e.patch#/fix-test-SDL_hid_enumerate.patch
|
|
|
|
# PATCH-FIX-UPSTREAM fix-partially-resolve-video_test.patch -- based on commit ed28ea6
|
|
|
|
Patch2: https://github.com/py-sdl/py-sdl2/commit/ed28ea6305dede1b6ba046e36ddae9ba2016b62e.patch#/fix-partially-resolve-video_test.patch
|
2022-08-01 15:07:48 +00:00
|
|
|
BuildRequires: %{python_module pip}
|
2017-11-10 19:59:47 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2022-08-01 15:07:48 +00:00
|
|
|
BuildRequires: %{python_module wheel}
|
2022-07-29 16:14:57 +00:00
|
|
|
BuildRequires: SDL2 >= 2.0.22
|
|
|
|
BuildRequires: SDL2_gfx >= 1.0.4
|
|
|
|
BuildRequires: SDL2_image >= 2.6.0
|
|
|
|
BuildRequires: SDL2_mixer >= 2.6.0
|
|
|
|
BuildRequires: SDL2_ttf >= 2.20.0
|
2017-11-10 19:59:47 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2021-02-09 08:56:11 +00:00
|
|
|
# SECTION test requirements
|
2022-03-21 07:24:13 +00:00
|
|
|
BuildRequires: %{python_module numpy}
|
|
|
|
BuildRequires: %{python_module Pillow}
|
2021-02-09 08:56:11 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2024-02-02 12:22:05 +00:00
|
|
|
BuildRequires: libmpg123-0
|
2021-02-09 08:56:11 +00:00
|
|
|
BuildRequires: xorg-x11-server
|
|
|
|
# /SECTION
|
2022-07-29 16:14:57 +00:00
|
|
|
Requires: SDL2 >= 2.0.22
|
|
|
|
Requires: SDL2_gfx >= 1.0.4
|
|
|
|
Requires: SDL2_image >= 2.6.0
|
|
|
|
Requires: SDL2_mixer >= 2.6.0
|
|
|
|
Requires: SDL2_ttf >= 2.20.0
|
2017-11-10 19:59:47 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2022-03-21 07:24:13 +00:00
|
|
|
PySDL2 is a pure Python wrapper around the SDL2, SDL2_mixer, SDL2_image,
|
|
|
|
SDL2_ttf, and SDL2_gfx libraries. Instead of relying on C code, it uses
|
|
|
|
the built-in ctypes module to interface with SDL2, and provides simple
|
|
|
|
Python classes and wrappers for common SDL2 functionality.
|
2017-11-10 19:59:47 +00:00
|
|
|
|
|
|
|
%prep
|
2021-08-29 20:42:13 +00:00
|
|
|
%autosetup -p1 -n PySDL2-%{version}
|
2022-08-01 15:07:48 +00:00
|
|
|
|
2020-03-27 10:33:35 +00:00
|
|
|
sed -i 's/\r$//' AUTHORS.txt COPYING.txt README.md
|
2022-11-02 12:12:24 +00:00
|
|
|
find . -name *DS_Store -delete
|
2017-11-10 19:59:47 +00:00
|
|
|
|
|
|
|
%build
|
2022-08-01 15:07:48 +00:00
|
|
|
%pyproject_wheel
|
2017-11-10 19:59:47 +00:00
|
|
|
|
|
|
|
%install
|
2022-08-01 15:07:48 +00:00
|
|
|
%pyproject_install
|
2017-11-10 19:59:47 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%check
|
2022-03-21 07:24:13 +00:00
|
|
|
export SDL_VIDEODRIVER=dummy
|
|
|
|
export SDL_AUDIODRIVER=dummy
|
|
|
|
export SDL_RENDER_DRIVER=software
|
|
|
|
export PYTHONFAULTHANDLER=1
|
|
|
|
|
2022-11-02 12:02:41 +00:00
|
|
|
%pytest -rfEs
|
2020-03-27 10:33:35 +00:00
|
|
|
|
2017-11-10 19:59:47 +00:00
|
|
|
%files %{python_files}
|
2018-12-04 17:19:51 +00:00
|
|
|
%license COPYING.txt
|
2022-07-29 16:14:57 +00:00
|
|
|
%doc AUTHORS.txt README.md doc/
|
2021-02-09 08:56:11 +00:00
|
|
|
%{python_sitelib}/sdl2
|
|
|
|
%{python_sitelib}/PySDL2-%{version}*-info
|
2017-11-10 19:59:47 +00:00
|
|
|
|
|
|
|
%changelog
|