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

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

ffmpeg: update to version 1.2.2.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.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 108649 2013-07-29 15:25:18Z 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         1.2.2
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  102edda2a14b234fe78605eccd2be88389c2821b \
56                sha256  1cb29ec4951f5941ea43638ea1e3042e3d3215992bda03f45628e8c49cb21064
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    # https://trac.macports.org/ticket/37802
97    compiler.blacklist-append llvm-gcc-4.2 macports-llvm-gcc-4.2
98}
99
100# TODO: base should do this: http://trac.macports.org/ticket/32542
101if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
102    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
103
104    # base 2.1.x ignores the argument and just use ${configure.compiler}
105    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
106        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
107    }
108
109    if {[string match macports-gcc* ${configure.compiler}]} {
110        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
111    }
112}
113
114# And similarly, disable asm on Tiger
115# libblueray doesn't build on Tiger so disable for now (#39442)
116platform darwin {
117    if {${os.major} < 9} {
118        depends_lib-delete    port:libbluray
119        configure.args-delete --enable-libbluray
120        configure.args-append --disable-asm
121    }
122}
123
124# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
125# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
126default_variants-append +gpl2
127
128configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
129configure.args \
130        --enable-swscale --enable-avfilter \
131        --enable-libmp3lame \
132        --enable-libvorbis \
133        --enable-libopus \
134        --enable-libtheora \
135        --enable-libschroedinger \
136        --enable-libopenjpeg \
137        --enable-libmodplug \
138        --enable-libvpx \
139        --enable-libspeex \
140        --enable-libass \
141        --enable-libbluray \
142        --enable-gnutls \
143        --enable-libfreetype \
144        --mandir=${prefix}/share/man \
145        --enable-shared --enable-pthreads \
146        --cc=${configure.cc}
147
148test.run        yes
149
150#
151# configure isn't autoconf and they do use a dep cache
152#
153
154post-destroot {
155    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
156    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
157    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
158    foreach f [glob ${worksrcpath}/doc/*.txt] {
159        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
160    }
161}
162
163platform powerpc {
164    # absence of altivec is not automatically detected
165    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
166        configure.args-append --disable-altivec
167    }
168}
169
170platform darwin 8 {
171    post-patch {
172        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
173    }
174}
175
176configure.universal_args-delete --disable-dependency-tracking
177
178if {[variant_isset universal]} {
179    foreach arch ${configure.universal_archs} {
180        set merger_host($arch) ""
181        lappend merger_configure_args($arch) --arch=${arch}
182        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
183    }
184    if {[string match "*86*" ${configure.universal_archs}]} {
185        depends_build-append port:yasm
186    }
187    lappend merger_configure_args(i386) --enable-yasm
188    lappend merger_configure_args(x86_64) --enable-yasm
189} else {
190    configure.args-append --arch=${configure.build_arch}
191    configure.env-append  ASFLAGS='[get_canonical_archflags]'
192    if {$build_arch == "i386" || $build_arch == "x86_64"} {
193        depends_build-append port:yasm
194        configure.args-append --enable-yasm
195    }
196}
197
198variant gpl2 description {Enable GPL code, license will be GPL-2+} {
199    configure.args-append   --enable-gpl \
200                            --enable-postproc \
201                            --enable-libx264 \
202                            --enable-libxvid
203    depends_lib-append      port:XviD \
204                            port:x264
205    license-delete          LGPL-2.1+
206    license-append          GPL-2+
207}
208
209variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
210    configure.args-delete   --disable-libopencore-amrnb \
211                            --disable-libopencore-amrwb
212    configure.args-append   --enable-version3 \
213                            --enable-libopencore-amrnb \
214                            --enable-libopencore-amrwb
215    depends_lib-append      port:opencore-amr
216    license-delete          LGPL-2.1+
217    license-append          GPL-3+
218}
219
220
221# the build server uses the default variants, and we want distributable binaries
222# nonfree code is disabled by default but can be enabled using the +nonfree variant
223
224variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
225    configure.args-append   --enable-nonfree \
226                            --enable-libfaac
227    depends_lib-append      port:faac
228    license-delete          LGPL-2.1+
229    license-append          Restrictive
230}
231
232if {[variant_isset nonfree]} {
233notes "
234*******
235******* This build of ${name} includes nonfree code as follows:
236*******
237*******     libfaac
238*******
239******* The following libraries and binaries may not be redistributed:
240*******
241*******     ffmpeg
242*******     libavcodec
243*******     libavdevice
244*******     libavfilter
245*******     libavformat
246*******     libavutil
247*******
248******* To remove this restriction remove the variant +nonfree
249*******
250"
251} elseif {[variant_isset gpl3]} {
252notes "
253*******
254******* This build of ${name} includes GPLed code and
255******* is therefore licensed under GPL v3 or later.
256*******
257******* The following modules are GPLed:
258*******
259*******      postproc
260*******      libx264
261*******      libxvid
262*******      opencore-amr
263*******
264******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
265******* To remove nonfree and GPLed code leaving only LGPL code remove the
266******* +gpl2 and +gpl3 variants.
267*******
268"
269} elseif {[variant_isset gpl2]} {
270notes "
271*******
272******* This build of ${name} includes GPLed code and
273******* is therefore licensed under GPL v2 or later.
274*******
275******* The following modules are GPLed:
276*******
277*******      postproc
278*******      libx264
279*******      libxvid
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 variant.
284*******
285"
286} else {
287notes "
288*******
289******* This build of ${name} includes no GPLed or nonfree
290******* code and is therefore licensed under LGPL v2.1 or later.
291*******
292"
293}
294
295livecheck.type  regex
296livecheck.url   ${master_sites}
297livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.