SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,39 @@
COMMENT= common libraries for the CMU speech recognition engines
VERSION= 0.6
DISTNAME= sphinxbase-${VERSION}
PKGNAME= cmu-sphinxbase-${VERSION}
REVISION= 7
CATEGORIES= audio
SHARED_LIBS= sphinxbase 1.0 \
sphinxad 1.0
HOMEPAGE= http://cmusphinx.sourceforge.net/
# CMU
PERMIT_PACKAGE= Yes
WANTLIB += ${MODFORTRAN_WANTLIB}
WANTLIB += blas c iconv lapack m pthread sndio z
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=cmusphinx/}
MODULES= fortran
MODFORTRAN_COMPILER = gfortran
LIB_DEPENDS= converters/libiconv \
math/lapack \
${MODFORTRAN_LIB_DEPENDS}
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --without-python
CONFIGURE_ENV= CPPFLAGS=-I${LOCALBASE}/include \
LDFLAGS=-L${LOCALBASE}/lib \
LIBS="-lblas -lm -lgfortran -lsndio" \
HAVE_DOXYGEN="no"
pre-build:
@cp ${FILESDIR}/ad_sndio.c ${WRKSRC}/src/libsphinxad/
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (sphinxbase-0.6.tar.gz) = KTgywxDVzIHtjs9C1wLGdlE2yzOKA2qvhPR+Ekv3Lfw=
SIZE (sphinxbase-0.6.tar.gz) = 2872665

View file

@ -0,0 +1,128 @@
/*
* Copyright (c) 2010 Eric Faurot <eric@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sndio.h>
#include <stdio.h>
#include <config.h>
#include "prim_type.h"
#include "ad.h"
#define bPS 16
#define BPS 2
ad_rec_t *
ad_open_dev(const char *dev, int32 rate)
{
struct sio_hdl *hdl;
struct sio_par param;
hdl = sio_open(dev, SIO_REC, 1);
if (hdl == NULL) {
fprintf(stderr, "ad_open_dev: sio_open(%s) failed\n", dev);
return NULL;
}
sio_initpar(&param);
param.bits = bPS;
param.bps = BPS;
param.sig = 1;
param.le = 1;
param.rchan = 1;
param.rate = rate;
if (!sio_setpar(hdl, &param)) {
fprintf(stderr, "ad_open_dev: sio_setpar() failed\n");
sio_close(hdl);
return NULL;
}
if (!sio_getpar(hdl, &param)) {
fprintf(stderr, "ad_open_dev: sio_getpar() failed\n");
sio_close(hdl);
return NULL;
}
if (param.bits != bPS ||
param.bps != BPS ||
param.sig != 1 ||
param.le != 1 ||
param.rchan != 1 ||
param.rate != rate) {
fprintf(stderr, "ad_open_dev: can't set specified params\n");
sio_close(hdl);
return NULL;
}
return (ad_rec_t*)hdl;
}
ad_rec_t *
ad_open_sps(int32 rate)
{
return ad_open_dev(NULL, rate);
}
ad_rec_t *
ad_open(void)
{
return ad_open_sps(DEFAULT_SAMPLES_PER_SEC);
}
int32
ad_start_rec(ad_rec_t *r)
{
struct sio_hdl *hdl = (struct sio_hdl*)r;
if (!sio_start(hdl))
return AD_ERR_GEN;
return (0);
}
int32
ad_stop_rec(ad_rec_t *r)
{
struct sio_hdl *hdl = (struct sio_hdl*)r;
if (!sio_stop(hdl))
return AD_ERR_GEN;
return (0);
}
int32
ad_read(ad_rec_t *r, int16 *buf, int32 max)
{
size_t n, t;
char* b = (char *)buf;
struct sio_hdl *hdl = (struct sio_hdl*)r;
n = sio_read(hdl, b, max * BPS);
while (n % BPS) {
t = sio_read(hdl, b + n, BPS - (n % BPS));
if (t == 0)
return AD_ERR_GEN;
n += t;
}
return (n / BPS);
}
int32
ad_close(ad_rec_t *r)
{
struct sio_hdl *hdl = (struct sio_hdl*)r;
sio_close(hdl);
return (0);
}

View file

@ -0,0 +1,22 @@
--- configure.orig Thu Mar 18 21:49:35 2010
+++ configure Wed Apr 21 14:24:52 2010
@@ -7432,11 +7432,18 @@ fi
;;
# FIXME: isn't this the same OSS as on Linux?
- *-*-freebsd*|*-*-netbsd*|*-*-openbsd*)
+ *-*-freebsd*|*-*-netbsd*)
ad_files="ad_oss_bsd.lo"
ad_backend="AD_BACKEND_OSS_BSD"
$as_echo "#define AD_BACKEND_OSS_BSD /**/" >>confdefs.h
+
+ ;;
+ *-*-openbsd*)
+ ad_files="ad_sndio.lo"
+ ad_backend="AD_BACKEND_SNDIO"
+
+$as_echo "#define AD_BACKEND_SNDIO /**/" >>confdefs.h
;;
*-*-sunos4*)

