summaryrefslogtreecommitdiff
path: root/accessibility/speech-dispatcher/Makefile
blob: a01355ac63c022b1a131431d0f43c52fe463d580 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
PORTNAME=	speech-dispatcher
DISTVERSION=	0.8.8
PORTREVISION=	1
CATEGORIES?=	accessibility audio
MASTER_SITES=	http://devel.freebsoft.org/pub/projects/speechd/

MAINTAINER=	multimedia@FreeBSD.org
COMMENT?=	Common interface to speech synthesis

LICENSE=	GPLv2 LGPL21
LICENSE_COMB=	multi

LIB_DEPENDS=	libdotconf.so:devel/dotconf \
		libltdl.so:devel/libltdl \
		libsndfile.so:audio/libsndfile

USES=		alias gettext gmake gnome libtool pathfix pkgconfig
USE_GNOME=	glib20 intltool
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--without-espeak-ng
CFLAGS+=	-fcommon -I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
USE_LDCONFIG=	yes
INSTALL_TARGET=	install-strip

.if !defined(SPEECH_SLAVE)

CONFIGURE_ARGS+=	--disable-python

ETCFILES=	clients/emacs.conf modules/cicero.conf modules/dtk-generic.conf \
		modules/epos-generic.conf modules/espeak-generic.conf \
		modules/espeak-mbrola-generic.conf modules/espeak-ng.conf \
		modules/espeak.conf modules/festival.conf modules/flite.conf \
		modules/ibmtts.conf modules/ivona.conf \
		modules/llia_phon-generic.conf modules/pico-generic.conf \
		modules/swift-generic.conf speechd.conf

PORTDOCS=	ANNOUNCE AUTHORS FAQ NEWS README TODO

INFO=		spd-say speech-dispatcher speech-dispatcher-cs ssip

OPTIONS_DEFINE=		ALSA AO DOCS ESPEAK FESTIVAL FLITE NAS PULSEAUDIO
OPTIONS_DEFAULT=	ESPEAK
OPTIONS_SUB=		yes

ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
ALSA_CONFIGURE_WITH=	alsa

AO_LIB_DEPENDS=		libao.so:audio/libao
AO_CONFIGURE_WITH=	libao

ESPEAK_DESC=		eSpeak speech synthesizer support
ESPEAK_LIB_DEPENDS=	libespeak.so:audio/espeak
ESPEAK_CONFIGURE_WITH=	espeak

FESTIVAL_DESC=		Festival Speech Synthesis System support
FESTIVAL_RUN_DEPENDS=	${LOCALBASE}/share/festival/lib/${PORTNAME}.scm:audio/festival-freebsoft-utils \
			festival:audio/festival

FLITE_DESC=		Flite speech synthesis engine support
FLITE_LIB_DEPENDS=	libflite.so:audio/flite
FLITE_CONFIGURE_WITH=	flite

NAS_LIB_DEPENDS=	libaudio.so:audio/nas
NAS_CONFIGURE_WITH=	nas

PULSEAUDIO_LIB_DEPENDS=		libpulse.so:audio/pulseaudio
PULSEAUDIO_CONFIGURE_WITH=	pulse

post-patch:
	${REINPLACE_CMD} -e 's,/usr/share,${PREFIX}/share,g' \
		${WRKSRC}/src/modules/*.c \
		${WRKSRC}/config/modules/*.conf

post-install:
.for f in ${ETCFILES}
	@${MV} ${STAGEDIR}${ETCDIR}/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
.endfor
	@${RM} -r ${STAGEDIR}${DATADIR}/conf
	@${RMDIR} ${STAGEDIR}${DATADIR} || ${TRUE}
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}

.else

PORTSCOUT=	ignore:1

NO_ARCH=	yes
USES+=		python:3.3+ shebangfix
SHEBANG_FILES=	src/api/python/speechd_config/spd-conf
USE_PYTHON=	flavors
LIB_DEPENDS+=	libspeechd.so:accessibility/speech-dispatcher
RUN_DEPENDS+=	${PYTHON_SITELIBDIR}/xdg/__init__.py:devel/py-xdg@${PY_FLAVOR}

.endif

.include <bsd.port.mk>