forked from pool/python-PySDL2
Accepting request 870368 from home:bnavigator:branches:devel:languages:python
- remove duplicate check section: Only the Xvfb version runs without segfaults when loading the SDL libraries. (Except for two flaky Window position and size tests) OBS-URL: https://build.opensuse.org/request/show/870368 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-PySDL2?expand=0&rev=11
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 8 22:45:09 UTC 2021 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- remove duplicate check section: Only the Xvfb version runs
|
||||||
|
without segfaults when loading the SDL libraries. (Except for
|
||||||
|
two flaky Window position and size tests)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Mar 27 10:23:12 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
|
Fri Mar 27 10:23:12 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-PySDL2
|
# spec file for package python-PySDL2
|
||||||
#
|
#
|
||||||
# Copyright (c) 2020 SUSE LLC
|
# Copyright (c) 2021 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -17,15 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!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"
|
%define X_display ":98"
|
||||||
BuildRequires: %{python_module pytest}
|
|
||||||
BuildRequires: SDL2
|
|
||||||
BuildRequires: SDL2_ttf
|
|
||||||
BuildRequires: xorg-x11-server
|
|
||||||
%endif
|
|
||||||
Name: python-PySDL2
|
Name: python-PySDL2
|
||||||
Version: 0.9.7
|
Version: 0.9.7
|
||||||
Release: 0
|
Release: 0
|
||||||
@@ -33,13 +25,23 @@ Summary: Python SDL2 bindings
|
|||||||
License: SUSE-Public-Domain
|
License: SUSE-Public-Domain
|
||||||
URL: https://github.com/marcusva/py-sdl2
|
URL: https://github.com/marcusva/py-sdl2
|
||||||
Source: https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/P/PySDL2/PySDL2-%{version}.tar.gz
|
||||||
BuildRequires: %{python_module pytest}
|
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: SDL2 >= 2.0.5
|
BuildRequires: SDL2 >= 2.0.5
|
||||||
|
BuildRequires: SDL2_gfx >= 1.0.3
|
||||||
|
BuildRequires: SDL2_image >= 2.0.1
|
||||||
|
BuildRequires: SDL2_mixer >= 2.0.1
|
||||||
BuildRequires: SDL2_ttf >= 2.0.14
|
BuildRequires: SDL2_ttf >= 2.0.14
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
|
# SECTION test requirements
|
||||||
|
BuildRequires: %{python_module opengl}
|
||||||
|
BuildRequires: %{python_module pytest}
|
||||||
|
BuildRequires: xorg-x11-server
|
||||||
|
# /SECTION
|
||||||
Requires: SDL2 >= 2.0.5
|
Requires: SDL2 >= 2.0.5
|
||||||
|
Requires: SDL2_gfx >= 1.0.3
|
||||||
|
Requires: SDL2_image >= 2.0.1
|
||||||
|
Requires: SDL2_mixer >= 2.0.1
|
||||||
Requires: SDL2_ttf >= 2.0.14
|
Requires: SDL2_ttf >= 2.0.14
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
@@ -60,10 +62,10 @@ sed -i 's/\r$//' AUTHORS.txt COPYING.txt README.md
|
|||||||
%python_install
|
%python_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%if %{with test}
|
|
||||||
%check
|
%check
|
||||||
#############################################
|
#############################################
|
||||||
### Launch a virtual framebuffer X server ###
|
### Launch a virtual framebuffer X server ###
|
||||||
|
### (pytest-xvfb is not enough) ###
|
||||||
#############################################
|
#############################################
|
||||||
export DISPLAY=%{X_display}
|
export DISPLAY=%{X_display}
|
||||||
Xvfb %{X_display} >& Xvfb.log &
|
Xvfb %{X_display} >& Xvfb.log &
|
||||||
@@ -71,17 +73,19 @@ trap "kill $! || true" EXIT
|
|||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
pushd sdl2/test
|
pushd sdl2/test
|
||||||
%python_exec -B -m pytest
|
# we do not have audio devices in build environment
|
||||||
|
donttest+=" or test_Mix_OpenAudio or test_SDL_GetNumAudioDevices or TestSDLMixer"
|
||||||
|
# we get border size 0 in build "desktop" environment
|
||||||
|
donttest+=" or test_SDL_GetWindowsBordersSize"
|
||||||
|
# flaky segfaults
|
||||||
|
donttest+=" or (TestSDL2ExtWindow and (test_Window_position or test_Window_size))"
|
||||||
|
%pytest -k "not (${donttest:4})"
|
||||||
popd
|
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}
|
%files %{python_files}
|
||||||
%license COPYING.txt
|
%license COPYING.txt
|
||||||
%doc AUTHORS.txt README.md
|
%doc AUTHORS.txt README.md
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/sdl2
|
||||||
|
%{python_sitelib}/PySDL2-%{version}*-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user