diff --git a/no-removed-formats.patch b/no-removed-formats.patch new file mode 100644 index 0000000..f8b999f --- /dev/null +++ b/no-removed-formats.patch @@ -0,0 +1,27 @@ +Index: audioread-3.0.1/audioread/__init__.py +=================================================================== +--- audioread-3.0.1.orig/audioread/__init__.py ++++ audioread-3.0.1/audioread/__init__.py +@@ -13,6 +13,7 @@ + # included in all copies or substantial portions of the Software. + + """Multi-library, cross-platform audio decoding.""" ++import sys + + from . import ffdec + from .exceptions import DecodeError, NoBackendError +@@ -76,9 +77,11 @@ def available_backends(flush_cache=False + if BACKENDS and not flush_cache: + return BACKENDS + +- # Standard-library WAV and AIFF readers. +- from . import rawread +- result = [rawread.RawAudioFile] ++ result = [] ++ if sys.version_info[:2] < (3, 13): ++ # Standard-library WAV and AIFF readers. ++ from . import rawread ++ result.append(rawread.RawAudioFile) + + # Core Audio. + if _ca_available(): diff --git a/python-audioread.changes b/python-audioread.changes index 6077eb2..23d10d4 100644 --- a/python-audioread.changes +++ b/python-audioread.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 26 04:12:39 UTC 2024 - Steve Kowalik + +- Add patch no-removed-formats.patch: + * Only use the rawread backend for Python 3.12 and below. + ------------------------------------------------------------------- Wed Oct 9 15:29:15 UTC 2024 - Dominique Leuenberger diff --git a/python-audioread.spec b/python-audioread.spec index 3dc8eff..368714d 100644 --- a/python-audioread.spec +++ b/python-audioread.spec @@ -23,6 +23,8 @@ Summary: Wrapper for audio decoding via selectable backends License: MIT URL: https://github.com/beetbox/audioread Source0: https://github.com/beetbox/audioread/archive/v%{version}.tar.gz +# PATCH-FIX-OPENSUSE Do not use rawread backend on Python 3.13+ +Patch0: no-removed-formats.patch BuildRequires: %{ffmpeg_pref} BuildRequires: %{python_module base} BuildRequires: %{python_module flit-core} @@ -51,7 +53,7 @@ currently supports: uncompressed audio formats). %prep -%setup -q -n audioread-%{version} +%autosetup -p1 -n audioread-%{version} %build %pyproject_wheel