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

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

ffmpeg: update to version 0.7.8.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.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 87501 2011-11-23 22:53:13Z 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.8
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       sha1    df4983c028a61d4bf3baceab3bae535b91b8928a \
55                rmd160  8f69a6bc5caaba4e3d440c2d5dc96a946454a52c
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# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used
88# fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
89#
90# similarly clang fails to build on i386 platforms
91#
92# use code provided by jeremyhu here to use gcc-4.2 instead
93#
94# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
95#
96
97if {${configure.compiler} == "clang" ||
98    ${configure.compiler} == "llvm-gcc-4.2"} {
99    configure.compiler gcc-4.2
100    if {![file executable ${configure.cc}]} {
101        depends_build-append port:apple-gcc42
102        configure.compiler apple-gcc-4.2
103    }
104}
105
106configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
107configure.args \
108        --enable-gpl \
109        --enable-postproc \
110        --enable-swscale --enable-avfilter \
111        --enable-libmp3lame \
112        --enable-libvorbis \
113        --enable-libtheora \
114        --enable-libdirac --enable-libschroedinger \
115        --enable-libopenjpeg \
116        --enable-libxvid \
117        --enable-libx264 \
118        --enable-libvpx \
119        --enable-libspeex \
120        --mandir=${prefix}/share/man \
121        --enable-shared --enable-pthreads \
122        --cc=${configure.cc}
123
124test.run        yes
125
126#
127# configure isn't autoconf and they do use a dep cache
128#
129
130post-destroot {
131    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
132    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
133    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
134    foreach f [glob ${worksrcpath}/doc/*.txt] {
135        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
136    }
137}
138
139platform powerpc {
140    # absence of altivec is not automatically detected
141    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
142        configure.args-append --disable-altivec
143    }
144}
145
146configure.universal_args-delete --disable-dependency-tracking
147
148if {[variant_isset universal]} {
149    foreach arch ${configure.universal_archs} {
150        lappend merger_configure_args($arch) --arch=${arch}
151        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
152    }
153    if {[string match "*86*" ${configure.universal_archs}]} {
154        depends_build-append port:yasm
155    }
156    lappend merger_configure_args(i386) --enable-yasm
157    lappend merger_configure_args(x86_64) --enable-yasm
158} else {
159    configure.args-append --arch=${configure.build_arch}
160    configure.env-append  ASFLAGS='[get_canonical_archflags]'
161    if {$build_arch == "i386" || $build_arch == "x86_64"} {
162        depends_build-append port:yasm
163        configure.args-append --enable-yasm
164    }
165}
166
167variant no_mmx description {disable all x86 asm optimizations} {
168    configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
169}
170
171variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
172    configure.args-delete   --enable-gpl \
173                            --enable-postproc \
174                            --enable-libx264 \
175                            --enable-libxvid
176    depends_lib-delete      port:XviD \
177                            port:x264
178    license-delete          GPL-2+
179    license-append          LGPL-2.1+
180}
181
182# the build server uses the default variants, and we want distributable binaries
183# nonfree code is disabled by default but can be enabled using the +nonfree variant
184
185variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
186    configure.args-append   --enable-nonfree \
187                            --enable-libfaac
188    depends_lib-append      port:faac
189    license-delete          GPL-2+
190    license-append          Restrictive
191}
192
193if {[variant_isset nonfree]} {
194notes "
195*******
196******* This build of ${name} includes nonfree code as follows:
197*******
198*******     libfaac
199*******
200******* The following libraries and binaries may not be redistributed:
201*******
202*******     ffmpeg
203*******     libavcodec
204*******     libavdevice
205*******     libavfilter
206*******     libavformat
207*******     libavutil
208*******
209******* To remove this restriction remove the variant +nonfree
210*******
211"
212} elseif {![variant_isset no_gpl]} {
213notes "
214*******
215******* This build of ${name} includes GPLed code and
216******* is therefore licensed under GPL v2 or later.
217*******
218******* The following modules are GPLed:
219*******
220*******      postproc
221*******      libx264
222*******      libxvid
223*******
224******* To include all nonfree, GPLed and LGPL code use variant +nonfree
225******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
226*******
227"
228} else {
229notes "
230*******
231******* This build of ${name} includes no GPLed or nonfree
232******* code and is therefore licensed under LGPL v2.1 or later.
233*******
234"
235}
236
237livecheck.type  regex
238livecheck.url   ${master_sites}
239livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.