diff --git a/audio/Makefile b/audio/Makefile index 5b2f98dd6bfe..9109640155ac 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -535,6 +535,7 @@ SUBDIR += optimfrog SUBDIR += opus SUBDIR += opus-tools + SUBDIR += opusfile SUBDIR += osalp SUBDIR += osd-lyrics SUBDIR += osdmixer diff --git a/audio/opusfile/Makefile b/audio/opusfile/Makefile new file mode 100644 index 000000000000..f2256337b2a1 --- /dev/null +++ b/audio/opusfile/Makefile @@ -0,0 +1,57 @@ +# $FreeBSD$ + +PORTNAME= opusfile +PORTVERSION= 0.5 +CATEGORIES= audio +MASTER_SITES= http://downloads.xiph.org/releases/opus/ \ + ${MASTER_SITE_MOZILLA_EXTENDED} +MASTER_SITE_SUBDIR= opus + +MAINTAINER= liangtai.s16@gmail.com +COMMENT= Opus playback library + +LICENSE= BSD3CLAUSE + +LIB_DEPENDS= libogg.so:${PORTSDIR}/audio/libogg \ + libopus.so:${PORTSDIR}/audio/opus + +USES= gmake pkgconfig pathfix +USE_LDCONFIG= yes +GNU_CONFIGURE= yes +USE_AUTOTOOLS= autoconf:env aclocal:env automake:env libtool +MAKE_JOBS_UNSAFE= yes +PATHFIX_MAKEFILEIN= Makefile.am + +PORTDOCS= AUTHORS README.txt + +OPTIONS_DEFINE= DOXYGEN DOCS +OPTIONS_DEFAULT= # empty + +DOXYGEN_CONFIGURE_ENABLE= doc +DOXYGEN_BUILD_DEPENDS= doxygen:${PORTSDIR}/devel/doxygen + +.include + +post-patch: + @${REINPLACE_CMD} -e 's| @openssl@||' \ + ${WRKSRC}/opusfile.pc.in ${WRKSRC}/opusurl.pc.in + @${REINPLACE_CMD} -e '/libopusurl_la_SOURCES/s/http.c/& src\/ftime.c/' \ + ${WRKSRC}/Makefile.am + @${CP} ${FILESDIR}/ftime.c ${WRKSRC}/src/ + +pre-configure: + @(cd ${WRKSRC} && ${AUTORECONF} -fi) + +post-install: +.if ${PORT_OPTIONS:MDOXYGEN} + @${RM} -f ${WRKDIR}/PLIST.doc ; \ + ${FIND} ${STAGEDIR}${DOCSDIR}/html -type f | \ + ${SED} 's|${STAGEDIR}${PREFIX}/||' \ + >> ${WRKDIR}/PLIST.doc ; \ + ${FIND} ${STAGEDIR}${DOCSDIR}/html -type d | \ + ${SED} 's|${STAGEDIR}${PREFIX}/|@dirrm |' \ + | ${SORT} -r >> ${WRKDIR}/PLIST.doc ; \ + (cd ${WRKDIR} ; ${SED} -i -e '/PLIST.doc/ r PLIST.doc' ${TMPPLIST}) +.endif + +.include diff --git a/audio/opusfile/distinfo b/audio/opusfile/distinfo new file mode 100644 index 000000000000..f5b95cb43f8a --- /dev/null +++ b/audio/opusfile/distinfo @@ -0,0 +1,2 @@ +SHA256 (opusfile-0.5.tar.gz) = 2ce52d006aeeec9f10260dbe3073c4636954a1ab19c82b8baafefe0180aa4a39 +SIZE (opusfile-0.5.tar.gz) = 437671 diff --git a/audio/opusfile/files/ftime.c b/audio/opusfile/files/ftime.c new file mode 100644 index 000000000000..f82100c69faf --- /dev/null +++ b/audio/opusfile/files/ftime.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1994 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef lint +static char rcsid[] = "$FreeBSD$"; +#endif /* not lint */ + +#include +#include +#include + +int +ftime(struct timeb *tbp) +{ + struct timezone tz; + struct timeval t; + + if (gettimeofday(&t, &tz) < 0) + return (-1); + tbp->millitm = t.tv_usec / 1000; + tbp->time = t.tv_sec; + tbp->timezone = tz.tz_minuteswest; + tbp->dstflag = tz.tz_dsttime; + + return (0); +} diff --git a/audio/opusfile/files/patch-configure.ac b/audio/opusfile/files/patch-configure.ac new file mode 100644 index 000000000000..abb176733c8d --- /dev/null +++ b/audio/opusfile/files/patch-configure.ac @@ -0,0 +1,16 @@ +--- ./configure.ac.orig 2014-01-09 22:35:34.000000000 +0000 ++++ ./configure.ac 2014-01-17 17:25:40.113916574 +0000 +@@ -90,10 +90,12 @@ + AS_IF([test "$enable_http" != "no"], [ + openssl="openssl" + AC_DEFINE([OP_ENABLE_HTTP], [1], [Enable HTTP support]) +- PKG_CHECK_MODULES([URL_DEPS], [openssl]) + ]) + AM_CONDITIONAL(OP_ENABLE_HTTP, [test "$enable_http" != "no"]) + AC_SUBST([openssl]) ++AC_CHECK_LIB(ssl, SSL_read, ++ [AC_CHECK_HEADERS(openssl/ssl.h, LIBS="$LIBS -lssl -lcrypto",,)],, ++ -lcrypto -lssl) + + PKG_CHECK_MODULES([DEPS], [ogg >= 1.3 opus >= 1.0.1]) + diff --git a/audio/opusfile/pkg-descr b/audio/opusfile/pkg-descr new file mode 100644 index 000000000000..07bca43f70ef --- /dev/null +++ b/audio/opusfile/pkg-descr @@ -0,0 +1,3 @@ +Library for decoding .opus files, including seeking support. + +WWW: http://www.opus-codec.org/ diff --git a/audio/opusfile/pkg-plist b/audio/opusfile/pkg-plist new file mode 100644 index 000000000000..b5065671a3f2 --- /dev/null +++ b/audio/opusfile/pkg-plist @@ -0,0 +1,13 @@ +include/opus/opusfile.h +lib/libopusfile.a +lib/libopusfile.la +lib/libopusfile.so +lib/libopusfile.so.3 +lib/libopusurl.a +lib/libopusurl.la +lib/libopusurl.so +lib/libopusurl.so.3 +libdata/pkgconfig/opusfile.pc +libdata/pkgconfig/opusurl.pc +@comment Insert PLIST.doc here +@dirrmtry include/opus