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

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

ffmpeg: explicitly disable use of opencore-amr (#33502)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.4 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 96090 2012-07-31 14:20:00Z jmr@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.13
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       sha256  c9450705aba65dce8c02dcbb80a307ba182eeddc752333a7f42dd81fe78c0964 \
55                rmd160  507acb8467784d045e0ba3720822243826d054c1
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# And similarly, disable mmx on Tiger
88platform darwin {
89    if {${os.major} < 9} {
90        default_variants -mmx
91    } else {
92        default_variants +mmx
93    }
94}
95
96# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used.
97# This is fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
98if {${configure.compiler} == "llvm-gcc-4.2"} {
99    configure.compiler clang
100}
101
102# Newer clang hit https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
103if {${configure.compiler} == "clang" && [vercmp ${xcodeversion} 4.1] >= 0 && [lsearch [get_canonical_archs] i386] != -1} {
104    depends_build-append port:clang-3.0
105    depends_skip_archcheck-append clang-3.0
106
107    configure.compiler macports-clang-3.0
108}
109
110configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
111configure.args \
112        --enable-gpl \
113        --enable-postproc \
114        --enable-swscale --enable-avfilter \
115        --enable-libmp3lame \
116        --enable-libvorbis \
117        --enable-libtheora \
118        --enable-libdirac --enable-libschroedinger \
119        --enable-libopenjpeg \
120        --enable-libxvid \
121        --enable-libx264 \
122        --enable-libvpx \
123        --enable-libspeex \
124        --disable-libopencore-amrnb \
125        --disable-libopencore-amrwb \
126        --disable-mmx \
127        --disable-mmx2 \
128        --disable-sse \
129        --disable-ssse3 \
130        --disable-amd3dnow \
131        --disable-amd3dnowext \
132        --mandir=${prefix}/share/man \
133        --enable-shared --enable-pthreads \
134        --cc=${configure.cc}
135
136test.run        yes
137
138#
139# configure isn't autoconf and they do use a dep cache
140#
141
142post-destroot {
143    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
144    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
145    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
146    foreach f [glob ${worksrcpath}/doc/*.txt] {
147        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
148    }
149}
150
151platform powerpc {
152    # absence of altivec is not automatically detected
153    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
154        configure.args-append --disable-altivec
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 mmx description {enable all supported x86 asm optimizations} {
181    configure.args-delete --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
182}
183
184variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
185    configure.args-delete   --enable-gpl \
186                            --enable-postproc \
187                            --enable-libx264 \
188                            --enable-libxvid
189    depends_lib-delete      port:XviD \
190                            port:x264
191    license-delete          GPL-2+
192    license-append          LGPL-2.1+
193}
194
195# the build server uses the default variants, and we want distributable binaries
196# nonfree code is disabled by default but can be enabled using the +nonfree variant
197
198variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
199    configure.args-append   --enable-nonfree \
200                            --enable-libfaac
201    depends_lib-append      port:faac
202    license-delete          GPL-2+
203    license-append          Restrictive
204}
205
206if {[variant_isset nonfree]} {
207notes "
208*******
209******* This build of ${name} includes nonfree code as follows:
210*******
211*******     libfaac
212*******
213******* The following libraries and binaries may not be redistributed:
214*******
215*******     ffmpeg
216*******     libavcodec
217*******     libavdevice
218*******     libavfilter
219*******     libavformat
220*******     libavutil
221*******
222******* To remove this restriction remove the variant +nonfree
223*******
224"
225} elseif {![variant_isset no_gpl]} {
226notes "
227*******
228******* This build of ${name} includes GPLed code and
229******* is therefore licensed under GPL v2 or later.
230*******
231******* The following modules are GPLed:
232*******
233*******      postproc
234*******      libx264
235*******      libxvid
236*******
237******* To include all nonfree, GPLed and LGPL code use variant +nonfree
238******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
239*******
240"
241} else {
242notes "
243*******
244******* This build of ${name} includes no GPLed or nonfree
245******* code and is therefore licensed under LGPL v2.1 or later.
246*******
247"
248}
249
250livecheck.type  regex
251livecheck.url   ${master_sites}
252livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.