diff --git a/audio/Makefile b/audio/Makefile index 07c82c120a7d..04051adbd70a 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -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 diff --git a/audio/py-pocketsphinx/Makefile b/audio/py-pocketsphinx/Makefile new file mode 100644 index 000000000000..be33992ba3d2 --- /dev/null +++ b/audio/py-pocketsphinx/Makefile @@ -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 diff --git a/audio/py-pocketsphinx/distinfo b/audio/py-pocketsphinx/distinfo new file mode 100644 index 000000000000..e16fa187cd85 --- /dev/null +++ b/audio/py-pocketsphinx/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1660023511 +SHA256 (pocketsphinx-0.1.15.tar.gz) = 34d290745c7dbe6fa2cac9815b5c19d10f393e528ecd70e779c21ebc448f9b63 +SIZE (pocketsphinx-0.1.15.tar.gz) = 29092634 diff --git a/audio/py-pocketsphinx/files/patch-setup.py b/audio/py-pocketsphinx/files/patch-setup.py new file mode 100644 index 000000000000..22bc3b4ecb77 --- /dev/null +++ b/audio/py-pocketsphinx/files/patch-setup.py @@ -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', diff --git a/audio/py-pocketsphinx/pkg-descr b/audio/py-pocketsphinx/pkg-descr new file mode 100644 index 000000000000..03a95bb48bcf --- /dev/null +++ b/audio/py-pocketsphinx/pkg-descr @@ -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. diff --git a/audio/py-pocketsphinx/pkg-plist b/audio/py-pocketsphinx/pkg-plist new file mode 100644 index 000000000000..d62d44f201bc --- /dev/null +++ b/audio/py-pocketsphinx/pkg-plist @@ -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