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

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

ffmpeg: update to version 2.5.1, bug fixes including libsmbclient regression.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.3 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 129590 2014-12-16 16:07:09Z 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.5.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  0ff92a2408872f9ce95614ac889fa57c843f926a \
56                sha256  03cf50b2f9109548e466f144c960b37031ffc1b9fab96382b4b26b7607c7ef52
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-libxcb \
127        --disable-libxcb-shm \
128        --disable-libxcb-xfixes \
129        --disable-indev=jack \
130        --disable-outdev=xv \
131        --disable-vda \
132        --mandir=${prefix}/share/man \
133        --enable-shared --enable-pthreads \
134        --cc=${configure.cc}
135
136# disable asm on Tiger
137# libblueray doesn't build on Tiger so disable for now (#39442)
138
139platform darwin {
140    if {${os.major} < 9} {
141        depends_lib-delete    port:libbluray
142        configure.args-delete --enable-libbluray
143        configure.args-append --disable-libbluray
144        configure.args-append --disable-asm
145    }
146
147    # FIXME: use ${os.minor} once it hits stable base
148    # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+
149    if {${os.major} > 10 || (${os.major} == 10 && [lindex [split ${os.version} .] 1] >= 3)} {
150        configure.args-delete --disable-vda
151        configure.args-append --enable-vda
152    }
153
154    # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+
155    if {${os.major} < 12} {
156        configure.args-append --disable-indev=avfoundation
157    }
158}
159
160test.run        yes
161
162#
163# configure isn't autoconf and they do use a dep cache
164#
165
166post-destroot {
167    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
168    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
169    foreach f [glob ${worksrcpath}/doc/*.txt] {
170        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
171    }
172}
173
174platform powerpc {
175    # absence of altivec is not automatically detected
176    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
177        configure.args-append --disable-altivec
178    }
179}
180
181platform darwin 8 {
182    post-patch {
183        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
184    }
185}
186
187configure.universal_args-delete --disable-dependency-tracking
188
189if {[variant_isset universal]} {
190    foreach arch ${configure.universal_archs} {
191        set merger_host($arch) ""
192        lappend merger_configure_args($arch) --arch=${arch}
193        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
194    }
195    if {[string match "*86*" ${configure.universal_archs}]} {
196        depends_build-append port:yasm
197    }
198    lappend merger_configure_args(i386) --enable-yasm
199    lappend merger_configure_args(x86_64) --enable-yasm
200} else {
201    configure.args-append --arch=${configure.build_arch}
202    configure.env-append  ASFLAGS='[get_canonical_archflags]'
203    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
204        depends_build-append port:yasm
205        configure.args-append --enable-yasm
206    }
207}
208
209# this dummy variant is used to mark whether ffmpeg is built with
210# libsdl +x11 and hence has a binary dependency on xorg-libX11
211# or libsdl -x11 and does not
212
213variant x11 {}
214default_variants +x11
215
216if {[variant_isset x11]} {
217    require_active_variants libsdl x11
218} else {
219    require_active_variants libsdl "" x11
220}
221
222variant libdc1394 description {Enable IIDC-1394 frame grabbing using libdc1394 (experimental)} {
223    depends_lib-append port:libdc1394
224    configure.args-append --enable-libdc1394
225}
226
227# Allow use of librtmp instead of ffmpeg's internal rtmp implementation
228# May address interoperability issues with CRtmpServer and others
229# https://trac.macports.org/ticket/32219
230# https://groups.google.com/forum/#!topic/c-rtmp-server/ywQPjvciPgc
231# https://trac.ffmpeg.org/ticket/1700
232
233variant librtmp description {Use librtmp (from rtmpdump) as rtmp[t][es]:// protocol handler} {
234    configure.args-append   --enable-librtmp
235
236    depends_lib-append      port:rtmpdump
237}
238
239variant gpl2 description {Enable GPL code, license will be GPL-2+} {
240    configure.args-append   --enable-gpl \
241                            --enable-postproc \
242                            --enable-libx264 \
243                            --enable-libxvid
244    depends_lib-append      port:XviD \
245                            port:x264
246    license-delete          LGPL-2.1+
247    license-append          GPL-2+
248}
249
250# libsmbclient causes build failure when +gpl3 is selected (#46244)
251# disable until underlying cause is identified and addressed
252
253variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
254    configure.args-append   --enable-version3 \
255                            --enable-libopencore-amrnb \
256                            --enable-libopencore-amrwb \
257                            --enable-libsmbclient
258
259    depends_lib-append      port:opencore-amr \
260                            port:samba3
261
262    license-delete          LGPL-2.1+
263    license-append          GPL-3+
264}
265
266# the build server uses the default variants, and we want distributable binaries
267# nonfree code is disabled by default but can be enabled using the +nonfree variant
268
269variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
270    configure.args-append   --enable-nonfree \
271                            --enable-libfdk-aac \
272                            --enable-libfaac
273    depends_lib-append      port:libfdk-aac \
274                            port:faac
275    license-delete          LGPL-2.1+
276    license-append          Restrictive
277}
278
279if {[variant_isset nonfree]} {
280notes "
281*******
282******* This build of ${name} includes nonfree code as follows:
283*******
284*******     libfaac
285*******     libfdk-aac
286*******
287******* The following libraries and binaries may not be redistributed:
288*******
289*******     ffmpeg
290*******     libavcodec
291*******     libavdevice
292*******     libavfilter
293*******     libavformat
294*******     libavutil
295*******
296******* To remove this restriction remove the variant +nonfree
297*******
298"
299} elseif {[variant_isset gpl3]} {
300notes "
301*******
302******* This build of ${name} includes GPLed code and
303******* is therefore licensed under GPL v3 or later.
304*******
305******* The following modules are GPLed:
306*******
307*******      postproc
308*******      libsambaclient
309*******      libx264
310*******      libxvid
311*******      opencore-amr
312*******
313******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
314******* To remove nonfree and GPLed code leaving only LGPL code remove the
315******* +gpl2 and +gpl3 variants.
316*******
317"
318} elseif {[variant_isset gpl2]} {
319notes "
320*******
321******* This build of ${name} includes GPLed code and
322******* is therefore licensed under GPL v2 or later.
323*******
324******* The following modules are GPLed:
325*******
326*******      postproc
327*******      libx264
328*******      libxvid
329*******
330******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
331******* To remove nonfree and GPLed code leaving only LGPL code remove the
332******* +gpl2 variant.
333*******
334"
335} else {
336notes "
337*******
338******* This build of ${name} includes no GPLed or nonfree
339******* code and is therefore licensed under LGPL v2.1 or later.
340*******
341"
342}
343
344livecheck.type  regex
345livecheck.url   ${master_sites}
346livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.