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

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

ffmpeg: update to version 1.2.1.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.7 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 106125 2013-05-15 20:15:10Z 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.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  bbccff41da7fb5731051b5bd4ececc41ed1d5749 \
56                sha256  0302375c3a64e9c2facfa7cbeb1aa333a39fdf6bbacda228cd48e04bf9ee32ca
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:openjpeg \
72                port:freetype \
73                path:lib/libspeex.dylib:speex \
74                port:libvpx \
75                path:lib/pkgconfig/sdl.pc:libsdl \
76                port:bzip2 \
77                port:zlib
78
79build.cmd       ${prefix}/bin/gmake
80build.env-append V=1
81
82#
83# enable auto configure of asm optimizations
84# requires Xcode 3.1 or better on Leopard
85#
86minimum_xcodeversions {9 3.1}
87
88if {[lsearch [get_canonical_archs] i386] != -1} {
89    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
90    # clang-139 hits https://trac.macports.org/ticket/38141
91    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
92
93    # https://trac.macports.org/ticket/37802
94    compiler.blacklist-append llvm-gcc-4.2 macports-llvm-gcc-4.2
95}
96
97# TODO: base should do this: http://trac.macports.org/ticket/32542
98if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
99    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
100
101    # base 2.1.x ignores the argument and just use ${configure.compiler}
102    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
103        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
104    }
105
106    if {[string match macports-gcc* ${configure.compiler}]} {
107        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
108    }
109}
110
111# And similarly, disable asm on Tiger
112platform darwin {
113    if {${os.major} < 9} {
114        configure.args-append --disable-asm
115    }
116}
117
118# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
119# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
120default_variants-append +gpl2
121
122configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
123configure.args \
124        --enable-swscale --enable-avfilter \
125        --enable-libmp3lame \
126        --enable-libvorbis \
127        --enable-libopus \
128        --enable-libtheora \
129        --enable-libschroedinger \
130        --enable-libopenjpeg \
131        --enable-libmodplug \
132        --enable-libvpx \
133        --enable-libspeex \
134        --enable-libfreetype \
135        --mandir=${prefix}/share/man \
136        --enable-shared --enable-pthreads \
137        --cc=${configure.cc}
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 == "i386" || $build_arch == "x86_64"} {
184        depends_build-append port:yasm
185        configure.args-append --enable-yasm
186    }
187}
188
189variant gpl2 description {Enable GPL code, license will be GPL-2+} {
190    configure.args-append   --enable-gpl \
191                            --enable-postproc \
192                            --enable-libx264 \
193                            --enable-libxvid
194    depends_lib-append      port:XviD \
195                            port:x264
196    license-delete          LGPL-2.1+
197    license-append          GPL-2+
198}
199
200variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
201    configure.args-delete   --disable-libopencore-amrnb \
202                            --disable-libopencore-amrwb
203    configure.args-append   --enable-version3 \
204                            --enable-libopencore-amrnb \
205                            --enable-libopencore-amrwb
206    depends_lib-append      port:opencore-amr
207    license-delete          LGPL-2.1+
208    license-append          GPL-3+
209}
210
211
212# the build server uses the default variants, and we want distributable binaries
213# nonfree code is disabled by default but can be enabled using the +nonfree variant
214
215variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
216    configure.args-append   --enable-nonfree \
217                            --enable-libfaac
218    depends_lib-append      port:faac
219    license-delete          LGPL-2.1+
220    license-append          Restrictive
221}
222
223if {[variant_isset nonfree]} {
224notes "
225*******
226******* This build of ${name} includes nonfree code as follows:
227*******
228*******     libfaac
229*******
230******* The following libraries and binaries may not be redistributed:
231*******
232*******     ffmpeg
233*******     libavcodec
234*******     libavdevice
235*******     libavfilter
236*******     libavformat
237*******     libavutil
238*******
239******* To remove this restriction remove the variant +nonfree
240*******
241"
242} elseif {[variant_isset gpl3]} {
243notes "
244*******
245******* This build of ${name} includes GPLed code and
246******* is therefore licensed under GPL v3 or later.
247*******
248******* The following modules are GPLed:
249*******
250*******      postproc
251*******      libx264
252*******      libxvid
253*******      opencore-amr
254*******
255******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
256******* To remove nonfree and GPLed code leaving only LGPL code remove the
257******* +gpl2 and +gpl3 variants.
258*******
259"
260} elseif {[variant_isset gpl2]} {
261notes "
262*******
263******* This build of ${name} includes GPLed code and
264******* is therefore licensed under GPL v2 or later.
265*******
266******* The following modules are GPLed:
267*******
268*******      postproc
269*******      libx264
270*******      libxvid
271*******
272******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
273******* To remove nonfree and GPLed code leaving only LGPL code remove the
274******* +gpl2 variant.
275*******
276"
277} else {
278notes "
279*******
280******* This build of ${name} includes no GPLed or nonfree
281******* code and is therefore licensed under LGPL v2.1 or later.
282*******
283"
284}
285
286livecheck.type  regex
287livecheck.url   ${master_sites}
288livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.