Ticket #25447: Portfile

File Portfile, 6.5 KB (added by ocroquette (Olivier Croquette), 14 years ago)
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 66961 2010-04-26 23:32:44Z devans@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6
7name            ffmpeg
8conflicts       ffmpeg-devel
9epoch           1
10version         0.6
11# revision        2
12categories      multimedia
13maintainers     devans openmaintainer
14
15description     FFmpeg is a complete solution to play, record, convert and \
16                stream audio and video.
17
18long_description        FFmpeg is a complete solution to record, convert and \
19                        stream audio and video. It includes libavcodec, the \
20                        leading audio/video codec library. \
21                        \
22                        The project is made of several components: \
23                        \
24                        ffmpeg is a command line tool to convert one video \
25                        file format to another. It also supports grabbing and \
26                        encoding in real time from a TV card. \
27                        \
28                        ffserver is an HTTP (RTSP is being developped) \
29                        multimedia streaming server for live broadcasts. Time \
30                        shifting of live broadcast is also supported. \
31                        \
32                        ffplay is a simple media player based on SDL and on \
33                        the ffmpeg libraries. \
34                        \
35                        libavcodec is a library containing all the ffmpeg \
36                        audio/video encoders and decoders. Most codecs were \
37                        developped from scratch to ensure best performances \
38                        and high code reusability. \
39                        \
40                        libavformat is a library containing parsers and \
41                        generators for all common audio/video formats.
42
43platforms       darwin
44homepage        http://www.ffmpeg.org/
45master_sites    http://www.ffmpeg.org/releases/
46
47use_bzip2       yes
48
49checksums           md5     d6142a9a5821d6a6262a6edb903faa24 \
50                    sha1    c130e3bc368251b9130ce6eafb44fe8c3993ff5c
51
52use_parallel_build yes
53
54depends_build   port:gmake
55
56depends_lib     port:lame \
57                port:libvorbis \
58                port:libogg \
59                port:libtheora \
60                port:dirac \
61                port:schroedinger \
62                port:faac \
63                port:faad2 \
64                port:XviD \
65                port:x264 \
66                path:lib/pkgconfig/sdl.pc:libsdl \
67                port:bzip2 \
68                port:zlib
69
70build.cmd       gmake
71
72#
73# enable auto configure of mmx and related Intel optimizations by default
74# requires Xcode 3.1 or better on Leopard
75#
76minimum_xcodeversions {9 3.1}
77
78configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
79configure.args \
80        --enable-gpl \
81        --enable-postproc \
82        --enable-swscale --enable-avfilter --enable-avfilter-lavf \
83        --enable-libmp3lame \
84        --enable-libvorbis \
85        --enable-libtheora \
86        --enable-libdirac --enable-libschroedinger \
87        --enable-libfaac \
88        --enable-libfaad \
89        --enable-libxvid \
90        --enable-libx264 \
91        --enable-nonfree \
92        --mandir=${prefix}/share/man \
93        --enable-shared --enable-pthreads \
94        --cc=${configure.cc}
95
96#add --enable-libopenjpeg when problems with openjpeg.h are resolved
97
98if {$build_arch != ""} {
99    configure.args-append --arch=${build_arch}
100}
101
102test.run        yes
103
104#
105# configure isn't autoconf and they do use a dep cache
106#
107
108universal_variant no
109
110post-destroot {
111    file mkdir ${destroot}${prefix}/share/doc/${name}
112    file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
113    foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
114        file copy $f ${destroot}${prefix}/share/doc/${name}
115    }
116}
117
118platform darwin 10 {
119    # ticket #20938 -- disable mmx for 32 bit intel only
120    if { $build_arch == "i386" } {
121        if { ![variant_isset no_gpl] } {
122            configure.args-delete --enable-swscale
123        }
124        if { ![variant_isset no_mmx] } {
125            configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
126        }
127    }
128}
129
130platform powerpc {
131    # absence of altivec is not automatically detected
132    if {[exec sysctl -n hw.vectorunit] == 0} {
133        configure.args-append --disable-altivec
134    }
135}
136
137variant no_mmx description {disable all x86 asm optimizations} {
138    configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
139}
140
141variant no_gpl description {disallow use of GPL code, license will be LGPL} {
142    configure.args-delete   --enable-gpl
143    configure.args-delete   --enable-postproc
144    configure.args-delete   --enable-swscale
145    configure.args-delete   --enable-libfaad
146    depends_lib-delete      port:faad2
147    configure.args-delete   --enable-libx264
148    depends_build-delete      port:x264
149    configure.args-delete   --enable-libxvid
150    depends_lib-delete      port:XviD
151}
152
153#
154# make speex a variant since it requires speex version 1.2
155# which is currently only available via port speex-devel
156# remove variant and make default when 1.2 is available in speex
157#
158
159variant speex description {enable Speex decoding via libspeex} {
160    configure.args-append   --enable-libspeex
161    depends_lib-append      path:lib/libspeex.dylib:speex-devel
162}
163
164pre-configure {
165    if {[variant_isset speex]} {
166        if {![file exists ${prefix}/lib/libspeexdsp.dylib]} {
167            error "
168*******
169******* Variant speex requires port speex-devel but
170******* port speex is active.  Please deactivate port speex
171******* and install/activate port speex-devel then try
172******* again.
173*******
174"
175        }
176    }
177}
178
179post-activate {
180    if {![variant_isset no_gpl]} {
181        ui_msg "
182*******
183******* This build of ${name} includes GPLed code and
184******* is therefore licensed under GPL.
185*******
186******* The following modules are GPLed:
187*******
188*******      postproc
189*******      swscale
190*******      libfaad
191*******      libx264
192*******      libxvid
193*******
194******* To include only LGPLed code use variant +no_gpl
195*******
196"
197    } else {
198        ui_msg "
199*******
200******* This build of ${name} includes no GPLed
201******* code and is therefore licensed under LGPL.
202*******
203"
204    }
205}
206#
207#disable livecheck
208#
209
210livecheck.type  regex
211livecheck.url   ${master_sites}
212livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"