source: trunk/dports/multimedia/ffmpeg/Portfile @ 120565

Last change on this file since 120565 was 120565, checked in by cal@…, 5 years ago

gnutls: update to 3.3.3, fixes CVE-2014-3466, security, closes #43865, revbump dependents

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 120565 2014-06-01 16:53:49Z cal@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7PortGroup compiler_blacklist_versions 1.0
8
9name            ffmpeg
10conflicts       ffmpeg-devel
11epoch           1
12version         2.2.2
13revision        1
14license         LGPL-2.1+
15categories      multimedia
16maintainers     devans jeremyhu openmaintainer
17
18description     FFmpeg is a complete solution to play, record, convert and \
19                stream audio and video.
20
21long_description        FFmpeg is a complete solution to record, convert and \
22                        stream audio and video. It includes libavcodec, the \
23                        leading audio/video codec library. \
24                        \
25                        The project is made of several components: \
26                        \
27                        ffmpeg is a command line tool to convert one video \
28                        file format to another. It also supports grabbing and \
29                        encoding in real time from a TV card. \
30                        \
31                        ffserver is an HTTP (RTSP is being developed) \
32                        multimedia streaming server for live broadcasts. Time \
33                        shifting of live broadcast is also supported. \
34                        \
35                        ffplay is a simple media player based on SDL and on \
36                        the ffmpeg libraries. \
37                        \
38                        ffprobe gathers information from multimedia streams and \
39                        prints it in human- and machine-readable fashion. \
40                        \
41                        libavcodec is a library containing all the ffmpeg \
42                        audio/video encoders and decoders. Most codecs were \
43                        developed from scratch to ensure best performance \
44                        and high code reusability. \
45                        \
46                        libavformat is a library containing parsers and \
47                        generators for all common audio/video formats.
48
49platforms       darwin
50homepage        http://www.ffmpeg.org/
51master_sites    http://www.ffmpeg.org/releases/
52
53use_bzip2       yes
54
55checksums       rmd160  4a533428ef48a751efb196ce412f5f2fb7ee49bf \
56                sha256  a42b97add671a0b40126261174397b5918e7ec219d8ec6b8e62e86aa0fb15218
57
58depends_build   port:pkgconfig \
59                port:gmake \
60                port:texi2html
61
62depends_lib     port:lame \
63                port:libiconv \
64                port:libvorbis \
65                port:libopus \
66                port:libogg \
67                port:libtheora \
68                port:libmodplug \
69                port:schroedinger \
70                port:libass \
71                port:libbluray \
72                port:gnutls \
73                port:openjpeg15 \
74                port:fontconfig \
75                port:freetype \
76                path:lib/libspeex.dylib:speex \
77                port:libvpx \
78                port:libsdl \
79                port:bzip2 \
80                port:zlib
81
82patchfiles      patch-libdc1394.diff
83
84build.cmd       ${prefix}/bin/gmake
85build.env-append V=1
86
87#
88# enable auto configure of asm optimizations
89# requires Xcode 3.1 or better on Leopard
90#
91minimum_xcodeversions {9 3.1}
92
93if {[lsearch [get_canonical_archs] i386] != -1} {
94    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
95    # clang-139 hits https://trac.macports.org/ticket/38141
96    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
97}
98
99# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
100# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
101default_variants-append +gpl2
102
103configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
104configure.args \
105        --enable-swscale \
106        --enable-avfilter \
107        --enable-avresample \
108        --enable-libmp3lame \
109        --enable-libvorbis \
110        --enable-libopus \
111        --enable-libtheora \
112        --enable-libschroedinger \
113        --enable-libopenjpeg \
114        --enable-libmodplug \
115        --enable-libvpx \
116        --enable-libspeex \
117        --enable-libass \
118        --enable-libbluray \
119        --enable-gnutls \
120        --enable-fontconfig \
121        --enable-libfreetype \
122        --disable-indev=jack \
123        --disable-outdev=xv \
124        --disable-vda \
125        --mandir=${prefix}/share/man \
126        --enable-shared --enable-pthreads \
127        --cc=${configure.cc}
128
129# disable asm on Tiger
130# libblueray doesn't build on Tiger so disable for now (#39442)
131platform darwin {
132    if {${os.major} < 9} {
133        depends_lib-delete    port:libbluray
134        configure.args-delete --enable-libbluray
135        configure.args-append --disable-libbluray
136        configure.args-append --disable-asm
137    }
138
139    # FIXME: use ${os.minor} once it hits stable base
140    # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+
141    if {${os.major} > 10 || (${os.major} == 10 && [lindex [split ${os.version} .] 1] >= 3)} {
142        configure.args-delete --disable-vda
143        configure.args-append --enable-vda
144    }
145}
146
147test.run        yes
148
149#
150# configure isn't autoconf and they do use a dep cache
151#
152
153post-destroot {
154    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
155    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
156    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
157    foreach f [glob ${worksrcpath}/doc/*.txt] {
158        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
159    }
160}
161
162platform powerpc {
163    # absence of altivec is not automatically detected
164    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
165        configure.args-append --disable-altivec
166    }
167}
168
169platform darwin 8 {
170    post-patch {
171        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
172    }
173}
174
175configure.universal_args-delete --disable-dependency-tracking
176
177if {[variant_isset universal]} {
178    foreach arch ${configure.universal_archs} {
179        set merger_host($arch) ""
180        lappend merger_configure_args($arch) --arch=${arch}
181        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
182    }
183    if {[string match "*86*" ${configure.universal_archs}]} {
184        depends_build-append port:yasm
185    }
186    lappend merger_configure_args(i386) --enable-yasm
187    lappend merger_configure_args(x86_64) --enable-yasm
188} else {
189    configure.args-append --arch=${configure.build_arch}
190    configure.env-append  ASFLAGS='[get_canonical_archflags]'
191    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
192        depends_build-append port:yasm
193        configure.args-append --enable-yasm
194    }
195}
196
197variant libdc1394 description {Enable IIDC-1394 frame grabbing using libdc1394 (experimental)} {
198    depends_lib-append port:libdc1394
199    configure.args-append --enable-libdc1394
200}
201
202# Allow use of librtmp instead of ffmpeg's internal rtmp implementation
203# May address interoperability issues with CRtmpServer and others
204# https://trac.macports.org/ticket/32219
205# https://groups.google.com/forum/#!topic/c-rtmp-server/ywQPjvciPgc
206# https://trac.ffmpeg.org/ticket/1700
207
208variant librtmp description {Use librtmp (from rtmpdump) as rtmp[t][es]:// protocol handler} {
209    configure.args-append     --enable-librtmp
210
211    depends_lib-append        port:rtmpdump
212}
213
214variant gpl2 description {Enable GPL code, license will be GPL-2+} {
215    configure.args-append   --enable-gpl \
216                            --enable-postproc \
217                            --enable-libx264 \
218                            --enable-libxvid
219    depends_lib-append      port:XviD \
220                            port:x264
221    license-delete          LGPL-2.1+
222    license-append          GPL-2+
223}
224
225variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
226    configure.args-delete   --disable-libopencore-amrnb \
227                            --disable-libopencore-amrwb
228    configure.args-append   --enable-version3 \
229                            --enable-libopencore-amrnb \
230                            --enable-libopencore-amrwb
231    depends_lib-append      port:opencore-amr
232    license-delete          LGPL-2.1+
233    license-append          GPL-3+
234}
235
236# the build server uses the default variants, and we want distributable binaries
237# nonfree code is disabled by default but can be enabled using the +nonfree variant
238
239variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
240    configure.args-append   --enable-nonfree \
241                            --enable-libfdk-aac \
242                            --enable-libfaac
243    depends_lib-append      port:libfdk-aac \
244                            port:faac
245    license-delete          LGPL-2.1+
246    license-append          Restrictive
247}
248
249if {[variant_isset nonfree]} {
250notes "
251*******
252******* This build of ${name} includes nonfree code as follows:
253*******
254*******     libfaac
255*******     libfdk-aac
256*******
257******* The following libraries and binaries may not be redistributed:
258*******
259*******     ffmpeg
260*******     libavcodec
261*******     libavdevice
262*******     libavfilter
263*******     libavformat
264*******     libavutil
265*******
266******* To remove this restriction remove the variant +nonfree
267*******
268"
269} elseif {[variant_isset gpl3]} {
270notes "
271*******
272******* This build of ${name} includes GPLed code and
273******* is therefore licensed under GPL v3 or later.
274*******
275******* The following modules are GPLed:
276*******
277*******      postproc
278*******      libx264
279*******      libxvid
280*******      opencore-amr
281*******
282******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
283******* To remove nonfree and GPLed code leaving only LGPL code remove the
284******* +gpl2 and +gpl3 variants.
285*******
286"
287} elseif {[variant_isset gpl2]} {
288notes "
289*******
290******* This build of ${name} includes GPLed code and
291******* is therefore licensed under GPL v2 or later.
292*******
293******* The following modules are GPLed:
294*******
295*******      postproc
296*******      libx264
297*******      libxvid
298*******
299******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
300******* To remove nonfree and GPLed code leaving only LGPL code remove the
301******* +gpl2 variant.
302*******
303"
304} else {
305notes "
306*******
307******* This build of ${name} includes no GPLed or nonfree
308******* code and is therefore licensed under LGPL v2.1 or later.
309*******
310"
311}
312
313livecheck.type  regex
314livecheck.url   ${master_sites}
315livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.