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

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

ffmpeg: update to version 2.0.1, disable xv outdev.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.3 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 111494 2013-09-24 00:30:40Z 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.0.1
13set branch      [join [lrange [split ${version} .] 0 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  e1e5cfe9417b40833a5234b521ebe9c8b8e89cd9 \
56                sha256  611eae7e3485d5fd9ff03e0ac7575ea89bc8105e40e99a40de02324957482f95
57
58depends_build   port:pkgconfig \
59                port:gmake \
60                port:texi2html
61
62depends_lib     port:lame \
63                port:libvorbis \
64                port:libopus \
65                port:libogg \
66                port:libtheora \
67                port:libmodplug \
68                port:jack \
69                port:dirac \
70                port:schroedinger \
71                port:libass \
72                port:libbluray \
73                port:gnutls \
74                port:openjpeg15 \
75                port:freetype \
76                path:lib/libspeex.dylib:speex \
77                port:libvpx \
78                path:lib/pkgconfig/sdl.pc:libsdl \
79                port:bzip2 \
80                port:zlib
81
82build.cmd       ${prefix}/bin/gmake
83build.env-append V=1
84
85#
86# enable auto configure of asm optimizations
87# requires Xcode 3.1 or better on Leopard
88#
89minimum_xcodeversions {9 3.1}
90
91if {[lsearch [get_canonical_archs] i386] != -1} {
92    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
93    # clang-139 hits https://trac.macports.org/ticket/38141
94    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
95}
96
97# And similarly, disable asm on Tiger
98# libblueray doesn't build on Tiger so disable for now (#39442)
99platform darwin {
100    if {${os.major} < 9} {
101        depends_lib-delete    port:libbluray
102        configure.args-delete --enable-libbluray
103        configure.args-append --disable-asm
104    }
105}
106
107# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
108# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
109default_variants-append +gpl2
110
111configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
112configure.args \
113        --enable-swscale --enable-avfilter \
114        --enable-libmp3lame \
115        --enable-libvorbis \
116        --enable-libopus \
117        --enable-libtheora \
118        --enable-libschroedinger \
119        --enable-libopenjpeg \
120        --enable-libmodplug \
121        --enable-libvpx \
122        --enable-libspeex \
123        --enable-libass \
124        --enable-libbluray \
125        --enable-gnutls \
126        --enable-libfreetype \
127        --disable-outdev=xv \
128        --mandir=${prefix}/share/man \
129        --enable-shared --enable-pthreads \
130        --cc=${configure.cc}
131
132test.run        yes
133
134#
135# configure isn't autoconf and they do use a dep cache
136#
137
138post-destroot {
139    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
140    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
141    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
142    foreach f [glob ${worksrcpath}/doc/*.txt] {
143        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
144    }
145}
146
147platform powerpc {
148    # absence of altivec is not automatically detected
149    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
150        configure.args-append --disable-altivec
151    }
152}
153
154platform darwin 8 {
155    post-patch {
156        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
157    }
158}
159
160configure.universal_args-delete --disable-dependency-tracking
161
162if {[variant_isset universal]} {
163    foreach arch ${configure.universal_archs} {
164        set merger_host($arch) ""
165        lappend merger_configure_args($arch) --arch=${arch}
166        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
167    }
168    if {[string match "*86*" ${configure.universal_archs}]} {
169        depends_build-append port:yasm
170    }
171    lappend merger_configure_args(i386) --enable-yasm
172    lappend merger_configure_args(x86_64) --enable-yasm
173} else {
174    configure.args-append --arch=${configure.build_arch}
175    configure.env-append  ASFLAGS='[get_canonical_archflags]'
176    if {$build_arch == "i386" || $build_arch == "x86_64"} {
177        depends_build-append port:yasm
178        configure.args-append --enable-yasm
179    }
180}
181
182variant gpl2 description {Enable GPL code, license will be GPL-2+} {
183    configure.args-append   --enable-gpl \
184                            --enable-postproc \
185                            --enable-libx264 \
186                            --enable-libxvid
187    depends_lib-append      port:XviD \
188                            port:x264
189    license-delete          LGPL-2.1+
190    license-append          GPL-2+
191}
192
193variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
194    configure.args-delete   --disable-libopencore-amrnb \
195                            --disable-libopencore-amrwb
196    configure.args-append   --enable-version3 \
197                            --enable-libopencore-amrnb \
198                            --enable-libopencore-amrwb
199    depends_lib-append      port:opencore-amr
200    license-delete          LGPL-2.1+
201    license-append          GPL-3+
202}
203
204
205# the build server uses the default variants, and we want distributable binaries
206# nonfree code is disabled by default but can be enabled using the +nonfree variant
207
208variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
209    configure.args-append   --enable-nonfree \
210                            --enable-libfaac
211    depends_lib-append      port:faac
212    license-delete          LGPL-2.1+
213    license-append          Restrictive
214}
215
216if {[variant_isset nonfree]} {
217notes "
218*******
219******* This build of ${name} includes nonfree code as follows:
220*******
221*******     libfaac
222*******
223******* The following libraries and binaries may not be redistributed:
224*******
225*******     ffmpeg
226*******     libavcodec
227*******     libavdevice
228*******     libavfilter
229*******     libavformat
230*******     libavutil
231*******
232******* To remove this restriction remove the variant +nonfree
233*******
234"
235} elseif {[variant_isset gpl3]} {
236notes "
237*******
238******* This build of ${name} includes GPLed code and
239******* is therefore licensed under GPL v3 or later.
240*******
241******* The following modules are GPLed:
242*******
243*******      postproc
244*******      libx264
245*******      libxvid
246*******      opencore-amr
247*******
248******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
249******* To remove nonfree and GPLed code leaving only LGPL code remove the
250******* +gpl2 and +gpl3 variants.
251*******
252"
253} elseif {[variant_isset gpl2]} {
254notes "
255*******
256******* This build of ${name} includes GPLed code and
257******* is therefore licensed under GPL v2 or later.
258*******
259******* The following modules are GPLed:
260*******
261*******      postproc
262*******      libx264
263*******      libxvid
264*******
265******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
266******* To remove nonfree and GPLed code leaving only LGPL code remove the
267******* +gpl2 variant.
268*******
269"
270} else {
271notes "
272*******
273******* This build of ${name} includes no GPLed or nonfree
274******* code and is therefore licensed under LGPL v2.1 or later.
275*******
276"
277}
278
279livecheck.type  regex
280livecheck.url   ${master_sites}
281livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.