aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/x264/Makefile
diff options
context:
space:
mode:
authorlioux <lioux@FreeBSD.org>2009-02-27 09:51:39 +0800
committerlioux <lioux@FreeBSD.org>2009-02-27 09:51:39 +0800
commitfa4eec27eb4da27eb1190f62a8f7ab92d1fa3169 (patch)
tree800788cbfd90a917a9194c65afc047e9b1cdf2bb /multimedia/x264/Makefile
parent4a52919addc70af5c3323cc609d9be0e695d1831 (diff)
downloadfreebsd-ports-gnome-fa4eec27eb4da27eb1190f62a8f7ab92d1fa3169.tar.gz
freebsd-ports-gnome-fa4eec27eb4da27eb1190f62a8f7ab92d1fa3169.tar.zst
freebsd-ports-gnome-fa4eec27eb4da27eb1190f62a8f7ab92d1fa3169.zip
o Add PGO option to enable Profile-Guided Optimization build support.
o Add DIST_SUBDIR since a y4m video sample fetched when WITH_PGO has a name that is too generic. o Add RESTRICTED specifically for the same y4m video sample when WITH_PGO. This sample cannot be mirrored even though the port may still be both packaged and redistributed. o Be pedantic when declaring port variables to insure slave port safety o No PORTREVISION bump since there was neither functionality nor PLIST change
Diffstat (limited to 'multimedia/x264/Makefile')
-rw-r--r--multimedia/x264/Makefile27
1 files changed, 25 insertions, 2 deletions
diff --git a/multimedia/x264/Makefile b/multimedia/x264/Makefile
index c70cf287850f..41c68d495dfd 100644
--- a/multimedia/x264/Makefile
+++ b/multimedia/x264/Makefile
@@ -9,8 +9,12 @@ PORTNAME= x264
PORTVERSION= 0.0.20080409
PORTREVISION?= 2
CATEGORIES= multimedia
-MASTER_SITES= http://downloads.videolan.org/pub/videolan/x264/snapshots/
+MASTER_SITES= http://downloads.videolan.org/pub/videolan/x264/snapshots/ \
+ http://samples.mplayerhq.hu/yuv4mpeg2/:pgo
DISTNAME= ${PORTNAME}-snapshot-${PORTVERSION:S/0.0.//}-2245
+DISTFILES= ${PORTNAME}-snapshot-${PORTVERSION:S/0.0.//}-2245${EXTRACT_SUFX}
+DIST_SUBDIR= x264
+EXTRACT_ONLY= ${PORTNAME}-snapshot-${PORTVERSION:S/0.0.//}-2245${EXTRACT_SUFX}
MAINTAINER= multimedia@FreeBSD.org
COMMENT?= Multimedia library and tool for encoding H.264/AVC video streams
@@ -27,7 +31,8 @@ USE_LDCONFIG= yes
HAS_CONFIGURE= yes
OPTIONS= DEBUG "Enable Debugging" Off \
- OPTIMIZED_CFLAGS "Enable Optimized CFLAGS" Off
+ OPTIMIZED_CFLAGS "Enable Optimized CFLAGS" Off \
+ PGO "Enable Profile-Guided Optimization" Off
CONFIGURE_ARGS+= --extra-cflags="${CPPFLAGS} ${CFLAGS} -fPIC -I${LOCALBASE}/include -I${LOCALBASE}/include" \
--extra-ldflags="${LDFLAGS} -L${LOCALBASE}/lib -L${LOCALBASE}/lib" \
@@ -58,6 +63,19 @@ MAKE_ENV+= ARCH=${ARCH}
CONFIGURE_ARGS+= --enable-debug
.endif
+.if defined(WITH_PGO) && ${SLAVE_PORT:L}!="yes"
+# y4m sample video
+Y4M_VIDEO=example.y4m
+Y4M_VIDEO_DISTFILE=example.y4m.bz2
+
+DISTFILES+= ${Y4M_VIDEO_DISTFILE}
+ALL_TARGET= fprofiled
+MAKE_ENV+= VIDS="${WRKDIR}/${Y4M_VIDEO}"
+
+RESTRICTED= ${Y4M_VIDEO}.bz2 file may not be mirrored
+RESTRICTED_FILES= ${Y4M_VIDEO_DISTFILE}
+.endif
+
.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+= -O2 -funroll-loops -ffast-math
.endif
@@ -73,6 +91,11 @@ CONFIGURE_ARGS+= --enable-visualize
USE_XORG= x11
.endif
+post-extract:
+.if defined(WITH_PGO) && ${SLAVE_PORT:L}!="yes"
+ @( cd ${WRKDIR} && ${BZIP2_CMD} -dc ${DISTDIR}/${Y4M_VIDEO_DISTFILE} > ${Y4M_VIDEO} )
+.endif
+
post-patch:
@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|; \
s|-lpthread|${PTHREAD_LIBS}|g' \