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

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

ffmpeg, ffmpeg-devel: dependencies, configuration (#36849).

  • add explicit dependency on libiconv to avoid opportunistic configuration
  • add dependency and enable fontconfig (fonts by name in filter drawtext)
  • add variant +libdc1394, enables experimental frame grabbing from FireWire cameras.
  • increment revision to rebuild with these features and libass.5.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.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 116084 2014-01-17 21:38:56Z 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.1.3
13revision        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  432380d11ce83708131091cd77417e7eb0f13aa0 \
56                sha256  1d332e7fd35f87e1ffb6c9b0405cbfda085ef712ede0133a213793a4e66d13a3
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                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        --disable-indev=jack \
123        --disable-outdev=xv \
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
139test.run        yes
140
141#
142# configure isn't autoconf and they do use a dep cache
143#
144
145post-destroot {
146    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
147    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
148    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
149    foreach f [glob ${worksrcpath}/doc/*.txt] {
150        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
151    }
152}
153
154platform powerpc {
155    # absence of altivec is not automatically detected
156    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
157        configure.args-append --disable-altivec
158    }
159}
160
161platform darwin 8 {
162    post-patch {
163        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
164    }
165}
166
167configure.universal_args-delete --disable-dependency-tracking
168
169if {[variant_isset universal]} {
170    foreach arch ${configure.universal_archs} {
171        set merger_host($arch) ""
172        lappend merger_configure_args($arch) --arch=${arch}
173        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
174    }
175    if {[string match "*86*" ${configure.universal_archs}]} {
176        depends_build-append port:yasm
177    }
178    lappend merger_configure_args(i386) --enable-yasm
179    lappend merger_configure_args(x86_64) --enable-yasm
180} else {
181    configure.args-append --arch=${configure.build_arch}
182    configure.env-append  ASFLAGS='[get_canonical_archflags]'
183    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
184        depends_build-append port:yasm
185        configure.args-append --enable-yasm
186    }
187}
188
189variant libdc1394 description {Enable IIDC-1394 frame grabbing using libdc1394 (experimental)} {
190    depends_lib-append port:libdc1394
191    configure.args-append --enable-libdc1394
192}
193
194variant gpl2 description {Enable GPL code, license will be GPL-2+} {
195    configure.args-append   --enable-gpl \
196                            --enable-postproc \
197                            --enable-libx264 \
198                            --enable-libxvid
199    depends_lib-append      port:XviD \
200                            port:x264
201    license-delete          LGPL-2.1+
202    license-append          GPL-2+
203}
204
205variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
206    configure.args-delete   --disable-libopencore-amrnb \
207                            --disable-libopencore-amrwb
208    configure.args-append   --enable-version3 \
209                            --enable-libopencore-amrnb \
210                            --enable-libopencore-amrwb
211    depends_lib-append      port:opencore-amr
212    license-delete          LGPL-2.1+
213    license-append          GPL-3+
214}
215
216
217# the build server uses the default variants, and we want distributable binaries
218# nonfree code is disabled by default but can be enabled using the +nonfree variant
219
220variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
221    configure.args-append   --enable-nonfree \
222                            --enable-libfaac
223    depends_lib-append      port:faac
224    license-delete          LGPL-2.1+
225    license-append          Restrictive
226}
227
228if {[variant_isset nonfree]} {
229notes "
230*******
231******* This build of ${name} includes nonfree code as follows:
232*******
233*******     libfaac
234*******
235******* The following libraries and binaries may not be redistributed:
236*******
237*******     ffmpeg
238*******     libavcodec
239*******     libavdevice
240*******     libavfilter
241*******     libavformat
242*******     libavutil
243*******
244******* To remove this restriction remove the variant +nonfree
245*******
246"
247} elseif {[variant_isset gpl3]} {
248notes "
249*******
250******* This build of ${name} includes GPLed code and
251******* is therefore licensed under GPL v3 or later.
252*******
253******* The following modules are GPLed:
254*******
255*******      postproc
256*******      libx264
257*******      libxvid
258*******      opencore-amr
259*******
260******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
261******* To remove nonfree and GPLed code leaving only LGPL code remove the
262******* +gpl2 and +gpl3 variants.
263*******
264"
265} elseif {[variant_isset gpl2]} {
266notes "
267*******
268******* This build of ${name} includes GPLed code and
269******* is therefore licensed under GPL v2 or later.
270*******
271******* The following modules are GPLed:
272*******
273*******      postproc
274*******      libx264
275*******      libxvid
276*******
277******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
278******* To remove nonfree and GPLed code leaving only LGPL code remove the
279******* +gpl2 variant.
280*******
281"
282} else {
283notes "
284*******
285******* This build of ${name} includes no GPLed or nonfree
286******* code and is therefore licensed under LGPL v2.1 or later.
287*******
288"
289}
290
291livecheck.type  regex
292livecheck.url   ${master_sites}
293livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.