From 3d90d46b06c13e9444fe9da5b0f97937bbcdce143d67fdf9129d436be5493de1 Mon Sep 17 00:00:00 2001 From: Todd R Date: Wed, 14 Feb 2018 17:55:38 +0000 Subject: [PATCH] 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 --- pyglet-1.2.4-add-wmclass.patch | 34 ------------------------- pyglet-1.2.4.tar.gz | 3 --- pyglet-1.3.1.tar.gz | 3 +++ python-pyglet.changes | 46 ++++++++++++++++++++++++++++++++++ python-pyglet.spec | 35 ++++++++++++++++++++------ 5 files changed, 76 insertions(+), 45 deletions(-) delete mode 100644 pyglet-1.2.4-add-wmclass.patch delete mode 100644 pyglet-1.2.4.tar.gz create mode 100644 pyglet-1.3.1.tar.gz diff --git a/pyglet-1.2.4-add-wmclass.patch b/pyglet-1.2.4-add-wmclass.patch deleted file mode 100644 index 73a2c53..0000000 --- a/pyglet-1.2.4-add-wmclass.patch +++ /dev/null @@ -1,34 +0,0 @@ -Index: pyglet/window/xlib/__init__.py -=================================================================== ---- pyglet/window/xlib/__init__.py.orig -+++ pyglet/window/xlib/__init__.py -@@ -352,6 +352,9 @@ class XlibWindow(BaseWindow): - # Set caption - self.set_caption(self._caption) - -+ # Set WM_CLASS for modern desktop environments -+ self.set_wm_class(self._caption) -+ - # this is supported by some compositors (ie gnome-shell), and more to come - # see: http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idp6357888 - _NET_WM_BYPASS_COMPOSITOR_HINT_ON = c_ulong(int(self._fullscreen)) -@@ -513,6 +516,19 @@ class XlibWindow(BaseWindow): - self._set_text_property('_NET_WM_NAME', caption) - self._set_text_property('_NET_WM_ICON_NAME', caption) - -+ def set_wm_class(self, name): -+ # WM_CLASS can only contain Ascii characters -+ try: -+ name = name.encode('ascii') -+ except UnicodeEncodeError: -+ name = "pyglet" -+ -+ hints = xlib.XAllocClassHint() -+ hints.contents.res_class = asbytes(name) -+ hints.contents.res_name = asbytes(name.lower()) -+ xlib.XSetClassHint(self._x_display, self._window, hints.contents) -+ xlib.XFree(hints) -+ - def get_caption(self): - return self._caption - diff --git a/pyglet-1.2.4.tar.gz b/pyglet-1.2.4.tar.gz deleted file mode 100644 index cdea7ec..0000000 --- a/pyglet-1.2.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9f62ffbbcf2b202d084bf158685e77d28b8f4f5f2738f4c5e63a947a07503445 -size 2122017 diff --git a/pyglet-1.3.1.tar.gz b/pyglet-1.3.1.tar.gz new file mode 100644 index 0000000..75c0aca --- /dev/null +++ b/pyglet-1.3.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a73280fa3949ea4890fee28f625c10b1e10a7cda390a08b6bce4740948167cd +size 3576712 diff --git a/python-pyglet.changes b/python-pyglet.changes index 21d56b1..defa5f4 100644 --- a/python-pyglet.changes +++ b/python-pyglet.changes @@ -1,3 +1,49 @@ +------------------------------------------------------------------- +Wed Feb 14 16:21:19 UTC 2018 - toddrme2178@gmail.com + +- 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 + ------------------------------------------------------------------- Sun Aug 13 15:07:20 UTC 2017 - toddrme2178@gmail.com diff --git a/python-pyglet.spec b/python-pyglet.spec index 7c30cc1..668e294 100644 --- a/python-pyglet.spec +++ b/python-pyglet.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyglet # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,8 +17,11 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define X_display ":98" +# TODO: Can't get display working with glx +%bcond_with test Name: python-pyglet -Version: 1.2.4 +Version: 1.3.1 Release: 0 Summary: Windowing and multimedia library License: BSD-3-Clause @@ -28,8 +31,6 @@ Source0: https://files.pythonhosted.org/packages/source/p/pyglet/pyglet-% Source1: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE pyglet-1.2.4-fix-image-import.patch -- fix "import Image" Patch0: pyglet-1.2.4-fix-image-import.patch -# PATCH-FEATURE-UPSTREAM pyglet-1.2.4-add-wmclass.patch -- https://bitbucket.org/pyglet/pyglet/issues/92 -Patch1: pyglet-1.2.4-add-wmclass.patch BuildRequires: %{python_module Pillow} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} @@ -44,26 +45,32 @@ BuildRequires: python-rpm-macros BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(x11) +%if %{with test} +BuildRequires: %{python_module pytest} +BuildRequires: config(Mesa) +BuildRequires: xorg-x11-server +%endif Requires: alsa-devel Requires: fontconfig-devel Requires: freetype2-devel Requires: gtk2-devel Requires: openal-soft-devel +Requires: python-Pillow +Requires: config(Mesa) Requires: pkgconfig(gl) Requires: pkgconfig(glu) Requires: pkgconfig(x11) -Requires: python-Pillow BuildArch: noarch + %python_subpackages %description -pyglet provides an object-oriented programming interface for +Pyglet provides an object-oriented programming interface for developing games and other visually-rich applications. %prep %setup -q -n pyglet-%{version} %patch0 -%patch1 # Convert to unix line end find -name "*.py" -exec dos2unix "{}" "+" @@ -81,9 +88,21 @@ find examples_%{$python_bin_suffix} -name "*.py" -exec sed -i "s|^#!/usr/bin/env %fdupes %{buildroot}%{$python_sitelib} } +%if %{with test} +%check +############################################# +### Launch a virtual framebuffer X server ### +############################################# +export DISPLAY=%{X_display} + vfb %{X_display} >& Xvfb.log & +trap "kill $! || true" EXIT +sleep 10 +%python_expand py.test-%{$python_bin_suffix} +%endif + %files %{python_files} %defattr(-,root,root,-) -%doc CHANGELOG README LICENSE NOTICE RELEASE_NOTES +%doc LICENSE NOTICE README RELEASE_NOTES %doc examples_%{python_bin_suffix} %{python_sitelib}/pyglet %{python_sitelib}/pyglet-%{version}-py*.egg-info