From e9d147619c4576ff6cff3546788f5e7cc57bef6413886af5f6b3e706c12209f4 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 12 Dec 2024 03:15:34 +0000 Subject: [PATCH] - Drop patch no-removed-formats.patch, it was a terrible idea. - Add patch support-python-313.patch: * Add two external module depends for Python 3.13+. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-audioread?expand=0&rev=31 --- .gitattributes | 23 +++++ .gitignore | 1 + no-removed-formats.patch | 27 ++++++ python-audioread.changes | 182 +++++++++++++++++++++++++++++++++++++++ python-audioread.spec | 80 +++++++++++++++++ support-python-313.patch | 41 +++++++++ v3.0.1.tar.gz | 3 + 7 files changed, 357 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 no-removed-formats.patch create mode 100644 python-audioread.changes create mode 100644 python-audioread.spec create mode 100644 support-python-313.patch create mode 100644 v3.0.1.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc 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 new file mode 100644 index 0000000..a8b475e --- /dev/null +++ b/python-audioread.changes @@ -0,0 +1,182 @@ +------------------------------------------------------------------- +Thu Dec 12 03:15:22 UTC 2024 - Steve Kowalik + +- Drop patch no-removed-formats.patch, it was a terrible idea. +- Add patch support-python-313.patch: + * Add two external module depends for Python 3.13+. + +------------------------------------------------------------------- +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 + +- Use the distro default ffmpeg version: + + BuildRequire %ffmpeg_pref instead of ffmpeg-5. + + BuildConflict %{ffmpeg_pref}-mini-libs: we need to have the + decoders available in order to pass the test suite. + + Recommend /usr/bin/ffmpeg instead of ffmpeg-5: the python + library interacts via the ffmpeg binary. + +------------------------------------------------------------------- +Tue Apr 2 23:44:17 UTC 2024 - Steve Kowalik + +- No more greedy globs in %files. +- Switch back to ffmpeg 5. +- Actually run fdupes. + +------------------------------------------------------------------- +Thu Dec 7 20:53:21 UTC 2023 - Dirk Müller + +- update to 3.0.1: + * Fix a possible deadlock when FFmpeg's version output produces too + much data. + +------------------------------------------------------------------- +Fri Sep 23 02:28:43 UTC 2022 - Yogalakshmi Arunachalam + +- update to v3.0.0 + * Merge pull request #114 from Bomme/py36 + * remove .travis.yml since we have GitHub actions now + * install ffmpeg in github action + * add a GitHub actions workflow for python tox tests + * remove deprecated pytest-runner (fully rely on tox instead) + * remove python 2 specific code in gstdec.py + * reorganize imports; remove python 2 specific imports + * remove python 2.7 from travis.yml + * add python_requires to setup.py + * remove mention of Python 2 from README.rst + * Only list python > 3.6 in setup.py and tox.ini + * automatic pyupgrade rewrite + +------------------------------------------------------------------- +Thu Dec 9 12:39:52 UTC 2021 - pgajdos@suse.com + +- pytest-runner is not required for build + +------------------------------------------------------------------- +Mon Mar 8 22:34:21 UTC 2021 - Dirk Müller + +- update to 2.1.9: + * Work correctly with GStreamer 1.18 and later (thanks to @ssssam) + +------------------------------------------------------------------- +Wed Jul 31 08:47:01 UTC 2019 - pgajdos@suse.com + +- version update to 2.1.8 + * Fix an unhandled ``OSError`` when FFmpeg is not installed. + * Properly close some filehandles in the FFmpeg backend (thanks to + @RyanMarcus and @ssssam). + * The maddec backend now always produces bytes objects, like the other + backends (thanks to @ssssam). + * Resolve an audio data memory leak in the GStreamer backend (thanks again to + @ssssam). + * You can now optionally specify which specific backends ``audio_open`` should + try (thanks once again to @ssssam). +- deleted patches + - 0001-maddec-Ensure-that-the-audio-blocks-are-of-type-bytes.patch (upstreamed) +- deleted sources + - LICENSE (not needed) + +------------------------------------------------------------------- +Mon Feb 25 15:06:33 UTC 2019 - Antonio Larrosa + +- Add 0001-maddec-Ensure-that-the-audio-blocks-are-of-type-bytes.patch + to ensure audio blocks are always of type bytes (and not sometimes + bytearray when using maddec). + +------------------------------------------------------------------- +Tue Dec 4 12:45:49 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Sat Nov 3 03:23:46 UTC 2018 - Todd R + +- Update to 2.1.6 + * Fix a "no such process" crash in the FFmpeg backend on Windows + Subsystem for Linux (thanks to @llamasoft). + * Avoid suppressing SIGINT in the GStreamer backend on older + versions of PyGObject (thanks to @lazka). +- Recommend dependencies needed for full functionality. +- Include license file + +------------------------------------------------------------------- +Thu Sep 28 07:21:03 UTC 2017 - alarrosa@suse.com + +- Update to 2.1.5 + * Properly clean up the file handle when a backend fails to decode a file. + * Fix parsing of "N.M" channel counts in the FFmpeg backend. + * Avoid a crash in the raw backend when a file uses an unsupported + number of bits per sample (namely, 24-bit samples in Python < 3.4). + * Add a __version__ value to the package. + +------------------------------------------------------------------- +Sat Aug 12 21:19:28 UTC 2017 - jengelh@inai.de + +- Trim author list and redundant license info. Improve summary. + +------------------------------------------------------------------- +Fri Apr 21 17:51:35 UTC 2017 - alarrosa@suse.com + +- Use singlespec macros + +------------------------------------------------------------------- +Wed Jan 18 12:16:46 UTC 2017 - alarrosa@suse.com + +- Initial package release + + 2.1.4 + Fix a bug in the FFmpeg backend where, after closing a file, the program's + standard input stream would be "broken" and wouldn't receive any input. + + 2.1.3 + Avoid some warnings in the GStreamer backend when using modern versions of + GLib. We now require at least GLib 2.32. + + 2.1.2 + Fix a file descriptor leak when opening and closing many files using + GStreamer. + + 2.1.1 + Just fix ReST formatting in the README. + + 2.1.0 + The FFmpeg backend can now also use Libav's ``avconv`` command. + Fix a warning by requiring GStreamer >= 1.0. + Fix some Python 3 crashes with the new GStreamer backend (thanks to + @xix-xeaon). + + 2.0.0 + The GStreamer backend now uses GStreamer 1.x via the new + gobject-introspection API (and is compatible with Python 3). + + 1.2.2 + When running FFmpeg on Windows, disable its crash dialog. Thanks to + jcsaaddupuy. + + 1.2.1 + Fix an unhandled exception when opening non-raw audio files (thanks to + aostanin). + Fix Python 3 compatibility for the raw-file backend. + + 1.2.0 + Add support for FFmpeg on Windows (thanks to Jean-Christophe Saad-Dupuy). + + 1.1.0 + Add support for Sun/NeXT `Au files`_ via the standard-library ``sunau`` + module (thanks to Dan Ellis). + + 1.0.3 + Use the rawread (standard-library) backend for .wav files. + + 1.0.2 + Send SIGKILL, not SIGTERM, to ffmpeg processes to avoid occasional hangs. + + 1.0.1 + When GStreamer fails to report a duration, raise an exception instead of + silently setting the duration field to None. + diff --git a/python-audioread.spec b/python-audioread.spec new file mode 100644 index 0000000..e6c9647 --- /dev/null +++ b/python-audioread.spec @@ -0,0 +1,80 @@ +# +# spec file for package python-audioread +# +# Copyright (c) 2024 SUSE LLC +# +# 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. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-audioread +Version: 3.0.1 +Release: 0 +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-UPSTREAM Based on gh#beetbox/audioread#145 +Patch0: support-python-313.patch +BuildRequires: %{ffmpeg_pref} +BuildRequires: %{python_module base} +BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module standard-aifc if %python-base >= 3.13} +BuildRequires: %{python_module standard-sunau if %python-base >= 3.13} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildConflicts: %{ffmpeg_pref}-mini-libs +BuildRequires: python-rpm-macros +BuildArch: noarch +%if 0%{?python_version_nodots} >= 313 +Requires: python-standard-aifc +Requires: python-standard-sunau +%endif +Recommends: /usr/bin/ffmpeg +Recommends: python-gobject +Recommends: python-pymad +Recommends: typelib(Gst) = 1.0 + +%python_subpackages + +%description +Decode audio files using whichever backend is available. The library +currently supports: + +- Gstreamer via PyGObject. +- MAD via the pymad bindings. +- FFmpeg or Libav via its command-line interface. +- The standard library wave, aifc, and sunau modules (for + uncompressed audio formats). + +%prep +%autosetup -p1 -n audioread-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%doc README.rst +%license LICENSE +%{python_sitelib}/audioread +%{python_sitelib}/audioread-%{version}.dist-info + +%changelog diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..f27de21 --- /dev/null +++ b/support-python-313.patch @@ -0,0 +1,41 @@ +From c81adeb553f25f408a85803afcff7d3efd11f722 Mon Sep 17 00:00:00 2001 +From: Luke Blaney +Date: Wed, 30 Oct 2024 18:42:47 +0000 +Subject: [PATCH 1/2] Add standard-aifc and standard-sunau as dependencies for + python 3.13 and above. Python core removed these modules in 3.13 as part of + PEP-594 https://peps.python.org/pep-0594/ The standard-* modules are forks of + the modules that had previously been in the python core. Fixes + https://github.com/beetbox/audioread/issues/144 + +--- + pyproject.toml | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: audioread-3.0.1/pyproject.toml +=================================================================== +--- audioread-3.0.1.orig/pyproject.toml ++++ audioread-3.0.1/pyproject.toml +@@ -11,6 +11,10 @@ readme = "README.rst" + requires-python = ">=3.6" + dynamic = ["version", "description"] + urls.Home = "https://github.com/beetbox/audioread" ++dependencies = [ ++ "standard-aifc; python_version >= '3.13'", ++ "standard-sunau; python_version >= '3.13'", ++] + classifiers = [ + 'Topic :: Multimedia :: Sound/Audio :: Conversion', + 'Intended Audience :: Developers', +Index: audioread-3.0.1/.github/workflows/main.yml +=================================================================== +--- audioread-3.0.1.orig/.github/workflows/main.yml ++++ audioread-3.0.1/.github/workflows/main.yml +@@ -8,7 +8,7 @@ jobs: + runs-on: ubuntu-latest + strategy: + matrix: +- python: ["3.8", "3.9", "3.10", "3.11"] ++ python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v2 diff --git a/v3.0.1.tar.gz b/v3.0.1.tar.gz new file mode 100644 index 0000000..97b2d9c --- /dev/null +++ b/v3.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98367fc46c436922e5c5b6aae59606c60c7ced36a0336cb8845fe85d0b2de383 +size 112064