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

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

ffmpeg: increment revision to rebuild with latest libfdk-aac where necessary (#47120).

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