aboutsummaryrefslogtreecommitdiffstats
path: root/audio/espeak/Makefile
blob: 02578dfb686fa0c7571096dd8d9d95a7c1b3c53e (plain) (blame)
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
# New ports collection makefile for:    espeak
# Date created:     2006-03-25
# Whom:         Nicola Vitale   <nivit@email.it>
#
# $FreeBSD$
#

PORTNAME=   espeak
PORTVERSION=    1.17
CATEGORIES= audio
MASTER_SITES=   ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME=   ${PORTNAME}-${PORTVERSION}-source

MAINTAINER= nivit@email.it
COMMENT=    A software speech synthesizer

LIB_DEPENDS=    portaudio:${PORTSDIR}/audio/portaudio

CONFLICTS=  speak-1.[0-9]

MAKE_ENV+=  PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
        PTHREAD_LIBS="${PTHREAD_LIBS}" CPPFLAGS="${CPPFLAGS}" \
        LDFLAGS="${LDFLAGS}" CXX="${CXX}"

PLIST_SUB+= ESPEAK_LIBRARY=${ESPEAK_LIBRARY}

USE_GETOPT_LONG=yes
USE_GMAKE=  yes
USE_LDCONFIG=   yes
USE_ZIP=    yes

WRKSRC= ${WRKDIR}/${DISTNAME}
BUILD_WRKSRC=   ${WRKSRC}/src
ESPEAK_LIBRARY= lib${PORTNAME}.so.1.${PORTVERSION}
FIND_DIRS=  espeak-data
FIND_DOCS=  docs

LN_OPTS=    -sf

REPLACE_FILES=   ${BUILD_WRKSRC}/Makefile  ${BUILD_WRKSRC}/speech.h

post-patch:
    @for FILE in ${REPLACE_FILES}; do \
        ${REINPLACE_CMD} \
        -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
        -e "s|%%DATADIR%%|${DATADIR}|g" $${FILE} ;\
    done;

do-install:
    ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/speak ${PREFIX}/bin/speak
    ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${ESPEAK_LIBRARY} ${PREFIX}/lib/${ESPEAK_LIBRARY}
    ${LN} ${LN_OPTS} ${PREFIX}/lib/${ESPEAK_LIBRARY} ${PREFIX}/lib/${ESPEAK_LIBRARY:S/.${PORTVERSION}//g}
    cd ${WRKSRC} && ${FIND} ${FIND_DIRS}  -type d -exec ${MKDIR} \
        ${DATADIR}/{} \;
    cd ${WRKSRC} && ${FIND} ${FIND_DIRS}  -type f -exec ${INSTALL_DATA} {} \
        ${DATADIR}/{} \;

.if !defined(NOPORTDOCS)
    ${MKDIR} ${DOCSDIR}
    cd ${WRKSRC}/${FIND_DOCS} && ${FIND} . -type d -exec ${MKDIR} \
        ${DOCSDIR}/{} \;
    cd ${WRKSRC}/${FIND_DOCS} && ${FIND} . -type f \
        -exec ${INSTALL_DATA} {} ${DOCSDIR}/{} \;
.endif

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 500000
BROKEN=     requires iswdigit(3)
.endif

.include <bsd.port.post.mk>