2001-09-25 21:27:11 +02:00
|
|
|
# New ports collection makefile for: ffmpeg
|
|
|
|
# Date created: Tue Sep 25 15:52:09 BRT 2001
|
|
|
|
# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= ffmpeg
|
2003-01-10 19:21:21 +01:00
|
|
|
PORTVERSION= 0.4.6
|
2003-03-05 06:30:08 +01:00
|
|
|
PORTREVISION= 3
|
2002-11-28 01:09:51 +01:00
|
|
|
CATEGORIES= multimedia audio net
|
2003-01-10 19:21:21 +01:00
|
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
|
|
|
MASTER_SITE_SUBDIR= ffmpeg
|
2001-09-25 21:27:11 +02:00
|
|
|
|
|
|
|
MAINTAINER= lioux@FreeBSD.org
|
2003-02-23 20:58:35 +01:00
|
|
|
COMMENT= Hyper fast realtime audio/video encoder/converter, streaming server
|
2001-09-25 21:27:11 +02:00
|
|
|
|
2003-04-18 06:08:57 +02:00
|
|
|
USE_GETOPT_LONG= yes
|
2001-09-25 21:27:11 +02:00
|
|
|
HAS_CONFIGURE= yes
|
|
|
|
USE_GMAKE= yes
|
2002-07-03 21:15:17 +02:00
|
|
|
USE_REINPLACE= yes
|
2001-09-25 21:27:11 +02:00
|
|
|
CONFIGURE_ARGS= --cc="${CC}" --prefix="${PREFIX}" \
|
2002-10-11 21:28:30 +02:00
|
|
|
--make="${GMAKE}" --enable-shared \
|
2002-10-15 20:21:25 +02:00
|
|
|
--extra-libs="-lm -L${LOCALBASE}/lib"
|
2002-10-11 21:28:30 +02:00
|
|
|
PLIST_SUB= SHLIB_VERSION=${SHLIB_VERSION}
|
|
|
|
INSTALLS_SHLIB= yes
|
2001-09-25 21:27:11 +02:00
|
|
|
|
2002-10-11 21:28:30 +02:00
|
|
|
SHLIB_VERSION= 0
|
|
|
|
#
|
|
|
|
DOC_FILES= COPYING Changelog README VERSION
|
2001-09-25 21:27:11 +02:00
|
|
|
# under subdir doc
|
2003-01-10 19:21:21 +01:00
|
|
|
DOC_DOCFILES= TODO \
|
|
|
|
faq.html faq.texi \
|
|
|
|
ffmpeg-doc.html ffmpeg-doc.texi \
|
|
|
|
ffserver-doc.html ffserver-doc.texi
|
2002-08-04 15:18:10 +02:00
|
|
|
HEADER_FILES= libavcodec/avcodec.h libavcodec/common.h \
|
|
|
|
libavcodec/dsputil.h
|
2003-01-10 19:21:21 +01:00
|
|
|
LIB_FILES= libavcodec/libavcodec.a libavformat/libavformat.a
|
2002-10-11 21:28:30 +02:00
|
|
|
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2003-01-10 19:21:21 +01:00
|
|
|
##
|
|
|
|
## arch detection
|
|
|
|
##
|
|
|
|
.if ${ARCH} != "i386"
|
2003-01-10 19:33:02 +01:00
|
|
|
WITHOUT_MMX= yes
|
2003-06-03 08:33:38 +02:00
|
|
|
.else
|
|
|
|
# only for i386
|
|
|
|
EXTRA_PATCHES+= ${FILESDIR}/extra-bktr-patch-libavformat::Makefile \
|
|
|
|
${FILESDIR}/extra-bktr-patch-libavformat::avformat.h \
|
|
|
|
${FILESDIR}/extra-bktr-patch-ffmpeg.c
|
2003-01-10 19:21:21 +01:00
|
|
|
.endif
|
|
|
|
|
2002-10-11 21:28:30 +02:00
|
|
|
## lib detection
|
|
|
|
##
|
2003-01-10 19:21:21 +01:00
|
|
|
##
|
|
|
|
.if exists(${X11BASE}/lib/libImlib2.so)
|
|
|
|
WITH_IMLIB2=yes
|
|
|
|
.endif
|
2002-10-11 21:28:30 +02:00
|
|
|
## lame mp3
|
|
|
|
.if exists(${LOCALBASE}/lib/libmp3lame.so.0)
|
|
|
|
WITH_MP3=yes
|
|
|
|
.endif
|
|
|
|
## vorbis
|
|
|
|
.if exists(${LOCALBASE}/lib/libvorbisenc.so.2)
|
|
|
|
WITH_VORBIS=yes
|
|
|
|
.endif
|
2001-09-25 21:27:11 +02:00
|
|
|
|
2002-10-11 21:28:30 +02:00
|
|
|
## support activation
|
|
|
|
##
|
2002-11-03 08:01:44 +01:00
|
|
|
## disable a52
|
|
|
|
.ifndef(WITHOUT_A52)
|
|
|
|
LIB_DEPENDS+= a52.0:${PORTSDIR}/audio/liba52
|
|
|
|
|
|
|
|
CONFIGURE_ARGS+= --enable-a52 \
|
|
|
|
--enable-a52bin
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --enable-a52 \
|
|
|
|
--disable-a52bin
|
|
|
|
.endif
|
2003-01-10 19:21:21 +01:00
|
|
|
## enable imlib2
|
|
|
|
.if !defined(WITHOUT_VHOOK) && defined(WITH_IMLIB2)
|
|
|
|
LIB_DEPENDS+= Imlib2.1:${PORTSDIR}/graphics/imlib2
|
|
|
|
|
|
|
|
PLIST_SUB+= IMLIB2=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= IMLIB2="@comment "
|
|
|
|
.endif
|
2002-10-11 21:28:30 +02:00
|
|
|
## disable mmx
|
2001-09-25 21:27:11 +02:00
|
|
|
.ifdef(WITHOUT_MMX)
|
|
|
|
CONFIGURE_ARGS+= --disable-mmx
|
|
|
|
.endif
|
2002-10-11 21:28:30 +02:00
|
|
|
## mp3
|
|
|
|
.ifdef(WITH_MP3)
|
|
|
|
LIB_DEPENDS+= mp3lame.0:${PORTSDIR}/audio/lame
|
|
|
|
|
|
|
|
CONFIGURE_ARGS+= --enable-mp3lame
|
|
|
|
.endif
|
2002-11-03 08:01:44 +01:00
|
|
|
## optimization
|
|
|
|
.ifdef(WITH_OPTIMIZED_CFLAGS)
|
|
|
|
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
|
2003-01-10 19:33:02 +01:00
|
|
|
-O3 -ffast-math -fomit-frame-pointer"
|
2002-11-03 08:01:44 +01:00
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
|
|
|
|
.endif
|
2003-01-10 19:21:21 +01:00
|
|
|
## vhook
|
|
|
|
.ifndef(WITHOUT_VHOOK)
|
|
|
|
PLIST_SUB+= VHOOK=""
|
|
|
|
.else
|
|
|
|
CONFIGURE_ARGS+= -disable-vhook
|
|
|
|
|
|
|
|
PLIST_SUB+= VHOOK="@comment "
|
|
|
|
.endif
|
2002-10-11 21:28:30 +02:00
|
|
|
## vorbis
|
|
|
|
.ifdef(WITH_VORBIS)
|
|
|
|
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
|
|
|
|
|
|
|
|
CONFIGURE_ARGS+= --enable-vorbis
|
|
|
|
.endif
|
2001-09-25 21:27:11 +02:00
|
|
|
|
|
|
|
pre-everything::
|
2002-11-03 08:01:44 +01:00
|
|
|
.ifndef(WITHOUT_LIBA52)
|
|
|
|
@${ECHO_MSG} "You can disable liba52 support by defining WITHOUT_LIBA52"
|
|
|
|
.endif
|
2002-10-11 21:28:30 +02:00
|
|
|
.ifndef(WITHOUT_MMX)
|
2001-09-25 21:27:11 +02:00
|
|
|
@${ECHO_MSG} "Define WITHOUT_MMX if your system does not support MMX"
|
|
|
|
.endif
|
2002-10-11 21:28:30 +02:00
|
|
|
.ifndef(WITH_MP3)
|
|
|
|
@${ECHO_MSG} 'Define WITH_MP3 to enable lame MP3 codec'
|
|
|
|
.endif
|
2002-11-03 08:01:44 +01:00
|
|
|
.ifndef(WITH_OPTIMIZED_CFLAGS)
|
|
|
|
@${ECHO_MSG}
|
|
|
|
@${ECHO_MSG} 'You can enable additional compilation optimizations'
|
|
|
|
@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
|
|
|
|
.endif
|
2003-01-10 19:21:21 +01:00
|
|
|
.ifndef(WITHOUT_VHOOK)
|
|
|
|
@${ECHO_MSG}
|
|
|
|
@${ECHO_MSG} 'You can disable vhook support by defining WITHOUT_VHOOK'
|
|
|
|
.endif
|
2002-10-11 21:28:30 +02:00
|
|
|
.ifndef(WITH_VORBIS)
|
2003-01-10 19:21:21 +01:00
|
|
|
@${ECHO_MSG}
|
2002-10-11 21:28:30 +02:00
|
|
|
@${ECHO_MSG} 'Define WITH_VORBIS to enable libvorbisenc VORBIS codec'
|
|
|
|
.endif
|
2003-06-03 08:33:38 +02:00
|
|
|
.if ${ARCH} == "i386"
|
2002-10-11 21:28:30 +02:00
|
|
|
.if !(defined(WITH_BKTR_FORMAT) && defined(WITH_BKTR_DEV))
|
|
|
|
@${ECHO_MSG}
|
|
|
|
@${ECHO_MSG} 'If you want to capture from a bktr(4) supported card'
|
|
|
|
@${ECHO_MSG} 'you will probably need to set the input device and format'
|
|
|
|
@${ECHO_MSG} 'You can set WITH_BKTR_FORMAT to NTSC or PAL and you can set'
|
|
|
|
@${ECHO_MSG} 'WITH_BKTR_DEV to 0, 1, 2 or 3 (1 is usually the tuner)'
|
|
|
|
@${ECHO_MSG} 'so for a PAL tuner make WITH_BKTR_FORMAT=PAL WITH_BKTR_DEV=1'
|
|
|
|
@${ECHO_MSG}
|
|
|
|
@${ECHO_MSG} 'Warning: invalid settings will probably dump cores'
|
|
|
|
@${ECHO_MSG}
|
|
|
|
.endif
|
2003-06-03 08:33:38 +02:00
|
|
|
.endif # ${ARCH} == i386
|
2002-10-11 21:28:30 +02:00
|
|
|
|
|
|
|
post-extract:
|
2003-06-03 08:33:38 +02:00
|
|
|
.if ${ARCH} == "i386"
|
2002-10-11 21:28:30 +02:00
|
|
|
# install booktree extension
|
2003-01-10 19:21:21 +01:00
|
|
|
@${CP} ${FILESDIR}/grab_bsdbktr.c ${WRKSRC}/libavformat/
|
2003-06-03 08:33:38 +02:00
|
|
|
.endif # ${ARCH} == i386
|
2001-09-25 21:27:11 +02:00
|
|
|
|
|
|
|
post-patch:
|
2002-07-03 21:15:17 +02:00
|
|
|
@${REINPLACE_CMD} -e "s!/etc/ffserver.conf!${PREFIX}/etc/ffserver.conf!g" \
|
2001-09-25 21:27:11 +02:00
|
|
|
${WRKSRC}/ffserver.c
|
2003-06-03 08:33:38 +02:00
|
|
|
.if ${ARCH} == "i386"
|
2003-01-28 17:27:58 +01:00
|
|
|
# we support "v4l" per default through Steve O'Hara-Smith's bktr(4)
|
|
|
|
# patch
|
|
|
|
@${REINPLACE_CMD} -E -e \
|
|
|
|
's|^(v4l).*$$|\1="yes"|' \
|
|
|
|
${WRKSRC}/configure
|
2002-10-11 21:28:30 +02:00
|
|
|
.ifdef(WITH_BKTR_FORMAT)
|
|
|
|
@${REINPLACE_CMD} -e \
|
|
|
|
"s!VIDEO_FORMAT NTSC!VIDEO_FORMAT ${WITH_BKTR_FORMAT}!" \
|
2003-01-10 19:21:21 +01:00
|
|
|
${WRKSRC}/libavformat/grab_bsdbktr.c
|
2002-10-11 21:28:30 +02:00
|
|
|
.endif
|
|
|
|
.ifdef(WITH_BKTR_DEV)
|
|
|
|
@${REINPLACE_CMD} -e \
|
|
|
|
"s!VIDEO_INPUT METEOR_INPUT_DEV0!VIDEO_INPUT METEOR_INPUT_DEV${WITH_BKTR_DEV}!" \
|
2003-01-10 19:21:21 +01:00
|
|
|
${WRKSRC}/libavformat/grab_bsdbktr.c
|
2002-10-11 21:28:30 +02:00
|
|
|
.endif
|
2003-06-03 08:33:38 +02:00
|
|
|
.endif # ${ARCH} == i386
|
|
|
|
# malloc.h was deprecated in favor of stdlib.h
|
|
|
|
@${FIND} ${WRKSRC} -type f | \
|
|
|
|
${XARGS} -n 10 ${REINPLACE_CMD} -e \
|
|
|
|
's|malloc.h|stdlib.h|'
|
2002-11-03 08:01:44 +01:00
|
|
|
.ifndef(WITHOUT_LIBA52)
|
|
|
|
@${REINPLACE_CMD} -e 's|-ldl||' \
|
|
|
|
${WRKSRC}/configure
|
|
|
|
.endif
|
2001-09-25 21:27:11 +02:00
|
|
|
|
|
|
|
post-install:
|
|
|
|
.ifndef(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
|
|
|
.for file in ${DOC_FILES}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
|
|
|
|
.endfor
|
|
|
|
.for file in ${DOC_DOCFILES}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/doc/${file} ${DOCSDIR}
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/doc/ffserver.conf \
|
|
|
|
${PREFIX}/etc/ffserver.conf.sample
|
2001-10-26 18:13:20 +02:00
|
|
|
.for file in ${HEADER_FILES}
|
2002-08-04 15:18:10 +02:00
|
|
|
# fix header references prior to installation
|
2002-10-11 21:28:30 +02:00
|
|
|
@${REINPLACE_CMD} -e 's|"common.h"|<ffmpeg/common.h>|; \
|
|
|
|
s|"avcodec.h"|<ffmpeg/avcodec.h>|' \
|
2002-08-04 15:18:10 +02:00
|
|
|
${WRKSRC}/${file}
|
2002-10-11 21:28:30 +02:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/${file} \
|
|
|
|
${PREFIX}/include/ffmpeg/${file:T}
|
2001-10-26 18:13:20 +02:00
|
|
|
.endfor
|
|
|
|
.for file in ${LIB_FILES}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/lib/${file:T}
|
|
|
|
.endfor
|
2002-10-11 21:28:30 +02:00
|
|
|
# add shared lib link
|
|
|
|
@${LN} -sf libavcodec.so \
|
|
|
|
${PREFIX}/lib/libavcodec.so.${SHLIB_VERSION}
|
|
|
|
|
|
|
|
.include <bsd.port.post.mk>
|