2013-05-10 11:43:58 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-pyglet
|
|
|
|
#
|
2023-02-23 11:51:05 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2013-05-10 11:43:58 +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:51:17 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2015-08-21 15:05:32 +00:00
|
|
|
#
|
|
|
|
|
2013-05-10 11:43:58 +00:00
|
|
|
|
2019-06-03 19:42:58 +00:00
|
|
|
%define X_display :98
|
|
|
|
%ifarch %{arm} aarch64 x86_64 %{ix86} ppc64le
|
|
|
|
%bcond_without gtk2
|
|
|
|
%bcond_without test
|
|
|
|
# test_worker_refill_multiple_players_refill_multiple failed once on armv7l
|
|
|
|
%else
|
|
|
|
# s390x fails without out of memory with gtk and freetype,
|
|
|
|
# even with 8G memory from _constraints
|
|
|
|
# ppc has lots of similar problems, especially with gdk
|
|
|
|
%bcond_with test
|
|
|
|
%bcond_with gtk2
|
|
|
|
%endif
|
2020-08-10 11:34:30 +00:00
|
|
|
%define skip_python2 1
|
|
|
|
%bcond_with pytest_helpers
|
2013-05-10 11:43:58 +00:00
|
|
|
Name: python-pyglet
|
2023-02-23 11:51:05 +00:00
|
|
|
Version: 2.0.4
|
2013-05-10 11:43:58 +00:00
|
|
|
Release: 0
|
2017-08-11 07:29:43 +00:00
|
|
|
Summary: Windowing and multimedia library
|
2019-06-03 19:42:58 +00:00
|
|
|
License: BSD-3-Clause AND MIT
|
2013-05-10 11:43:58 +00:00
|
|
|
Group: Development/Languages/Python
|
2023-02-23 11:51:05 +00:00
|
|
|
URL: https://github.com/pyglet/pyglet
|
2020-08-10 11:34:30 +00:00
|
|
|
Source0: https://files.pythonhosted.org/packages/source/p/pyglet/pyglet-%{version}.zip
|
2015-08-21 15:05:32 +00:00
|
|
|
Source1: %{name}-rpmlintrc
|
2017-08-06 02:33:19 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2015-08-21 15:05:32 +00:00
|
|
|
BuildRequires: dos2unix
|
2017-08-06 02:33:19 +00:00
|
|
|
BuildRequires: fdupes
|
2017-08-11 07:29:43 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-08-10 11:34:30 +00:00
|
|
|
BuildRequires: unzip
|
2019-06-03 19:42:58 +00:00
|
|
|
Requires: Mesa-dri
|
2020-08-10 11:34:30 +00:00
|
|
|
Requires: libxcb-glx0
|
2019-06-03 19:42:58 +00:00
|
|
|
Requires: python-Pillow
|
|
|
|
Requires: python-future
|
|
|
|
Requires: python-pypng
|
|
|
|
Recommends: alsa-lib
|
|
|
|
Recommends: fontconfig
|
|
|
|
Recommends: freetype
|
|
|
|
Recommends: libGLU1
|
|
|
|
Recommends: libopenal0
|
2020-08-10 11:34:30 +00:00
|
|
|
BuildArch: noarch
|
2019-06-03 19:42:58 +00:00
|
|
|
%if %{with gtk2}
|
|
|
|
Recommends: gtk2
|
|
|
|
%endif
|
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module Pillow}
|
|
|
|
BuildRequires: %{python_module future}
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: Mesa-dri
|
|
|
|
BuildRequires: alsa-lib
|
|
|
|
BuildRequires: fontconfig
|
|
|
|
BuildRequires: freetype
|
|
|
|
BuildRequires: gnu-free-fonts
|
|
|
|
BuildRequires: libopenal0
|
|
|
|
BuildRequires: xorg-x11-server
|
2013-05-10 15:19:50 +00:00
|
|
|
BuildRequires: pkgconfig(gl)
|
|
|
|
BuildRequires: pkgconfig(glu)
|
2019-06-03 19:42:58 +00:00
|
|
|
BuildRequires: pkgconfig(libpulse)
|
2013-05-10 15:19:50 +00:00
|
|
|
BuildRequires: pkgconfig(x11)
|
2019-06-03 19:42:58 +00:00
|
|
|
BuildRequires: pkgconfig(xcb-glx)
|
|
|
|
%if %{with gtk2}
|
|
|
|
BuildRequires: gtk2
|
|
|
|
%endif
|
|
|
|
%if %{with pytest_helpers}
|
|
|
|
BuildRequires: %{python_module pytest-error-for-skips}
|
|
|
|
BuildRequires: %{python_module pytest-instafail}
|
|
|
|
BuildRequires: %{python_module pytest-timeout}
|
|
|
|
%endif
|
|
|
|
# endif test
|
|
|
|
%endif
|
2017-08-06 02:33:19 +00:00
|
|
|
%python_subpackages
|
2013-05-10 11:43:58 +00:00
|
|
|
|
|
|
|
%description
|
Accepting request 576825 from home:TheBlackCat:branches:devel:languages:python
- Update to version 1.3.1
+ Bugfixes
* #158 Fix mouse events in mouse exclusive mode on Windows.
* #105 Crashes in PulseAudio;
* #163 Workaround for running inside Spyder;
* #45 Expose viewport size for use on HiDPI screens;
* #15 Respect keyboard layout on macOS;
- Update to version 1.3.0
* The entire codebase is now compatible with both Python 2 and Python 3 without the need for 2to3.
+ New features
* The procedural audio module is now more usable. This module allows synthesis of basic
waveforms, such as sine, square, triangle, sawtooth, and simple FM (two operator sine).
In addition, several basic amplitude envelopes are now available to apply to generated audio.
These include ADSR, linear decay, tremolo, and flat envelopes.
+ Improvements
* Improved font rendering for fonts with negative bearing (#99)
* Sprites now have `scale_x` and `scale_y` attributes, allowing for aspect ratio changes. The
existing `scale` attribute sets the overall scaling, and functions as before.
* Sprites have a new `update` method which allows simultaneous changing of position, scale, and
rotation. This reduces some overhead when changing multiple attributes at once.
* The pyglet.resource module now defaults to a 2048x2048 texture for it's internal texture atlas,
but will fall back to the maximum available size that the GPU can provide.
* All modern joysticks and game controllers should now be detected on Linux and Windows.
* Refactored and reimplemented pyglet.media. Many improvements to stability. Different drivers
should now behave more similar.
* WM_CLASS hints are now set on Linux. On modern Linux desktop environments and window managers,
this allows for proper tracking of pyglet applications. Previously, pyglet apps may show up as
"Unknown" under the active window list in the environment. The window class hints are set
to the same name as the Window caption, but will fall back to "pyglet" if the Window caption
contains non-ascii characters.
* Vastly improved documentation and programming guide.
+ Bugfixes
* Limit the minimum window size 1x1 pixel, preventing an OpenGL exception when resizing (#49).
* Font module no longer leaks memory when text is changed (#66).
* Fix crash on Python 2 when sys.argv[0] has non-ASCII characters (#74).
* Windows: Fix crash when opening multiple windows in succession (#81).
* Windows: Fix local font loading (#100).
* Windows: Italic fonts no longer render parts of their neighbors.
* Prevent memory leak from orphaned StreamingSources in long running applications (#103).
* Windows: Fix kerning regression (#115)
* Windows: Window.set_icon no longer fails when given a Texture instead of ImageData (#136)
- Remove upstream-included pyglet-1.2.4-add-wmclass.patch
OBS-URL: https://build.opensuse.org/request/show/576825
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyglet?expand=0&rev=14
2018-02-14 17:55:38 +00:00
|
|
|
Pyglet provides an object-oriented programming interface for
|
2017-08-11 07:29:43 +00:00
|
|
|
developing games and other visually-rich applications.
|
2013-05-10 11:43:58 +00:00
|
|
|
|
|
|
|
%prep
|
2023-02-23 11:51:05 +00:00
|
|
|
%autosetup -p1 -n pyglet-%{version}
|
2019-06-03 19:42:58 +00:00
|
|
|
|
|
|
|
# Windows only, and is a vendored module
|
2021-01-28 23:16:13 +00:00
|
|
|
rm pyglet/font/win32*.py
|
2019-06-03 19:42:58 +00:00
|
|
|
|
|
|
|
# De-vendoring pypng-ing results in failures in v1.3.2, as it is using pypng an earlier pypng:
|
|
|
|
# AttributeError: 'module' object has no attribute 'Writer'
|
|
|
|
# pyglet 1.4 is using the latest pypng 0.0.19, the same version as python-pypng package
|
|
|
|
rm pyglet/extlibs/png.py
|
|
|
|
sed -i 's/import pyglet.extlibs.png as pypng/import png as pypng/' pyglet/image/codecs/png.py
|
|
|
|
|
|
|
|
# Files unneccessary for Linux runtimes
|
|
|
|
rm -r \
|
|
|
|
pyglet/gl/lib_agl.py pyglet/gl/lib_wgl.py pyglet/gl/wgl*.py \
|
|
|
|
pyglet/*/cocoa.py pyglet/*/quartz.py pyglet/*/win32.py \
|
|
|
|
pyglet/image/codecs/quartz.py pyglet/image/codecs/gdiplus.py \
|
|
|
|
pyglet/window/cocoa/ pyglet/window/win32/ \
|
|
|
|
pyglet/libs/darwin/ pyglet/libs/win32/ \
|
|
|
|
pyglet/media/drivers/directsound/ tests/integration/media/test_directsound.py \
|
|
|
|
tests/integration/platform/test_win_multicore_clock.py
|
|
|
|
|
|
|
|
%if %{without gtk2}
|
|
|
|
# Disable GdkPixbuf
|
|
|
|
sed -i 's/^\( *\).*gdkpixbuf2.*/\1pass/' pyglet/image/codecs/__init__.py
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Allow invocation using unittest discover -vv --start-directory tests/xyz/
|
|
|
|
# https://bitbucket.org/pyglet/pyglet/issues/231/allow-invocation-using-unittest-discover
|
|
|
|
sed -i 's/from \.\.\./from tests./' \
|
|
|
|
tests/unit/media/test_listener.py \
|
|
|
|
tests/integration/image/test_gdkpixbuf2.py \
|
|
|
|
tests/interactive/image/test_image.py
|
|
|
|
|
|
|
|
# Fails with Arial and FreeSerif, Bitstream Vera Sans and Courier
|
|
|
|
# https://bitbucket.org/pyglet/pyglet/issues/245/bitstream-vera-sans-bold-and-italic-font
|
|
|
|
sed -i 's/test_find_font_match_bold/_test_find_font_match_bold/' tests/integration/platform/test_linux_fontconfig.py
|
|
|
|
|
|
|
|
# Tests rely on Arial font, however webcore-fonts is not OSS, and fetchmsttfonts
|
|
|
|
# only includes the script. Use gnu-free-fonts instead.
|
|
|
|
# https://bitbucket.org/pyglet/pyglet/issues/230/use-a-free-er-font-in-test-suite
|
|
|
|
sed -i 's/arial/freeserif/g;s/Arial/FreeSerif/g' \
|
|
|
|
tests/unit/test_text.py \
|
|
|
|
tests/integration/platform/test_linux_fontconfig.py \
|
|
|
|
tests/integration/font/*.py \
|
|
|
|
|
|
|
|
## Unit tests
|
|
|
|
|
|
|
|
# Convert to a mark, so it can be deselected, bypassing error-for-skips
|
|
|
|
sed -i "s/@unittest.skip('Requires changes to events from fork by Leif')/@pytest.mark.leif_fork/" tests/unit/test_events.py
|
|
|
|
sed -i 's/import unittest/import unittest, pytest/' tests/unit/test_events.py
|
|
|
|
|
|
|
|
## Integration tests
|
|
|
|
|
|
|
|
# Test fails on all platforms
|
|
|
|
#sed -i 's/test_unreferenced_cleanup/_test_unreferenced_cleanup/' tests/integration/media/test_player.py
|
|
|
|
|
|
|
|
# test_driver: AssertionError: Cannot load audio driver for your platform
|
|
|
|
# test_openal: OpenALException: OpenAL Exception [40965: Out of Memory]: Failed to open device.
|
|
|
|
# Similar for pulse, and hang in player
|
|
|
|
rm -f tests/integration/media/test_driver.py \
|
|
|
|
tests/integration/media/test_player.py \
|
|
|
|
tests/integration/media/test_openal.py \
|
|
|
|
tests/integration/media/test_pulse.py
|
|
|
|
|
|
|
|
# test_immediate_drawing*, test_immediate_drawing and multitexture fails
|
|
|
|
# except on Tumbleweed
|
|
|
|
rm -f tests/integration/graphics/test_retained_drawing*.py \
|
|
|
|
tests/integration/graphics/test_immediate_drawing*.py \
|
|
|
|
tests/integration/graphics/test_multitexture.py
|
|
|
|
|
|
|
|
## Interactive tests
|
|
|
|
|
|
|
|
# Fix missing interactive_test_base
|
|
|
|
# See https://bitbucket.org/pyglet/pyglet/issues/234/interactive_test_base-is-missing
|
2020-08-10 11:34:30 +00:00
|
|
|
sed -i '/interactive_test_base/d' tests/interactive/__init__.py
|
2019-06-03 19:42:58 +00:00
|
|
|
rm tests/base/test_interactive_test_base.py
|
|
|
|
|
|
|
|
# Final tidy up
|
|
|
|
|
|
|
|
# Convert to unix line endings
|
|
|
|
find pyglet -name "*.py" -exec dos2unix "{}" "+"
|
|
|
|
|
2013-05-10 11:43:58 +00:00
|
|
|
%build
|
2017-08-06 02:33:19 +00:00
|
|
|
%python_build
|
2013-05-10 11:43:58 +00:00
|
|
|
|
|
|
|
%install
|
2017-08-06 02:33:19 +00:00
|
|
|
%python_install
|
2019-06-03 19:42:58 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2013-05-10 11:43:58 +00:00
|
|
|
|
2019-06-03 19:42:58 +00:00
|
|
|
%{python_expand pkgdocdir=%{_docdir}/$(cat _current_flavor)-pyglet
|
|
|
|
mkdir -p %{buildroot}$pkgdocdir
|
|
|
|
cp -Lr examples/ %{buildroot}$pkgdocdir/
|
|
|
|
find %{buildroot}$pkgdocdir/examples/ -name "*.py" -exec sed -i "s|^#!%{_bindir}/python$|#!%{__$python}|" {} \;
|
|
|
|
find %{buildroot}$pkgdocdir/examples/ -name "*.py" -exec sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" {} \;
|
|
|
|
|
|
|
|
%fdupes %{buildroot}$pkgdocdir/examples/
|
2017-08-06 02:33:19 +00:00
|
|
|
}
|
2015-08-21 15:05:32 +00:00
|
|
|
|
2019-06-03 19:42:58 +00:00
|
|
|
%if %{with test}
|
|
|
|
%check
|
|
|
|
#############################################
|
|
|
|
### Launch a virtual framebuffer X server ###
|
|
|
|
#############################################
|
|
|
|
export DISPLAY=%{X_display}
|
|
|
|
Xvfb +iglx %{X_display} -screen 0 1600x1200x16 &
|
|
|
|
trap "kill $! || true" EXIT
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
# This is to allow use of pytest-error-for-skips and pytest-instafail,
|
|
|
|
# used to see problems even when tests hang.
|
|
|
|
# test_multiple_start_stop is occasional failures on most platforms
|
2021-02-19 11:15:13 +00:00
|
|
|
# test_pause_resume is occasional failures on aarch64
|
2019-06-03 19:42:58 +00:00
|
|
|
pytest_k_list="test_openal or test_pulse or test_arb or \
|
|
|
|
test_multitexture or test_clock or test_get_animation_no_video or \
|
|
|
|
leif_fork or test_load_privatefont or test_load_privatefont_from_list or test_directsound_listener or \
|
2021-02-19 11:15:13 +00:00
|
|
|
test_gdiplus_loading or test_quartz_loading or test_quicktime_loading or test_multiple_start_stop or test_pause_resume"
|
2023-02-23 11:51:05 +00:00
|
|
|
# Disable beause broken in python 3.11, gh#pyglet/pyglet#606
|
|
|
|
pytest_k_list+=" or test_push_handlers_instance"
|
2019-06-03 19:42:58 +00:00
|
|
|
|
|
|
|
%if %{without gtk2}
|
|
|
|
pytest_k_list="$pytest_k_list or test_gdkpixbuf2 or test_gdkpixbuf2_loading"
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with pytest_helpers}
|
|
|
|
pytest_addopts="--instafail --error-for-skips --timeout=30 "
|
|
|
|
%endif
|
|
|
|
|
|
|
|
pytest_addopts="$pytest_addopts tests/unit tests/integration"
|
2023-02-23 11:51:05 +00:00
|
|
|
pytest_image_loading="test_resource_image_loading"
|
2019-06-03 19:42:58 +00:00
|
|
|
|
2019-09-16 07:35:06 +00:00
|
|
|
%{python_expand #
|
2019-06-03 19:42:58 +00:00
|
|
|
# These are only problematic on Python 2, and are restored after Python 2 tests
|
|
|
|
# https://bitbucket.org/pyglet/pyglet/issues/223/clock-test-failures
|
2019-09-16 07:35:06 +00:00
|
|
|
if [ $python = python2 ]; then
|
|
|
|
mv tests/unit/test_clock.py tests/unit/.test_clock.py
|
|
|
|
fi
|
2019-06-03 19:42:58 +00:00
|
|
|
|
2023-02-23 11:51:05 +00:00
|
|
|
$python -m pytest $pytest_addopts -k "not ($pytest_k_list or $pytest_image_loading)"
|
|
|
|
# Run test_resource_image_loading tests in a second steps, this fails
|
|
|
|
# if run with the other tests, possible because a test not cleaning
|
|
|
|
# correctly
|
|
|
|
$python -m pytest $pytest_addopts -k "$pytest_image_loading"
|
2019-06-03 19:42:58 +00:00
|
|
|
|
2019-09-16 07:35:06 +00:00
|
|
|
if [ -x tests/unit/.test_clock.py ]; then
|
|
|
|
mv tests/unit/.test_clock.py tests/unit/test_clock.py
|
|
|
|
fi
|
|
|
|
}
|
2019-06-03 19:42:58 +00:00
|
|
|
|
|
|
|
# endif test
|
|
|
|
%endif
|
|
|
|
|
2017-08-06 02:33:19 +00:00
|
|
|
%files %{python_files}
|
2018-12-04 17:19:21 +00:00
|
|
|
%license LICENSE
|
2023-02-23 11:51:05 +00:00
|
|
|
%doc README.md RELEASE_NOTES examples
|
2017-08-06 02:33:19 +00:00
|
|
|
%{python_sitelib}/pyglet
|
|
|
|
%{python_sitelib}/pyglet-%{version}-py*.egg-info
|
2013-05-10 11:43:58 +00:00
|
|
|
|
2013-05-10 15:19:50 +00:00
|
|
|
%changelog
|