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

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

ffmpeg: update to version 2.3.3, bug fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.6 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 124077 2014-08-18 11:30:43Z 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.3.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  cee0f67250da8e5dd11e58321b0466dcdfd33073 \
55                sha256  bb4c0d10a24e08fe67292690a1b4d4ded04f5c4c388f0656c98940ab0c606446
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                port:fribidi \
76                path:lib/libspeex.dylib:speex \
77                port:libvpx \
78                port:libsdl \
79                port:bzip2 \
80                port:zlib
81
82patchfiles      patch-libdc1394.diff
83
84build.cmd       ${prefix}/bin/gmake
85build.env-append V=1
86
87#
88# enable auto configure of asm optimizations
89# requires Xcode 3.1 or better on Leopard
90#
91minimum_xcodeversions {9 3.1}
92
93if {[lsearch [get_canonical_archs] i386] != -1} {
94    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
95    # clang-139 hits https://trac.macports.org/ticket/38141
96    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
97}
98
99# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
100# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
101default_variants-append +gpl2
102
103configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
104configure.args \
105        --enable-swscale \
106        --enable-avfilter \
107        --enable-avresample \
108        --enable-libmp3lame \
109        --enable-libvorbis \
110        --enable-libopus \
111        --enable-libtheora \
112        --enable-libschroedinger \
113        --enable-libopenjpeg \
114        --enable-libmodplug \
115        --enable-libvpx \
116        --enable-libspeex \
117        --enable-libass \
118        --enable-libbluray \
119        --enable-gnutls \
120        --enable-fontconfig \
121        --enable-libfreetype \
122        --enable-libfribidi \
123        --disable-indev=jack \
124        --disable-outdev=xv \
125        --disable-vda \
126        --mandir=${prefix}/share/man \
127        --enable-shared --enable-pthreads \
128        --cc=${configure.cc}
129
130# disable asm on Tiger
131# libblueray doesn't build on Tiger so disable for now (#39442)
132
133platform darwin {
134    if {${os.major} < 9} {
135        depends_lib-delete    port:libbluray
136        configure.args-delete --enable-libbluray
137        configure.args-append --disable-libbluray
138        configure.args-append --disable-asm
139    }
140
141    # FIXME: use ${os.minor} once it hits stable base
142    # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+
143    if {${os.major} > 10 || (${os.major} == 10 && [lindex [split ${os.version} .] 1] >= 3)} {
144        configure.args-delete --disable-vda
145        configure.args-append --enable-vda
146    }
147
148    # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+
149    if {${os.major} < 12} {
150        configure.args-append --disable-indev=avfoundation
151    }
152}
153
154test.run        yes
155
156#
157# configure isn't autoconf and they do use a dep cache
158#
159
160post-destroot {
161    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
162    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
163    foreach f [glob ${worksrcpath}/doc/*.txt] {
164        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
165    }
166}
167
168platform powerpc {
169    # absence of altivec is not automatically detected
170    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
171        configure.args-append --disable-altivec
172    }
173}
174
175platform darwin 8 {
176    post-patch {
177        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
178    }
179}
180
181configure.universal_args-delete --disable-dependency-tracking
182
183if {[variant_isset universal]} {
184    foreach arch ${configure.universal_archs} {
185        set merger_host($arch) ""
186        lappend merger_configure_args($arch) --arch=${arch}
187        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
188    }
189    if {[string match "*86*" ${configure.universal_archs}]} {
190        depends_build-append port:yasm
191    }
192    lappend merger_configure_args(i386) --enable-yasm
193    lappend merger_configure_args(x86_64) --enable-yasm
194} else {
195    configure.args-append --arch=${configure.build_arch}
196    configure.env-append  ASFLAGS='[get_canonical_archflags]'
197    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
198        depends_build-append port:yasm
199        configure.args-append --enable-yasm
200    }
201}
202
203variant libdc1394 description {Enable IIDC-1394 frame grabbing using libdc1394 (experimental)} {
204    depends_lib-append port:libdc1394
205    configure.args-append --enable-libdc1394
206}
207
208# Allow use of librtmp instead of ffmpeg's internal rtmp implementation
209# May address interoperability issues with CRtmpServer and others
210# https://trac.macports.org/ticket/32219
211# https://groups.google.com/forum/#!topic/c-rtmp-server/ywQPjvciPgc
212# https://trac.ffmpeg.org/ticket/1700
213
214variant librtmp description {Use librtmp (from rtmpdump) as rtmp[t][es]:// protocol handler} {
215    configure.args-append   --enable-librtmp
216
217    depends_lib-append      port:rtmpdump
218}
219
220variant gpl2 description {Enable GPL code, license will be GPL-2+} {
221    configure.args-append   --enable-gpl \
222                            --enable-postproc \
223                            --enable-libx264 \
224                            --enable-libxvid
225    depends_lib-append      port:XviD \
226                            port:x264
227    license-delete          LGPL-2.1+
228    license-append          GPL-2+
229}
230
231variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
232    configure.args-append   --enable-version3 \
233                            --enable-libopencore-amrnb \
234                            --enable-libopencore-amrwb \
235                            --enable-libsmbclient
236
237    depends_lib-append      port:opencore-amr \
238                            port:samba3
239
240    license-delete          LGPL-2.1+
241    license-append          GPL-3+
242}
243
244# the build server uses the default variants, and we want distributable binaries
245# nonfree code is disabled by default but can be enabled using the +nonfree variant
246
247variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
248    configure.args-append   --enable-nonfree \
249                            --enable-libfdk-aac \
250                            --enable-libfaac
251    depends_lib-append      port:libfdk-aac \
252                            port:faac
253    license-delete          LGPL-2.1+
254    license-append          Restrictive
255}
256
257if {[variant_isset nonfree]} {
258notes "
259*******
260******* This build of ${name} includes nonfree code as follows:
261*******
262*******     libfaac
263*******     libfdk-aac
264*******
265******* The following libraries and binaries may not be redistributed:
266*******
267*******     ffmpeg
268*******     libavcodec
269*******     libavdevice
270*******     libavfilter
271*******     libavformat
272*******     libavutil
273*******
274******* To remove this restriction remove the variant +nonfree
275*******
276"
277} elseif {[variant_isset gpl3]} {
278notes "
279*******
280******* This build of ${name} includes GPLed code and
281******* is therefore licensed under GPL v3 or later.
282*******
283******* The following modules are GPLed:
284*******
285*******      postproc
286*******      libsambaclient
287*******      libx264
288*******      libxvid
289*******      opencore-amr
290*******
291******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
292******* To remove nonfree and GPLed code leaving only LGPL code remove the
293******* +gpl2 and +gpl3 variants.
294*******
295"
296} elseif {[variant_isset gpl2]} {
297notes "
298*******
299******* This build of ${name} includes GPLed code and
300******* is therefore licensed under GPL v2 or later.
301*******
302******* The following modules are GPLed:
303*******
304*******      postproc
305*******      libx264
306*******      libxvid
307*******
308******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
309******* To remove nonfree and GPLed code leaving only LGPL code remove the
310******* +gpl2 variant.
311*******
312"
313} else {
314notes "
315*******
316******* This build of ${name} includes no GPLed or nonfree
317******* code and is therefore licensed under LGPL v2.1 or later.
318*******
319"
320}
321
322livecheck.type  regex
323livecheck.url   ${master_sites}
324livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.