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

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

ffmpeg: update to version 2.2.3.

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