freebsd-ports/audio/espeak-ng/Makefile
Dimitry Andric c7753b07bb audio/espeak-ng: fix build with clang 16
Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because audio/espeak-ng's Makefile does not explicitly set its C++
standard, this leads to an error:

  src/speechPlayer/src/speechWaveGenerator.cpp:197:56: error: reference to 'sample' is ambiguous
          unsigned int generate(const unsigned int sampleCount, sample* sampleBuf) {
                                                                ^
  src/speechPlayer/src/sample.h:23:3: note: candidate found by name lookup is 'sample'
  } sample;
    ^
  /usr/include/c++/v1/__algorithm/sample.h:95:17: note: candidate found by name lookup is 'std::sample'
  _SampleIterator sample(_PopulationIterator __first,
                  ^

This is because speechWaveGenerator.cpp has "using namespace std;" at
the top, so "sample" can match both "std::sample" (from <algorithm>) and
"struct sample" (from sample.h). Qualify "sample" as "::sample" to work
around the problem.

PR:		271486
Approved by:	maintainer timeout (2 weeks)
MFH:		2023Q2
2023-06-04 18:21:24 +02:00

40 lines
1.1 KiB
Makefile

PORTNAME= espeak-ng
PORTVERSION= 1.51.1
PORTREVISION= 4
CATEGORIES= audio
#MASTER_SITES= https://github.com/espeak-ng/${PORTNAME}/releases/download/${PORTVERSION}/
MAINTAINER= se@FreeBSD.org
COMMENT= Software speech synthesizer
WWW= https://github.com/espeak-ng/espeak-ng/
LICENSE= GPLv3
BUILD_DEPENDS= ronn:textproc/rubygem-ronn
LIB_DEPENDS= libpcaudio.so:audio/pcaudiolib
USES= autoreconf gmake libtool localbase
USE_GITHUB= yes
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-pcaudiolib
CONFLICTS_INSTALL= espeak speak
OPTIONS_DEFINE= DOCS
pre-build:
@${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' \
${WRKSRC}/Makefile.am ${WRKSRC}/src/libespeak-ng/speech.h
post-install:
${MKDIR} ${STAGEDIR}${DOCSDIR}
cd ${WRKSRC}/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
${RLN} ${STAGEDIR}${PREFIX}/man/man1/espeak-ng.1 \
${STAGEDIR}${PREFIX}/man/man1/espeak.1
${LN} -sf libespeak-ng.so ${STAGEDIR}${PREFIX}/lib/libespeak.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libespeak-ng.so*
.include <bsd.port.mk>