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

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

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

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