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

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

ffmpeg: Blacklist llvm-gcc-4.2 for i386 (#37802)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.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 102080 2013-01-27 18:49:49Z jeremyhu@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7PortGroup compiler_blacklist_versions 1.0
8
9name            ffmpeg
10conflicts       ffmpeg-devel
11epoch           1
12version         1.0.3
13set branch      [join [lrange [split ${version} .] 0 1] .]
14license         LGPL-2.1+
15categories      multimedia
16maintainers     devans jeremyhu 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 developed) \
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                        developed from scratch to ensure best performance \
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       sha256  a27321f12d3b634d035e031a1e85734139235527c79729a0994c600907551f2a \
56                rmd160  931d0c91fd2d91328e72ba4799f7774a39399733
57
58depends_build   port:pkgconfig \
59                port:gmake \
60                port:texi2html
61
62depends_lib     port:lame \
63                port:libvorbis \
64                port:libopus \
65                port:libogg \
66                port:libtheora \
67                port:libmodplug \
68                port:jack \
69                port:dirac \
70                port:schroedinger \
71                port:openjpeg \
72                port:freetype \
73                path:lib/libspeex.dylib:speex \
74                port:libvpx \
75                path:lib/pkgconfig/sdl.pc:libsdl \
76                port:bzip2 \
77                port:zlib
78
79build.cmd       ${prefix}/bin/gmake
80build.env-append V=1
81
82#
83# enable auto configure of asm optimizations
84# requires Xcode 3.1 or better on Leopard
85#
86minimum_xcodeversions {9 3.1}
87
88if {[lsearch [get_canonical_archs] i386] != -1} {
89    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
90    compiler.blacklist-append {clang >= 163.7.1 < 422.1.7} macports-clang-3.1
91
92    # https://trac.macports.org/ticket/37802
93    compiler.blacklist-append llvm-gcc-4.2 macports-llvm-gcc-4.2
94}
95
96# TODO: base should do this: http://trac.macports.org/ticket/32542
97if {[portconfigure::compiler_is_port ${configure.compiler}]} {
98    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
99    depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
100}
101
102# And similarly, disable asm on Tiger
103platform darwin {
104    if {${os.major} < 9} {
105        configure.args-append --disable-asm
106    }
107}
108
109# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
110# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
111default_variants-append +gpl2
112
113configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
114configure.args \
115        --enable-swscale --enable-avfilter \
116        --enable-libmp3lame \
117        --enable-libvorbis \
118        --enable-libopus \
119        --enable-libtheora \
120        --enable-libschroedinger \
121        --enable-libopenjpeg \
122        --enable-libmodplug \
123        --enable-libvpx \
124        --enable-libspeex \
125        --enable-libfreetype \
126        --mandir=${prefix}/share/man \
127        --enable-shared --enable-pthreads \
128        --cc=${configure.cc}
129
130test.run        yes
131
132#
133# configure isn't autoconf and they do use a dep cache
134#
135
136post-destroot {
137    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
138    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
139    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
140    foreach f [glob ${worksrcpath}/doc/*.txt] {
141        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
142    }
143}
144
145platform powerpc {
146    # absence of altivec is not automatically detected
147    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
148        configure.args-append --disable-altivec
149    }
150}
151
152platform darwin 8 {
153    post-patch {
154        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
155    }
156}
157
158configure.universal_args-delete --disable-dependency-tracking
159
160if {[variant_isset universal]} {
161    foreach arch ${configure.universal_archs} {
162        set merger_host($arch) ""
163        lappend merger_configure_args($arch) --arch=${arch}
164        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
165    }
166    if {[string match "*86*" ${configure.universal_archs}]} {
167        depends_build-append port:yasm
168    }
169    lappend merger_configure_args(i386) --enable-yasm
170    lappend merger_configure_args(x86_64) --enable-yasm
171} else {
172    configure.args-append --arch=${configure.build_arch}
173    configure.env-append  ASFLAGS='[get_canonical_archflags]'
174    if {$build_arch == "i386" || $build_arch == "x86_64"} {
175        depends_build-append port:yasm
176        configure.args-append --enable-yasm
177    }
178}
179
180variant gpl2 description {Enable GPL code, license will be GPL-2+} {
181    configure.args-append   --enable-gpl \
182                            --enable-postproc \
183                            --enable-libx264 \
184                            --enable-libxvid
185    depends_lib-append      port:XviD \
186                            port:x264
187    license-delete          LGPL-2.1+
188    license-append          GPL-2+
189}
190
191variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
192    configure.args-delete   --disable-libopencore-amrnb \
193                            --disable-libopencore-amrwb
194    configure.args-append   --enable-version3 \
195                            --enable-libopencore-amrnb \
196                            --enable-libopencore-amrwb
197    depends_lib-append      port:opencore-amr
198    license-delete          LGPL-2.1+
199    license-append          GPL-3+
200}
201
202
203# the build server uses the default variants, and we want distributable binaries
204# nonfree code is disabled by default but can be enabled using the +nonfree variant
205
206variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
207    configure.args-append   --enable-nonfree \
208                            --enable-libfaac
209    depends_lib-append      port:faac
210    license-delete          LGPL-2.1+
211    license-append          Restrictive
212}
213
214if {[variant_isset nonfree]} {
215notes "
216*******
217******* This build of ${name} includes nonfree code as follows:
218*******
219*******     libfaac
220*******
221******* The following libraries and binaries may not be redistributed:
222*******
223*******     ffmpeg
224*******     libavcodec
225*******     libavdevice
226*******     libavfilter
227*******     libavformat
228*******     libavutil
229*******
230******* To remove this restriction remove the variant +nonfree
231*******
232"
233} elseif {[variant_isset gpl3]} {
234notes "
235*******
236******* This build of ${name} includes GPLed code and
237******* is therefore licensed under GPL v3 or later.
238*******
239******* The following modules are GPLed:
240*******
241*******      postproc
242*******      libx264
243*******      libxvid
244*******      opencore-amr
245*******
246******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
247******* To remove nonfree and GPLed code leaving only LGPL code remove the
248******* +gpl2 and +gpl3 variants.
249*******
250"
251} elseif {[variant_isset gpl2]} {
252notes "
253*******
254******* This build of ${name} includes GPLed code and
255******* is therefore licensed under GPL v2 or later.
256*******
257******* The following modules are GPLed:
258*******
259*******      postproc
260*******      libx264
261*******      libxvid
262*******
263******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
264******* To remove nonfree and GPLed code leaving only LGPL code remove the
265******* +gpl2 variant.
266*******
267"
268} else {
269notes "
270*******
271******* This build of ${name} includes no GPLed or nonfree
272******* code and is therefore licensed under LGPL v2.1 or later.
273*******
274"
275}
276
277livecheck.type  regex
278livecheck.url   ${master_sites}
279livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.