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

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

ffmpeg: update to version 0.7.13.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.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 96021 2012-07-29 02:04:43Z devans@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmpeg
9conflicts       ffmpeg-devel
10epoch           1
11version         0.7.13
12set branch      [join [lrange [split ${version} .] 0 1] .]
13license         GPL-2+
14categories      multimedia
15maintainers     devans 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 developped) \
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                        developped from scratch to ensure best performances \
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       sha256  c9450705aba65dce8c02dcbb80a307ba182eeddc752333a7f42dd81fe78c0964 \
55                rmd160  507acb8467784d045e0ba3720822243826d054c1
56
57depends_build   port:pkgconfig \
58                port:gmake \
59                port:texi2html
60
61depends_lib     port:lame \
62                port:libvorbis \
63                port:libogg \
64                port:libtheora \
65                port:dirac \
66                port:schroedinger \
67                port:openjpeg \
68                path:lib/libspeex.dylib:speex \
69                port:XviD \
70                port:x264 \
71                port:libvpx \
72                path:lib/pkgconfig/sdl.pc:libsdl \
73                port:bzip2 \
74                port:zlib
75
76patchfiles      patch-configure.diff
77
78build.cmd       ${prefix}/bin/gmake
79build.env-append V=1
80
81#
82# enable auto configure of mmx and related Intel optimizations by default
83# requires Xcode 3.1 or better on Leopard
84#
85minimum_xcodeversions {9 3.1}
86
87# And similarly, disable mmx on Tiger
88platform darwin {
89    if {${os.major} < 9} {
90        default_variants -mmx
91    } else {
92        default_variants +mmx
93    }
94}
95
96# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used.
97# This is fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
98if {${configure.compiler} == "llvm-gcc-4.2"} {
99    configure.compiler clang
100}
101
102# Newer clang hit https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
103if {${configure.compiler} == "clang" && [vercmp ${xcodeversion} 4.1] >= 0 && [lsearch [get_canonical_archs] i386] != -1} {
104    depends_build-append port:clang-3.0
105    depends_skip_archcheck-append clang-3.0
106
107    configure.compiler macports-clang-3.0
108}
109
110configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
111configure.args \
112        --enable-gpl \
113        --enable-postproc \
114        --enable-swscale --enable-avfilter \
115        --enable-libmp3lame \
116        --enable-libvorbis \
117        --enable-libtheora \
118        --enable-libdirac --enable-libschroedinger \
119        --enable-libopenjpeg \
120        --enable-libxvid \
121        --enable-libx264 \
122        --enable-libvpx \
123        --enable-libspeex \
124        --disable-mmx \
125        --disable-mmx2 \
126        --disable-sse \
127        --disable-ssse3 \
128        --disable-amd3dnow \
129        --disable-amd3dnowext \
130        --mandir=${prefix}/share/man \
131        --enable-shared --enable-pthreads \
132        --cc=${configure.cc}
133
134test.run        yes
135
136#
137# configure isn't autoconf and they do use a dep cache
138#
139
140post-destroot {
141    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
142    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
143    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
144    foreach f [glob ${worksrcpath}/doc/*.txt] {
145        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
146    }
147}
148
149platform powerpc {
150    # absence of altivec is not automatically detected
151    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
152        configure.args-append --disable-altivec
153    }
154}
155
156configure.universal_args-delete --disable-dependency-tracking
157
158if {[variant_isset universal]} {
159    foreach arch ${configure.universal_archs} {
160        set merger_host($arch) ""
161        lappend merger_configure_args($arch) --arch=${arch}
162        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
163    }
164    if {[string match "*86*" ${configure.universal_archs}]} {
165        depends_build-append port:yasm
166    }
167    lappend merger_configure_args(i386) --enable-yasm
168    lappend merger_configure_args(x86_64) --enable-yasm
169} else {
170    configure.args-append --arch=${configure.build_arch}
171    configure.env-append  ASFLAGS='[get_canonical_archflags]'
172    if {$build_arch == "i386" || $build_arch == "x86_64"} {
173        depends_build-append port:yasm
174        configure.args-append --enable-yasm
175    }
176}
177
178variant mmx description {enable all supported x86 asm optimizations} {
179    configure.args-delete --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
180}
181
182variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
183    configure.args-delete   --enable-gpl \
184                            --enable-postproc \
185                            --enable-libx264 \
186                            --enable-libxvid
187    depends_lib-delete      port:XviD \
188                            port:x264
189    license-delete          GPL-2+
190    license-append          LGPL-2.1+
191}
192
193# the build server uses the default variants, and we want distributable binaries
194# nonfree code is disabled by default but can be enabled using the +nonfree variant
195
196variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
197    configure.args-append   --enable-nonfree \
198                            --enable-libfaac
199    depends_lib-append      port:faac
200    license-delete          GPL-2+
201    license-append          Restrictive
202}
203
204if {[variant_isset nonfree]} {
205notes "
206*******
207******* This build of ${name} includes nonfree code as follows:
208*******
209*******     libfaac
210*******
211******* The following libraries and binaries may not be redistributed:
212*******
213*******     ffmpeg
214*******     libavcodec
215*******     libavdevice
216*******     libavfilter
217*******     libavformat
218*******     libavutil
219*******
220******* To remove this restriction remove the variant +nonfree
221*******
222"
223} elseif {![variant_isset no_gpl]} {
224notes "
225*******
226******* This build of ${name} includes GPLed code and
227******* is therefore licensed under GPL v2 or later.
228*******
229******* The following modules are GPLed:
230*******
231*******      postproc
232*******      libx264
233*******      libxvid
234*******
235******* To include all nonfree, GPLed and LGPL code use variant +nonfree
236******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
237*******
238"
239} else {
240notes "
241*******
242******* This build of ${name} includes no GPLed or nonfree
243******* code and is therefore licensed under LGPL v2.1 or later.
244*******
245"
246}
247
248livecheck.type  regex
249livecheck.url   ${master_sites}
250livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.