python3Packages.webrtcvad: don't use pkg_resources

Fixes build on 3.14
This commit is contained in:
K900
2026-06-29 10:00:59 +03:00
parent 36f8947872
commit ee9587600e
2 changed files with 27 additions and 0 deletions
@@ -17,6 +17,12 @@ buildPythonPackage (finalAttrs: {
hash = "sha256-8b7S+yW2P7expV1kCQyZPJyRZ7KEha4Lzdgc9u3pauo=";
};
patches = [
# remove pkg_resources usage
# backport of https://github.com/wiseman/py-webrtcvad/pull/96
./no-pkg-resources.patch
];
build-system = [ setuptools ];
# required WAV files for testing are not included in the tarball
@@ -0,0 +1,21 @@
--- a/webrtcvad.py
+++ b/webrtcvad.py
@@ -1,11 +1,16 @@
-import pkg_resources
+try:
+ # Python 3.8+
+ from importlib.metadata import version
+except Exception: # pragma: no cover
+ # Backport for Python < 3.8
+ from importlib_metadata import version
import _webrtcvad
__author__ = "John Wiseman jjwiseman@gmail.com"
__copyright__ = "Copyright (C) 2016 John Wiseman"
__license__ = "MIT"
-__version__ = pkg_resources.get_distribution('webrtcvad').version
+__version__ = version("webrtcvad")
class Vad(object):