diff --git a/pyglet-1.5.16-backport-pr-469.patch b/pyglet-1.5.16-backport-pr-469.patch new file mode 100644 index 0000000..e2ef360 --- /dev/null +++ b/pyglet-1.5.16-backport-pr-469.patch @@ -0,0 +1,21 @@ +diff -Naur pyglet-1.5.16-original/tests/unit/media/test_synthesis.py pyglet-1.5.16/tests/unit/media/test_synthesis.py +--- pyglet-1.5.16-original/tests/unit/media/test_synthesis.py 2021-04-13 05:57:56.000000000 -0400 ++++ pyglet-1.5.16/tests/unit/media/test_synthesis.py 2021-10-10 14:46:08.063474857 -0400 +@@ -1,4 +1,5 @@ + import unittest ++import wave + + from ctypes import sizeof + from io import BytesIO +@@ -79,9 +80,8 @@ + source_name = self.source_class.__name__.lower() + filename = "synthesis_{0}_{1}_{2}_1ch.wav".format(source_name, sample_size, sample_rate) + +- with open(get_test_data_file('media', filename), 'rb') as f: +- # discard the wave header: +- loaded_bytes = f.read()[44:] ++ with wave.open(get_test_data_file('media', filename)) as f: ++ loaded_bytes = f.readframes(-1) + source.seek(0) + generated_data = source.get_audio_data(source._max_offset) + bytes_buffer = BytesIO(generated_data.data).getvalue() diff --git a/python-pyglet.spec b/python-pyglet.spec index 2ed23a8..b2efcd7 100644 --- a/python-pyglet.spec +++ b/python-pyglet.spec @@ -5,7 +5,7 @@ Name: python-%{srcname} Version: 1.5.16 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A cross-platform windowing and multimedia library for Python License: BSD @@ -20,6 +20,10 @@ URL: http://www.pyglet.org/ Source0: %{versionedname}-repacked.tar.gz Source1: pyglet-get-tarball.sh +# Backport upstream patch for big-endian support to remove ExcludeArch: +# https://github.com/pyglet/pyglet/pull/469 +Patch0: pyglet-1.5.16-backport-pr-469.patch + # Note that unbundling pypng removes "PNGImageDecoder", which is normally # available for advanced use cases. Instead of: # img = image.load(fname, decoder=PNGImageDecoder) # don't use! @@ -32,11 +36,6 @@ Source1: pyglet-get-tarball.sh BuildArch: noarch -# Tests (and possibly sound synthesis?) fail on big-endian. -# Reported: https://github.com/pyglet/pyglet/issues/278 -# Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=1877849 -ExcludeArch: s390x - BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros @@ -152,6 +151,9 @@ ln -s %{_datadir}/sounds/purple/*.wav tests/data/media/ %changelog +* Sun Oct 10 2021 Benjamin A. Beasley - 1.5.16-4 +- Backport upstream patch to fix ExcludeArch (fix RHBZ#1877849) + * Fri Jul 23 2021 Fedora Release Engineering - 1.5.16-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild