# New ports collection makefile for: multimedia/cinelerra
# Date created:		01 Oct 2009
# Whom:			Stas Timokhin <stast@bsdportal.ru>
#
# $FreeBSD$
#

PORTNAME=	cinelerra
PORTVERSION=	4.1
CATEGORIES=	multimedia
MASTER_SITES=	http://www.stasyan.com/devel/distfiles/
#SF/heroines/releases/081108/ \
DISTNAME=	my_cinelerra_20090929

MAINTAINER=	stast@bsdportal.ru
COMMENT=	Non-linear video editor and compositor

LIB_DEPENDS+=	tiff.4:${PORTSDIR}/graphics/tiff \
		freetype.9:${PORTSDIR}/print/freetype2 \
		FLAC.10:${PORTSDIR}/audio/flac \
		esd.2:${PORTSDIR}/audio/esound \
		mjpegutils-1.9.1:${PORTSDIR}/multimedia/mjpegtools \
		theora.0:${PORTSDIR}/multimedia/libtheora \
		IlmImf.6:${PORTSDIR}/graphics/OpenEXR \
		Imath.6:${PORTSDIR}/graphics/ilmbase \
		quicktime.0:${PORTSDIR}/multimedia/libquicktime \
		a52.0:${PORTSDIR}/audio/liba52 \
		faac.0:${PORTSDIR}/audio/faac \
		mp3lame.0:${PORTSDIR}/audio/lame \
		uuid.1:${PORTSDIR}/misc/e2fsprogs-libuuid \
		sndfile.1:${PORTSDIR}/audio/libsndfile \
		fftw3.5:${PORTSDIR}/math/fftw3
BUILD_DEPENDS+=	toolame:${PORTSDIR}/audio/toolame \
		v4l_compat>=1.0:${PORTSDIR}/multimedia/v4l_compat

WRKSRC=		${WRKDIR}/my_cinelerra
USE_GMAKE=	yes
GNU_CONFIGURE=	yes
USE_AUTOTOOLS=	aclocal:17 autoconf:262 autoheader:262 automake:17 libtool:22
ACLOCAL_ARGS=	-I m4
AUTOMAKE_ARGS=	--foreign --add-missing
CONFIGURE_ARGS+=	--disable-firewire --disable-alsa --with-external-ffmpeg
LIBTOOLFLAGS=	--force
PKG_CONFIG=	${LOCALBASE}/bin/pkg-config
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib -L/usr/lib
FFMPEG_CFLAGS=	-I/${LOCALBASE}/include   -I${LOCALBASE}/include/libavcodec -I${LOCALBASE}/include/libswscale -DHAVE_SWSCALER
LIBS=		-lgettextlib
CONFIGURE_ENV+=	PKG_CONFIG=${PKG_CONFIG} CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" FFMPEG_CFLAGS="${FFMPEG_CFLAGS}" LIBS="${LIBS}"

patch-autotools:
		@(cd ${PATCH_WRKSRC}; ${LIBTOOLIZE} --force;)

.include <bsd.port.mk>
