aboutsummaryrefslogtreecommitdiff
path: root/audio/libsamplerate
diff options
context:
space:
mode:
authorBrendan Fabeny <bf@FreeBSD.org>2012-03-03 10:29:44 +0000
committerBrendan Fabeny <bf@FreeBSD.org>2012-03-03 10:29:44 +0000
commit0a7ff7de02b4f0892a63d8fcb552aaf6811742bd (patch)
tree28e8a2c47083cedc48c5df43b497426ae890bf9f /audio/libsamplerate
parentb3ba9fc8d01963d6e8806de0b75e443cc41a3cc4 (diff)
downloadports-0a7ff7de02b4f0892a63d8fcb552aaf6811742bd.tar.gz
ports-0a7ff7de02b4f0892a63d8fcb552aaf6811742bd.zip
disable some optional machine-dependent code by default;
math/fftw3 is only needed for the test suite; audio/libsndfile is only needed for an example program and the test suite; respect NOPORTEXAMPLES; don't build the docs if NOPORTDOCS is defined; provide a test target; shorten a long line
Notes
Notes: svn path=/head/; revision=292574
Diffstat (limited to 'audio/libsamplerate')
-rw-r--r--audio/libsamplerate/Makefile45
-rw-r--r--audio/libsamplerate/pkg-plist2
2 files changed, 39 insertions, 8 deletions
diff --git a/audio/libsamplerate/Makefile b/audio/libsamplerate/Makefile
index ac6099291e19..e1ca0c74c3a4 100644
--- a/audio/libsamplerate/Makefile
+++ b/audio/libsamplerate/Makefile
@@ -7,7 +7,7 @@
PORTNAME= libsamplerate
PORTVERSION= 0.1.8
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= audio
MASTER_SITES= http://www.mega-nerd.com/SRC/
@@ -17,17 +17,48 @@ COMMENT= Secret Rabbit Code: a Sample Rate Converter for audio
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
-LIB_DEPENDS+= sndfile.1:${PORTSDIR}/audio/libsndfile \
- fftw3:${PORTSDIR}/math/fftw3
-
USE_GNOME= gnomehack pkgconfig
USE_AUTOTOOLS= libtool
USE_LDCONFIG= yes
-MAKE_ARGS= htmldocdir=${PREFIX}/share/doc/libsamplerate
-pre-install:
+OPTIONS= CPU_CLIP "Allow machine-dependent clipping" off
+
+.include <bsd.port.options.mk>
+
+MAKE_ARGS+= htmldocdir=${PREFIX}/share/doc/libsamplerate
+
+.if !defined(WITH_CPU_CLIP)
+CONFIGURE_ARGS+= --disable-cpu-clip
+.else
+MANUAL_PACKAGE_BUILD= WITH_CPU_CLIP may customize the package for the build machine
+.endif
+
+.if defined(MAINTAINER_MODE) || defined(PACKAGE_BUILDING)
+BUILD_DEPENDS += ${LOCALBASE}/lib/libfftw3.so:${PORTSDIR}/math/fftw3
+.else
+CONFIGURE_ARGS+= --disable-fftw
+.endif
+
+.if !defined(NOPORTEXAMPLES)
+LIB_DEPENDS+= sndfile.1:${PORTSDIR}/audio/libsndfile
+.elif defined(MAINTAINER_MODE) || defined(PACKAGE_BUILDING)
+BUILD_DEPENDS += ${LOCALBASE}/lib/libsndfile.so:${PORTSDIR}/audio/libsndfile
+.else
+CONFIGURE_ARGS+= --disable-sndfile
+.endif
+
+post-patch:
.if defined(NOPORTDOCS)
- @${REINPLACE_CMD} -e 's/SUBDIRS = M4 src doc examples tests/SUBDIRS = M4 src examples tests/' ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} -e '/SUBDIRS =/s/doc //' ${WRKSRC}/Makefile.in
+.endif
+.if defined(NOPORTEXAMPLES)
+ @${REINPLACE_CMD} -e '/SUBDIRS =/s/examples //' ${WRKSRC}/Makefile.in
+.endif
+
+.if defined(MAINTAINER_MODE) || defined(PACKAGE_BUILDING)
+check regression-test test: build
+ @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} \
+ check
.endif
.include <bsd.port.mk>
diff --git a/audio/libsamplerate/pkg-plist b/audio/libsamplerate/pkg-plist
index fa0dbf71d842..7d043ad66fa0 100644
--- a/audio/libsamplerate/pkg-plist
+++ b/audio/libsamplerate/pkg-plist
@@ -1,4 +1,4 @@
-bin/sndfile-resample
+%%PORTEXAMPLES%%bin/sndfile-resample
include/samplerate.h
lib/libsamplerate.a
lib/libsamplerate.la