View file

@ -0,0 +1,4 @@
This package contains the basic libraries shared by the CMU Sphinx
speech recognition trainer and decoders (Sphinx-II, Sphinx-III, and
PocketSphinx), as well as some common utilities for manipulating
acoustic feature and audio files.

View file

@ -0,0 +1,59 @@
@bin bin/sphinx_cepview
@bin bin/sphinx_cont_adseg
@bin bin/sphinx_cont_fileseg
@bin bin/sphinx_fe
@bin bin/sphinx_jsgf2fsg
@bin bin/sphinx_lm_convert
@bin bin/sphinx_lm_eval
bin/sphinx_lm_sort
@bin bin/sphinx_pitch
include/sphinxbase/
include/sphinxbase/ad.h
include/sphinxbase/agc.h
include/sphinxbase/bio.h
include/sphinxbase/bitvec.h
include/sphinxbase/byteorder.h
include/sphinxbase/case.h
include/sphinxbase/ckd_alloc.h
include/sphinxbase/clapack_lite.h
include/sphinxbase/cmd_ln.h
include/sphinxbase/cmn.h
include/sphinxbase/cont_ad.h
include/sphinxbase/err.h
include/sphinxbase/f2c.h
include/sphinxbase/fe.h
include/sphinxbase/feat.h
include/sphinxbase/filename.h
include/sphinxbase/fixpoint.h
include/sphinxbase/fsg_model.h
include/sphinxbase/genrand.h
include/sphinxbase/glist.h
include/sphinxbase/hash_table.h
include/sphinxbase/heap.h
include/sphinxbase/huff_code.h
include/sphinxbase/info.h
include/sphinxbase/jsgf.h
include/sphinxbase/libutil.h
include/sphinxbase/listelem_alloc.h
include/sphinxbase/logmath.h
include/sphinxbase/matrix.h
include/sphinxbase/mmio.h
include/sphinxbase/mulaw.h
include/sphinxbase/ngram_model.h
include/sphinxbase/pio.h
include/sphinxbase/prim_type.h
include/sphinxbase/profile.h
include/sphinxbase/sbthread.h
include/sphinxbase/sphinx_config.h
include/sphinxbase/sphinxbase.pxd
include/sphinxbase/sphinxbase_export.h
include/sphinxbase/strfuncs.h
include/sphinxbase/unlimit.h
include/sphinxbase/yin.h
lib/libsphinxad.a
lib/libsphinxad.la
@lib lib/libsphinxad.so.${LIBsphinxad_VERSION}
lib/libsphinxbase.a
lib/libsphinxbase.la
@lib lib/libsphinxbase.so.${LIBsphinxbase_VERSION}
lib/pkgconfig/sphinxbase.pc