14
0
forked from pool/python-PySDL2
Files
python-PySDL2/python-PySDL2.spec
Tomáš Chvátal df21fcd728 Accepting request 788962 from home:mcalabkova:branches:devel:languages:python
- update to version 0.9.7
  * The minimum required SDL version is 2.0.5
  * The minimum required SDL_ttf version is 2.0.14
  * The minimum required SDL_mixer version is 2.0.1
  * The minimum required SDL_image version is 2.0.1
  * Improved compatibility with older SDL2 releases by raising informative
  exceptions whenever a function requiring a newer SDL2 binary is called
  * fixed bug preventing use of background color with wrapped text using
  :meth:`sdl2.ext.FontManager.render()` (PR #134)
  * fixed issue #112: allow easy moving and resizing of :obj:`sdl2.ext.Window()`
  objects through 'position' and 'size' attributes, added 'open' and 'close'
  methods to Window objects
  * fixed issue #130: SDL_RW* functions now accept pointers to RW objects
  * fixed issue #135: :func:`sdl2.SDL_GetPrefPath()` and
  :func:`sdl2.SDL_GetPrefPath()` now return bytestrings instead of pointers
  to strings.
  * fixed issue #148: added support for loading SDL2 .so binaries with numeric
  suffixes on Unix-like OSes (e.g. 'libSDL2.so.2')
  * fixed transparency issues with pallete indexed PNGs (PR #159)

OBS-URL: https://build.opensuse.org/request/show/788962
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PySDL2?expand=0&rev=9
2020-03-27 10:33:35 +00:00

88 lines
2.5 KiB
RPMSpec

#
# spec file for package python-PySDL2
#
# Copyright (c) 2020 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
# Can't be properly tested without full desktop system
%bcond_with test
%if %{with test}
%define X_display ":98"
BuildRequires: %{python_module pytest}
BuildRequires: SDL2
BuildRequires: SDL2_ttf
BuildRequires: xorg-x11-server
%endif
Name: python-PySDL2
Version: 0.9.7
Release: 0
Summary: Python SDL2 bindings
License: SUSE-Public-Domain
URL: https://github.com/marcusva/py-sdl2
Source: https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-%{version}.tar.gz
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: SDL2 >= 2.0.5
BuildRequires: SDL2_ttf >= 2.0.14
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: SDL2 >= 2.0.5
Requires: SDL2_ttf >= 2.0.14
BuildArch: noarch
%python_subpackages
%description
PySDL2 is a wrapper around the SDL2 library and as such similar to the
discontinued PySDL project. In contrast to PySDL, it has no licensing
restrictions, nor does it rely on C code, but uses ctypes instead.
%prep
%setup -q -n PySDL2-%{version}
sed -i 's/\r$//' AUTHORS.txt COPYING.txt README.md
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with test}
%check
#############################################
### Launch a virtual framebuffer X server ###
#############################################
export DISPLAY=%{X_display}
Xvfb %{X_display} >& Xvfb.log &
trap "kill $! || true" EXIT
sleep 10
pushd sdl2/test
%python_exec -B -m pytest
popd
%endif
%check
# we do not have audio devices nor joystick in build environment
%pytest -k "not (test_SDL_GetNumAudioDevices or test_SDL_InitJoystick)"
%files %{python_files}
%license COPYING.txt
%doc AUTHORS.txt README.md
%{python_sitelib}/*
%changelog