git: c6a2c039bb04 - main - audio/py-speechrecognition: Update to 3.17.0

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 29 Sep 2026 19:28:24 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c6a2c039bb0463c2f9c9c8d34dee56c16c1dabb5

commit c6a2c039bb0463c2f9c9c8d34dee56c16c1dabb5
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2026-09-29 18:58:22 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2026-09-29 19:24:21 +0000

    audio/py-speechrecognition: Update to 3.17.0
    
    - Add ASSEMBLYAI and AUDIO options
    
    Changes:        https://github.com/Uberi/speech_recognition/releases
---
 audio/py-speechrecognition/Makefile                | 24 ++++++++++----
 audio/py-speechrecognition/distinfo                |  6 ++--
 .../files/patch-pyproject.toml                     | 32 +++++++++++++++++++
 audio/py-speechrecognition/files/patch-setup.py    | 37 ----------------------
 4 files changed, 53 insertions(+), 46 deletions(-)

diff --git a/audio/py-speechrecognition/Makefile b/audio/py-speechrecognition/Makefile
index d80bc1623bd6..61fd6665f55f 100644
--- a/audio/py-speechrecognition/Makefile
+++ b/audio/py-speechrecognition/Makefile
@@ -1,9 +1,8 @@
 PORTNAME=	speechrecognition
-PORTVERSION=	3.10.3
+PORTVERSION=	3.17.0
 MASTER_SITES=	PYPI
 CATEGORIES=	audio python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
-DISTNAME=	SpeechRecognition-${PORTVERSION}
 
 MAINTAINER=	sunpoet@FreeBSD.org
 COMMENT=	Python Library for performing speech recognition
@@ -12,11 +11,9 @@ WWW=		https://github.com/Uberi/speech_recognition
 LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=61:devel/py-setuptools@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
 RUN_DEPENDS=	flac:audio/flac \
-		${PYTHON_PKGNAMEPREFIX}pyaudio>=0.2.11:audio/py-pyaudio@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}requests>=2.26.0:www/py-requests@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}typing-extensions>=0:devel/py-typing-extensions@${PY_FLAVOR}
 
 USES=		python
@@ -24,6 +21,21 @@ USE_PYTHON=	autoplist concurrent pep517
 
 NO_ARCH=	yes
 
+OPTIONS_DEFINE=	ASSEMBLYAI AUDIO
+OPTIONS_DEFAULT=AUDIO
+ASSEMBLYAI_DESC=Assembly.ai support via requests
+AUDIO_DESC=	Audio support via pyaudio
+
+ASSEMBLYAI_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}requests>=2.26.0:www/py-requests@${PY_FLAVOR} AssemblyAI support
+AUDIO_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pyaudio>=0.2.11:audio/py-pyaudio@${PY_FLAVOR}
+
+.include <bsd.port.pre.mk>
+
+.if ${PYTHON_REL} >= 31300
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}audioop-lts>=0:audio/py-audioop-lts@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}standard-aifc>=0:audio/py-standard-aifc@${PY_FLAVOR}
+.endif
+
 # Clean up bundled binary executables
 .if !defined(MAINTAINER_MODE)
 EXTRACT_AFTER_ARGS=	--exclude ${DISTNAME}/speech_recognition/flac-* \
@@ -33,4 +45,4 @@ post-patch:
 	@${RM} ${WRKSRC}/speech_recognition/flac-*
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/audio/py-speechrecognition/distinfo b/audio/py-speechrecognition/distinfo
index 0236d645f6a3..616261360e20 100644
--- a/audio/py-speechrecognition/distinfo
+++ b/audio/py-speechrecognition/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1712084478
-SHA256 (SpeechRecognition-3.10.3.tar.gz) = 91b01ce7a0435d0d039435d714eede10712b0628b3695623cbb9fbe4d2e2b82d
-SIZE (SpeechRecognition-3.10.3.tar.gz) = 32854794
+TIMESTAMP = 1790435692
+SHA256 (speechrecognition-3.17.0.tar.gz) = bd7e609c2ebea1680e75fc5dfbd8b44388c316f134c8d44fa2a30c0f50b346be
+SIZE (speechrecognition-3.17.0.tar.gz) = 32859772
diff --git a/audio/py-speechrecognition/files/patch-pyproject.toml b/audio/py-speechrecognition/files/patch-pyproject.toml
new file mode 100644
index 000000000000..d2de167f05c6
--- /dev/null
+++ b/audio/py-speechrecognition/files/patch-pyproject.toml
@@ -0,0 +1,32 @@
+--- pyproject.toml.orig	2026-06-17 11:16:15 UTC
++++ pyproject.toml
+@@ -1,15 +1,14 @@
+ [build-system]
+-requires = ["setuptools>=77"]
++requires = ["setuptools>=61"]
+ build-backend = "setuptools.build_meta"
+ 
+ [project]
+-name = "SpeechRecognition"
++name = "speechrecognition"
+ dynamic = ["version"]
+ description = "Library for performing speech recognition, with support for several engines and APIs, online and offline."
+ readme = { file = "README.rst", content-type = "text/x-rst" }
+ requires-python = ">=3.9"
+-license = "BSD-3-Clause"
+-license-files = ["LICENSE.txt", "LICENSE-FLAC.txt"]
++license = { text = "BSD-3-Clause" }
+ authors = [
+   { name = "Anthony Zhang (Uberi)", email = "azhang9@gmail.com" },
+ ]
+@@ -94,10 +93,6 @@ speech_recognition = [
+ [tool.setuptools.package-data]
+ speech_recognition = [
+   "version.txt",
+-  "flac-linux-x86",
+-  "flac-linux-x86_64",
+-  "flac-mac",
+-  "flac-win32.exe",
+   "pocketsphinx-data/**/*",
+ ]
+ 
diff --git a/audio/py-speechrecognition/files/patch-setup.py b/audio/py-speechrecognition/files/patch-setup.py
deleted file mode 100644
index 5d30f144cda1..000000000000
--- a/audio/py-speechrecognition/files/patch-setup.py
+++ /dev/null
@@ -1,37 +0,0 @@
---- setup.py.orig	2023-03-13 12:15:10 UTC
-+++ setup.py
-@@ -10,33 +10,11 @@ from distutils import log
- 
- import speech_recognition
- 
--FILES_TO_MARK_EXECUTABLE = ["flac-linux-x86", "flac-linux-x86_64", "flac-mac", "flac-win32.exe"]
--
--
--class InstallWithExtraSteps(install):
--    def run(self):
--        install.run(self)  # do the original install steps
--
--        # mark the FLAC executables as executable by all users (this fixes occasional issues when file permissions get messed up)
--        for output_path in self.get_outputs():
--            if os.path.basename(output_path) in FILES_TO_MARK_EXECUTABLE:
--                log.info("setting executable permissions on {}".format(output_path))
--                stat_info = os.stat(output_path)
--                os.chmod(
--                    output_path,
--                    stat_info.st_mode |
--                    stat.S_IRUSR | stat.S_IXUSR |  # owner can read/execute
--                    stat.S_IRGRP | stat.S_IXGRP |  # group can read/execute
--                    stat.S_IROTH | stat.S_IXOTH  # everyone else can read/execute
--                )
--
--
- setup(
--    name="SpeechRecognition",
-+    name="speechrecognition",
-     version=speech_recognition.__version__,
-     packages=["speech_recognition"],
-     include_package_data=True,
--    cmdclass={"install": InstallWithExtraSteps},
- 
-     # PyPI metadata
-     author=speech_recognition.__author__,