-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
165 lines (142 loc) · 5.3 KB
/
Portfile
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# $Id$
PortSystem 1.0
name ffmpeg
version 0.4.9-pre1
revision 12
categories multimedia
maintainers acho@macports.org openmaintainer
description Digital VCR and streaming server
long_description FFmpeg is a complete solution to record, convert and \
stream audio and video. It includes libavcodec, the \
leading audio/video codec library. \
\
The project is made of several components: \
\
ffmpeg is a command line tool to convert one video \
file format to another. It also supports grabbing and \
encoding in real time from a TV card. \
\
ffserver is an HTTP (RTSP is being developped) \
multimedia streaming server for live broadcasts. Time \
shifting of live broadcast is also supported. \
\
ffplay is a simple media player based on SDL and on \
the ffmpeg libraries. \
\
libavcodec is a library containing all the ffmpeg \
audio/video encoders and decoders. Most codecs were \
developped from scratch to ensure best performances \
and high code reusability. \
\
libavformat is a library containing parsers and \
generators for all common audio/video formats.
homepage http://ffmpeg.sourceforge.net/
master_sites
distfiles
use_parallel_build yes
worksrcdir trunk
depends_build bin:svn:subversion port:gmake
build.cmd gmake
configure.compiler gcc-4.0
set svn_rev 14381
pre-fetch {
if {[file isdirectory ${distpath}/${svn_rev}]} {
if {![file isdirectory ${distpath}/${svn_rev}/trunk/.svn]} {
file delete -force ${distpath}/${svn_rev}
}
}
}
fetch {
if {![file isdirectory ${distpath}/${svn_rev}]} {
file mkdir ${distpath}/${svn_rev}
system "svn co -r${svn_rev} --ignore-externals svn://svn.mplayerhq.hu/ffmpeg/trunk ${distpath}/${svn_rev}/trunk"
system "svn co -r27349 svn://svn.mplayerhq.hu/mplayer/trunk/libswscale ${distpath}/${svn_rev}/trunk/libswscale"
}
}
extract {
file copy ${distpath}/${svn_rev}/trunk ${worksrcpath}
}
platforms darwin
configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
configure.args --disable-vhook \
--mandir=${prefix}/share/man \
--enable-shared --enable-pthreads \
--disable-mmx --cc=gcc-4.0
default_variants +a52
pre-configure {
if {[variant_isset universal]} {
configure.args-delete --disable-dependency-tracking
}
}
post-destroot {
file mkdir ${destroot}${prefix}/share/doc/${name}
file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
file copy $f ${destroot}${prefix}/share/doc/${name}
}
}
platform darwin i386 {
post-patch {
reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c
}
}
variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} {
# make no-mmx default and allow mmx enabling for the brave.
configure.args-delete --disable-mmx
# Fix Leopard problems by disabling the cavs decoder for now
configure.args-append --disable-decoder=cavs
}
variant gpl description {allow use of GPL code, the resulting libav* and ffmpeg will be under GPL} {
configure.args-append --enable-gpl
}
variant postproc requires gpl description {enable GPLed postprocessing support} {
configure.args-append --enable-postproc
}
# Adds MP3 support
variant lame description {enable MP3 encoding via libmp3lame} {
depends_lib-append port:lame
configure.args-append --enable-libmp3lame
}
variant extvorbis description {enable Vorbis encoding via libvorbis, native implementation exists} {
depends_lib-append port:libvorbis port:libogg
configure.args-append --enable-libvorbis
}
variant theora description {enable Theora encoding via libtheora} {
depends_lib-append port:libtheora port:libogg
configure.args-append --enable-libtheora
}
variant faac requires gpl description {enable FAAC support via libfaac} {
depends_lib-append port:faac
configure.args-append --enable-libfaac
}
variant faad requires gpl description {enable FAAD support via libfaad} {
depends_lib-append port:faad2
configure.args-append --enable-libfaad
}
variant xvid requires gpl description {enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists} {
depends_lib-append port:XviD
configure.args-append --enable-libxvid
}
# depends build until x264 port supports shared libraries
variant x264 requires gpl description {enable H.264 encoding via x264} {
depends_build-append port:x264
configure.args-append --enable-libx264
}
variant a52 requires gpl description {enable GPLed liba52 support} {
depends_lib-append port:a52dec
configure.args-append --enable-liba52
post-destroot {
file mkdir ${destroot}${prefix}/include/ffmpeg
foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] {
regsub -all $destroot ${f} "" srclink
ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end]
}
}
}
variant avfilter requires gpl description {video filter support (replaces vhook)} {
patchfiles-append patch-libswscale-Makefile.diff \
patch-configure.diff
configure.args-append --enable-swscale --enable-avfilter
# keep vhook as long as avfilter isnt working fully
configure.args-delete --disable-vhook
}