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

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

ffmpeg: update to version 2.4.4, bug fixes, ABI compatible with previous version.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.1 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 128976 2014-12-01 22:10:01Z devans@macports.org $
3
4PortSystem      1.0
5PortGroup       xcodeversion 1.0
6PortGroup       muniversal 1.0
7PortGroup       compiler_blacklist_versions 1.0
8PortGroup       active_variants 1.1
9
10name            ffmpeg
11conflicts       ffmpeg-devel
12epoch           1
13version         2.4.4
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  e38bae3bf539404dc8afdb2805fb717f3cacc6db \
56                sha256  9ad041c0201fb8b2605c5c5c0259c373c793c32cfc96f7315fca67e900494afc
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                port:fribidi \
77                path:lib/libspeex.dylib:speex \
78                port:libvpx \
79                port:libsdl \
80                port:bzip2 \
81                port:xz \
82                port:zlib
83
84patchfiles      patch-libdc1394.diff
85
86build.cmd       ${prefix}/bin/gmake
87build.env-append V=1
88
89#
90# enable auto configure of asm optimizations
91# requires Xcode 3.1 or better on Leopard
92#
93minimum_xcodeversions {9 3.1}
94
95if {[lsearch [get_canonical_archs] i386] != -1} {
96    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
97    # clang-139 hits https://trac.macports.org/ticket/38141
98    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
99}
100
101# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
102# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
103default_variants-append +gpl2
104
105configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
106configure.args \
107        --enable-swscale \
108        --enable-avfilter \
109        --enable-avresample \
110        --enable-libmp3lame \
111        --enable-libvorbis \
112        --enable-libopus \
113        --enable-libtheora \
114        --enable-libschroedinger \
115        --enable-libopenjpeg \
116        --enable-libmodplug \
117        --enable-libvpx \
118        --enable-libspeex \
119        --enable-libass \
120        --enable-libbluray \
121        --enable-lzma \
122        --enable-gnutls \
123        --enable-fontconfig \
124        --enable-libfreetype \
125        --enable-libfribidi \
126        --disable-indev=jack \
127        --disable-outdev=xv \
128        --disable-vda \
129        --mandir=${prefix}/share/man \
130        --enable-shared --enable-pthreads \
131        --cc=${configure.cc}
132
133# disable asm on Tiger
134# libblueray doesn't build on Tiger so disable for now (#39442)
135
136platform darwin {
137    if {${os.major} < 9} {
138        depends_lib-delete    port:libbluray
139        configure.args-delete --enable-libbluray
140        configure.args-append --disable-libbluray
141        configure.args-append --disable-asm
142    }
143
144    # FIXME: use ${os.minor} once it hits stable base
145    # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+
146    if {${os.major} > 10 || (${os.major} == 10 && [lindex [split ${os.version} .] 1] >= 3)} {
147        configure.args-delete --disable-vda
148        configure.args-append --enable-vda
149    }
150
151    # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+
152    if {${os.major} < 12} {
153        configure.args-append --disable-indev=avfoundation
154    }
155}
156
157test.run        yes
158
159#
160# configure isn't autoconf and they do use a dep cache
161#
162
163post-destroot {
164    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
165    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
166    foreach f [glob ${worksrcpath}/doc/*.txt] {
167        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
168    }
169}
170
171platform powerpc {
172    # absence of altivec is not automatically detected
173    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
174        configure.args-append --disable-altivec
175    }
176}
177
178platform darwin 8 {
179    post-patch {
180        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
181    }
182}
183
184configure.universal_args-delete --disable-dependency-tracking
185
186if {[variant_isset universal]} {
187    foreach arch ${configure.universal_archs} {
188        set merger_host($arch) ""
189        lappend merger_configure_args($arch) --arch=${arch}
190        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
191    }
192    if {[string match "*86*" ${configure.universal_archs}]} {
193        depends_build-append port:yasm
194    }
195    lappend merger_configure_args(i386) --enable-yasm
196    lappend merger_configure_args(x86_64) --enable-yasm
197} else {
198    configure.args-append --arch=${configure.build_arch}
199    configure.env-append  ASFLAGS='[get_canonical_archflags]'
200    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
201        depends_build-append port:yasm
202        configure.args-append --enable-yasm
203    }
204}
205
206# this dummy variant is used to mark whether ffmpeg is built with
207# libsdl +x11 and hence has a binary dependency on xorg-libX11
208# or libsdl -x11 and does not
209
210variant x11 {}
211default_variants +x11
212
213if {[variant_isset x11]} {
214    require_active_variants libsdl x11
215} else {
216    require_active_variants libsdl "" x11
217}
218
219variant libdc1394 description {Enable IIDC-1394 frame grabbing using libdc1394 (experimental)} {
220    depends_lib-append port:libdc1394
221    configure.args-append --enable-libdc1394
222}
223
224# Allow use of librtmp instead of ffmpeg's internal rtmp implementation
225# May address interoperability issues with CRtmpServer and others
226# https://trac.macports.org/ticket/32219
227# https://groups.google.com/forum/#!topic/c-rtmp-server/ywQPjvciPgc
228# https://trac.ffmpeg.org/ticket/1700
229
230variant librtmp description {Use librtmp (from rtmpdump) as rtmp[t][es]:// protocol handler} {
231    configure.args-append   --enable-librtmp
232
233    depends_lib-append      port:rtmpdump
234}
235
236variant gpl2 description {Enable GPL code, license will be GPL-2+} {
237    configure.args-append   --enable-gpl \
238                            --enable-postproc \
239                            --enable-libx264 \
240                            --enable-libxvid
241    depends_lib-append      port:XviD \
242                            port:x264
243    license-delete          LGPL-2.1+
244    license-append          GPL-2+
245}
246
247variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
248    configure.args-append   --enable-version3 \
249                            --enable-libopencore-amrnb \
250                            --enable-libopencore-amrwb \
251                            --enable-libsmbclient
252
253    depends_lib-append      port:opencore-amr \
254                            port:samba3
255
256    license-delete          LGPL-2.1+
257    license-append          GPL-3+
258}
259
260# the build server uses the default variants, and we want distributable binaries
261# nonfree code is disabled by default but can be enabled using the +nonfree variant
262
263variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
264    configure.args-append   --enable-nonfree \
265                            --enable-libfdk-aac \
266                            --enable-libfaac
267    depends_lib-append      port:libfdk-aac \
268                            port:faac
269    license-delete          LGPL-2.1+
270    license-append          Restrictive
271}
272
273if {[variant_isset nonfree]} {
274notes "
275*******
276******* This build of ${name} includes nonfree code as follows:
277*******
278*******     libfaac
279*******     libfdk-aac
280*******
281******* The following libraries and binaries may not be redistributed:
282*******
283*******     ffmpeg
284*******     libavcodec
285*******     libavdevice
286*******     libavfilter
287*******     libavformat
288*******     libavutil
289*******
290******* To remove this restriction remove the variant +nonfree
291*******
292"
293} elseif {[variant_isset gpl3]} {
294notes "
295*******
296******* This build of ${name} includes GPLed code and
297******* is therefore licensed under GPL v3 or later.
298*******
299******* The following modules are GPLed:
300*******
301*******      postproc
302*******      libsambaclient
303*******      libx264
304*******      libxvid
305*******      opencore-amr
306*******
307******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
308******* To remove nonfree and GPLed code leaving only LGPL code remove the
309******* +gpl2 and +gpl3 variants.
310*******
311"
312} elseif {[variant_isset gpl2]} {
313notes "
314*******
315******* This build of ${name} includes GPLed code and
316******* is therefore licensed under GPL v2 or later.
317*******
318******* The following modules are GPLed:
319*******
320*******      postproc
321*******      libx264
322*******      libxvid
323*******
324******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
325******* To remove nonfree and GPLed code leaving only LGPL code remove the
326******* +gpl2 variant.
327*******
328"
329} else {
330notes "
331*******
332******* This build of ${name} includes no GPLed or nonfree
333******* code and is therefore licensed under LGPL v2.1 or later.
334*******
335"
336}
337
338livecheck.type  regex
339livecheck.url   ${master_sites}
340livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.