aboutsummaryrefslogtreecommitdiff
path: root/multimedia/gstreamer-ffmpeg/Makefile
blob: 40499c389e4f202df2281d55ac24d3082567f985 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Created by: Koop Mast <kwm@rainbow-runner.nl>
# $FreeBSD$
#    $MCom: ports/multimedia/gstreamer-ffmpeg/Makefile,v 1.14 2006/07/20 13:40:27 ahze Exp $

PORTNAME=	gstreamer
PORTVERSION=	0.10.13
PORTREVISION=	4
CATEGORIES=	multimedia
MASTER_SITES=	http://gstreamer.freedesktop.org/src/gst-ffmpeg/:ffmpeg \
		http://libav.org/releases/:libav
PKGNAMESUFFIX=	-ffmpeg
DISTFILES=	gst-ffmpeg-${PORTVERSION}.tar.bz2:ffmpeg

MAINTAINER=	multimedia@FreeBSD.org
COMMENT=	GStreamer plug-in for manipulating MPEG video streams

LICENSE=	GPLv2

LIB_DEPENDS=	liborc-0.4.so:${PORTSDIR}/devel/orc

PORTSCOUT=	limit:0\.10\..*

LIBAV_VERSION=	0.7.7
WRKSRC=		${WRKDIR}/gst-ffmpeg-${PORTVERSION}
USES=		compiler:features gmake libtool pkgconfig
USE_LDCONFIG=	yes
USE_GSTREAMER=	yes
GNU_CONFIGURE=	yes
PLIST_SUB=	VERSION="${PORTVERSION:R}"

OPTIONS_DEFINE=	FFMPEG
FFMPEG_DESC?=	Use system ffmpeg instead of internal libav

FFMPEG_LIB_DEPENDS=libavcodec0.so:${PORTSDIR}/multimedia/ffmpeg0
FFMPEG_CONFIGURE_WITH=system-ffmpeg

FFMPEG_DISTFILES_OFF=libav-${LIBAV_VERSION}.tar.xz:libav
FFMPEG_BUILD_DEPENDS_OFF=yasm:${PORTSDIR}/devel/yasm
FFMPEG_LDFLAGS_OFF=-Wl,-Bsymbolic
FFMPEG_CONFIGURE_OFF=--with-ffmpeg-extra-configure="${FFMPEG_CONFIG}"
FFMPEG_CONFIG=	--cc=${CC} \
		--enable-runtime-cpudetect \
		--enable-pic

# sse hardware vector support
.if defined(MACHINE_CPU) && (${MACHINE_CPU:Msse} == "sse" || ${MACHINE_CPU:Mamd64} == "amd64")
WITH_BUILTIN_VECTOR=	yes
.else
FFMPEG_CONFIG+=	--disable-sse
.endif

# mmx support
.if defined(MACHINE_CPU) && ${MACHINE_CPU:Mmmx} == "" && ${MACHINE_CPU:Mamd64} == ""
FFMPEG_CONFIG+=	--disable-mmx
WITHOUT_BUILTIN_VECTOR=	yes
.endif

# builtin vector, requires mmx and sse
.if !defined(WITHOUT_BUILTIN_VECTOR) && defined(WITH_BUILTIN_VECTOR)
FFMPEG_CFLAGS_OFF+=-msse
.endif

.include <bsd.port.pre.mk>

.if ${ARCH} == armv6
CONFIGURE_ENV+=	ASFLAGS=-no-integrated-as
CFLAGS=	-no-integrated-as
BUILD_DEPENDS+=	${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
CONFIGURE_ENV+=	COMPILER_PATH=${LOCALBASE}/bin
MAKE_ENV+=	COMPILER_PATH=${LOCALBASE}/bin
.endif

.if ! ${PORT_OPTIONS:MFFMPEG}
.if ${ARCH} == ia64
BUILD_DEPENDS+=	${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils
CONFIGURE_ENV+=	COMPILER_PATH=${LOCALBASE}/bin
MAKE_ENV+=	COMPILER_PATH=${LOCALBASE}/bin
.endif

.if ${ARCH} == powerpc64
FFMPEG_CONFIG+=	--arch=ppc64
.endif

.if ${COMPILER_TYPE} == "gcc"
CFLAGS+=	-fno-force-addr
.endif

post-extract:
	@${MV} ${WRKSRC}/gst-libs/ext/libav ${WRKSRC}/gst-libs/ext/libav.old
	@${MV} ${WRKDIR}/libav-${LIBAV_VERSION} ${WRKSRC}/gst-libs/ext/libav
	@${CP} ${WRKSRC}/gst-libs/ext/libav.old/config.* \
		${WRKSRC}/gst-libs/ext/libav/
.endif # FFMPEG

post-patch:
	@${REINPLACE_CMD} -Ee '/sleep 15/d; /PKG_CONFIG/\
		s/lib(av(format|codec|util)|postproc|swscale)/&0/g' \
		${WRKSRC}/configure
	@${REINPLACE_CMD} 's/[[:<:]]ARCH[[:>:]]/LIBAV_ARCH/' \
		${WRKSRC}/gst-libs/ext/libav/Makefile \
		${WRKSRC}/gst-libs/ext/libav/common.mak \
		${WRKSRC}/gst-libs/ext/libav/configure \
		${WRKSRC}/gst-libs/ext/libav/libavcodec/Makefile \
		${WRKSRC}/gst-libs/ext/libav/libavfilter/Makefile

.include <bsd.port.post.mk>