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

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

ffmpeg: fix livecheck.

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