Add audio/py-pocketsphinx: Python interface to CMU Sphinxbase and Pocketsphinx libraries

Pocketsphinx is a part of the CMU Sphinx Open Source Toolkit For
Speech Recognition.

This package provides a python interface to CMU Sphinxbase and
Pocketsphinx libraries created with SWIG and Setuptools.

WWW: https://github.com/bambocher/pocketsphinx-python

PR:		265766
This commit is contained in:
Jesús Daniel Colmenares Oviedo 2022-09-23 15:03:34 -04:00 committed by Li-Wen Hsu
parent 77c1fcfb39
commit 74c7ab2091
No known key found for this signature in database
GPG Key ID: 82B261B14D3BC7AF
6 changed files with 92 additions and 0 deletions

View File

@ -647,6 +647,7 @@
SUBDIR += py-musicbrainzngs
SUBDIR += py-mutagen
SUBDIR += py-opuslib
SUBDIR += py-pocketsphinx
SUBDIR += py-pulsectl
SUBDIR += py-pyacoustid
SUBDIR += py-pyaudio

View File

@ -0,0 +1,30 @@
PORTNAME= pocketsphinx
PORTVERSION= 0.1.15
CATEGORIES= audio python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= DtxdF@disroot.org
COMMENT= Python interface to CMU Sphinxbase and Pocketsphinx libraries
WWW= https://github.com/bambocher/pocketsphinx-python
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= swig>0:devel/swig
LIB_DEPENDS= libasound.so:audio/alsa-lib \
libpulse-simple.so:audio/pulseaudio \
libpulse.so:audio/pulseaudio
USES= python:3.8+
USE_PYTHON= distutils
CFLAGS+= -I${LOCALBASE}/include
post-install:
${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/pocketsphinx/_pocketsphinx${PYTHON_EXT_SUFFIX}.so
${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/sphinxbase/_ad_alsa${PYTHON_EXT_SUFFIX}.so
${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/sphinxbase/_ad_pulse${PYTHON_EXT_SUFFIX}.so
${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/sphinxbase/_sphinxbase${PYTHON_EXT_SUFFIX}.so
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1660023511
SHA256 (pocketsphinx-0.1.15.tar.gz) = 34d290745c7dbe6fa2cac9815b5c19d10f393e528ecd70e779c21ebc448f9b63
SIZE (pocketsphinx-0.1.15.tar.gz) = 29092634

View File

@ -0,0 +1,20 @@
--- setup.py.orig 2022-08-09 05:49:06 UTC
+++ setup.py
@@ -120,7 +120,7 @@ elif sys.platform.startswith('darwin'):
'-Wno-sign-compare',
'-Wno-logical-op-parentheses'
])
-elif sys.platform.startswith('linux'):
+elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
sb_include_dirs.append('deps/sphinxbase/include/android')
extra_compile_args.extend([
'-Wno-unused-label',
@@ -245,7 +245,7 @@ elif sys.platform.startswith('darwin'):
extra_link_args=extra_link_args
)
)
-elif sys.platform.startswith('linux'):
+elif sys.platform.startswith('linux') or sys.platform.startswith('freebsd'):
ext_modules.extend([
Extension(
name='sphinxbase._ad_pulse',

View File

@ -0,0 +1,5 @@
Pocketsphinx is a part of the CMU Sphinx Open Source Toolkit For
Speech Recognition.
This package provides a python interface to CMU Sphinxbase and
Pocketsphinx libraries created with SWIG and Setuptools.

View File

@ -0,0 +1,33 @@
%%PYTHON_SITELIBDIR%%/pocketsphinx/__init__.py
%%PYTHON_SITELIBDIR%%/pocketsphinx/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/pocketsphinx/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/pocketsphinx/__pycache__/pocketsphinx%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/pocketsphinx/__pycache__/pocketsphinx%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/pocketsphinx/_pocketsphinx%%PYTHON_EXT_SUFFIX%%.so
%%PYTHON_SITELIBDIR%%/pocketsphinx/data/goforward.raw
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/cmudict-en-us.dict
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us.lm.bin
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/README
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/feat.params
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/mdef
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/means
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/noisedict
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/sendump
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/transition_matrices
%%PYTHON_SITELIBDIR%%/pocketsphinx/model/en-us/variances
%%PYTHON_SITELIBDIR%%/pocketsphinx/pocketsphinx.py
%%PYTHON_SITELIBDIR%%/sphinxbase/__init__.py
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/ad_alsa%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/ad_alsa%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/ad_pulse%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/ad_pulse%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/sphinxbase%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/__pycache__/sphinxbase%%PYTHON_EXT_SUFFIX%%.pyc
%%PYTHON_SITELIBDIR%%/sphinxbase/_ad_alsa%%PYTHON_EXT_SUFFIX%%.so
%%PYTHON_SITELIBDIR%%/sphinxbase/_ad_pulse%%PYTHON_EXT_SUFFIX%%.so
%%PYTHON_SITELIBDIR%%/sphinxbase/_sphinxbase%%PYTHON_EXT_SUFFIX%%.so
%%PYTHON_SITELIBDIR%%/sphinxbase/ad_alsa.py
%%PYTHON_SITELIBDIR%%/sphinxbase/ad_pulse.py
%%PYTHON_SITELIBDIR%%/sphinxbase/sphinxbase.py