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

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

ffmpeg: Don't use buggy clang for i386 (#30137)

  • 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 93718 2012-05-29 03:16:05Z jeremyhu@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.11
12revision        1
13set branch      [join [lrange [split ${version} .] 0 1] .]
14license         GPL-2+
15categories      multimedia
16maintainers     devans openmaintainer
17
18description     FFmpeg is a complete solution to play, record, convert and \
19                stream audio and video.
20
21long_description        FFmpeg is a complete solution to record, convert and \
22                        stream audio and video. It includes libavcodec, the \
23                        leading audio/video codec library. \
24                        \
25                        The project is made of several components: \
26                        \
27                        ffmpeg is a command line tool to convert one video \
28                        file format to another. It also supports grabbing and \
29                        encoding in real time from a TV card. \
30                        \
31                        ffserver is an HTTP (RTSP is being developped) \
32                        multimedia streaming server for live broadcasts. Time \
33                        shifting of live broadcast is also supported. \
34                        \
35                        ffplay is a simple media player based on SDL and on \
36                        the ffmpeg libraries. \
37                        \
38                        ffprobe gathers information from multimedia streams and \
39                        prints it in human- and machine-readable fashion. \
40                        \
41                        libavcodec is a library containing all the ffmpeg \
42                        audio/video encoders and decoders. Most codecs were \
43                        developped from scratch to ensure best performances \
44                        and high code reusability. \
45                        \
46                        libavformat is a library containing parsers and \
47                        generators for all common audio/video formats.
48
49platforms       darwin
50homepage        http://www.ffmpeg.org/
51master_sites    http://www.ffmpeg.org/releases/
52
53use_bzip2       yes
54
55checksums       sha1    32f78f8990077dc045a52450c2ca2535eb6c7317 \
56                rmd160  5e9a7ba857c4d4542bc1631981959ab91a2a73d1
57
58depends_build   port:pkgconfig \
59                port:gmake \
60                port:texi2html
61
62depends_lib     port:lame \
63                port:libvorbis \
64                port:libogg \
65                port:libtheora \
66                port:dirac \
67                port:schroedinger \
68                port:openjpeg \
69                path:lib/libspeex.dylib:speex \
70                port:XviD \
71                port:x264 \
72                port:libvpx \
73                path:lib/pkgconfig/sdl.pc:libsdl \
74                port:bzip2 \
75                port:zlib
76
77patchfiles      patch-configure.diff
78
79build.cmd       ${prefix}/bin/gmake
80build.env-append V=1
81
82variant universal {}
83
84#
85# enable auto configure of mmx and related Intel optimizations by default
86# requires Xcode 3.1 or better on Leopard
87#
88minimum_xcodeversions {9 3.1}
89
90# And similarly, disable mmx on Tiger
91platform darwin {
92    if {${os.major} < 9} {
93        default_variants -mmx
94    } else {
95        default_variants +mmx
96    }
97}
98
99# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used.
100# This is fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
101if {${configure.compiler} == "llvm-gcc-4.2"} {
102    configure.compiler clang
103}
104
105# Newer clang hit https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
106if {${configure.compiler} == "clang" && [vercmp ${xcodeversion} 4.1] >= 0 && [lsearch [get_canonical_archs] i386] != -1} {
107    depends_build-append port:clang-3.0
108    depends_skip_archcheck-append clang-3.0
109
110    configure.compiler macports-clang-3.0
111}
112
113configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
114configure.args \
115        --enable-gpl \
116        --enable-postproc \
117        --enable-swscale --enable-avfilter \
118        --enable-libmp3lame \
119        --enable-libvorbis \
120        --enable-libtheora \
121        --enable-libdirac --enable-libschroedinger \
122        --enable-libopenjpeg \
123        --enable-libxvid \
124        --enable-libx264 \
125        --enable-libvpx \
126        --enable-libspeex \
127        --disable-mmx \
128        --disable-mmx2 \
129        --disable-sse \
130        --disable-ssse3 \
131        --disable-amd3dnow \
132        --disable-amd3dnowext \
133        --mandir=${prefix}/share/man \
134        --enable-shared --enable-pthreads \
135        --cc=${configure.cc}
136
137test.run        yes
138
139#
140# configure isn't autoconf and they do use a dep cache
141#
142
143post-destroot {
144    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
145    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
146    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
147    foreach f [glob ${worksrcpath}/doc/*.txt] {
148        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
149    }
150}
151
152platform powerpc {
153    # absence of altivec is not automatically detected
154    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
155        configure.args-append --disable-altivec
156    }
157}
158
159configure.universal_args-delete --disable-dependency-tracking
160
161if {[variant_isset universal]} {
162    foreach arch ${configure.universal_archs} {
163        set merger_host($arch) ""
164        lappend merger_configure_args($arch) --arch=${arch}
165        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
166    }
167    if {[string match "*86*" ${configure.universal_archs}]} {
168        depends_build-append port:yasm
169    }
170    lappend merger_configure_args(i386) --enable-yasm
171    lappend merger_configure_args(x86_64) --enable-yasm
172} else {
173    configure.args-append --arch=${configure.build_arch}
174    configure.env-append  ASFLAGS='[get_canonical_archflags]'
175    if {$build_arch == "i386" || $build_arch == "x86_64"} {
176        depends_build-append port:yasm
177        configure.args-append --enable-yasm
178    }
179}
180
181variant mmx description {enable all supported x86 asm optimizations} {
182    configure.args-delete --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
183}
184
185variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
186    configure.args-delete   --enable-gpl \
187                            --enable-postproc \
188                            --enable-libx264 \
189                            --enable-libxvid
190    depends_lib-delete      port:XviD \
191                            port:x264
192    license-delete          GPL-2+
193    license-append          LGPL-2.1+
194}
195
196# the build server uses the default variants, and we want distributable binaries
197# nonfree code is disabled by default but can be enabled using the +nonfree variant
198
199variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
200    configure.args-append   --enable-nonfree \
201                            --enable-libfaac
202    depends_lib-append      port:faac
203    license-delete          GPL-2+
204    license-append          Restrictive
205}
206
207if {[variant_isset nonfree]} {
208notes "
209*******
210******* This build of ${name} includes nonfree code as follows:
211*******
212*******     libfaac
213*******
214******* The following libraries and binaries may not be redistributed:
215*******
216*******     ffmpeg
217*******     libavcodec
218*******     libavdevice
219*******     libavfilter
220*******     libavformat
221*******     libavutil
222*******
223******* To remove this restriction remove the variant +nonfree
224*******
225"
226} elseif {![variant_isset no_gpl]} {
227notes "
228*******
229******* This build of ${name} includes GPLed code and
230******* is therefore licensed under GPL v2 or later.
231*******
232******* The following modules are GPLed:
233*******
234*******      postproc
235*******      libx264
236*******      libxvid
237*******
238******* To include all nonfree, GPLed and LGPL code use variant +nonfree
239******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
240*******
241"
242} else {
243notes "
244*******
245******* This build of ${name} includes no GPLed or nonfree
246******* code and is therefore licensed under LGPL v2.1 or later.
247*******
248"
249}
250
251livecheck.type  regex
252livecheck.url   ${master_sites}
253livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.