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

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

ffmpeg: update to version 2.4.1.

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