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

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

ffmpeg: update to version 0.7.5.

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