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

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

ffmpeg*: co-maintain ffmpeg, delete --disable configure args when adding --enable args

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.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 96141 2012-08-01 22:25:01Z 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.13
12revision        1
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 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       sha256  c9450705aba65dce8c02dcbb80a307ba182eeddc752333a7f42dd81fe78c0964 \
56                rmd160  507acb8467784d045e0ba3720822243826d054c1
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:libvpx \
71                path:lib/pkgconfig/sdl.pc:libsdl \
72                port:bzip2 \
73                port:zlib
74
75patchfiles      patch-configure.diff
76
77build.cmd       ${prefix}/bin/gmake
78build.env-append V=1
79
80#
81# enable auto configure of mmx and related Intel optimizations by default
82# requires Xcode 3.1 or better on Leopard
83#
84minimum_xcodeversions {9 3.1}
85
86# And similarly, disable mmx on Tiger
87platform darwin {
88    if {${os.major} < 9} {
89        default_variants -mmx
90    } else {
91        default_variants +mmx
92    }
93}
94
95# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used.
96# This is fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
97if {${configure.compiler} == "llvm-gcc-4.2"} {
98    configure.compiler clang
99}
100
101# Newer clang hit https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
102if {${configure.compiler} == "clang" && [vercmp ${xcodeversion} 4.1] >= 0 && [lsearch [get_canonical_archs] i386] != -1} {
103    depends_build-append port:clang-3.0
104    depends_skip_archcheck-append clang-3.0
105
106    configure.compiler macports-clang-3.0
107}
108
109configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
110configure.args \
111        --enable-swscale --enable-avfilter \
112        --enable-libmp3lame \
113        --enable-libvorbis \
114        --enable-libtheora \
115        --enable-libdirac --enable-libschroedinger \
116        --enable-libopenjpeg \
117        --enable-libvpx \
118        --enable-libspeex \
119        --disable-libopencore-amrnb \
120        --disable-libopencore-amrwb \
121        --disable-mmx \
122        --disable-mmx2 \
123        --disable-sse \
124        --disable-ssse3 \
125        --disable-amd3dnow \
126        --disable-amd3dnowext \
127        --mandir=${prefix}/share/man \
128        --enable-shared --enable-pthreads \
129        --cc=${configure.cc}
130
131test.run        yes
132
133#
134# configure isn't autoconf and they do use a dep cache
135#
136
137post-destroot {
138    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
139    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
140    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
141    foreach f [glob ${worksrcpath}/doc/*.txt] {
142        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
143    }
144}
145
146platform powerpc {
147    # absence of altivec is not automatically detected
148    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
149        configure.args-append --disable-altivec
150    }
151}
152
153configure.universal_args-delete --disable-dependency-tracking
154
155if {[variant_isset universal]} {
156    foreach arch ${configure.universal_archs} {
157        set merger_host($arch) ""
158        lappend merger_configure_args($arch) --arch=${arch}
159        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
160    }
161    if {[string match "*86*" ${configure.universal_archs}]} {
162        depends_build-append port:yasm
163    }
164    lappend merger_configure_args(i386) --enable-yasm
165    lappend merger_configure_args(x86_64) --enable-yasm
166} else {
167    configure.args-append --arch=${configure.build_arch}
168    configure.env-append  ASFLAGS='[get_canonical_archflags]'
169    if {$build_arch == "i386" || $build_arch == "x86_64"} {
170        depends_build-append port:yasm
171        configure.args-append --enable-yasm
172    }
173}
174
175variant mmx description {enable all supported x86 asm optimizations} {
176    configure.args-delete --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
177}
178
179variant gpl2 description {Enable GPL code, license will be GPL-2+} {
180    configure.args-append   --enable-gpl \
181                            --enable-postproc \
182                            --enable-libx264 \
183                            --enable-libxvid
184    depends_lib-append      port:XviD \
185                            port:x264
186    license-delete          LGPL-2.1+
187    license-append          GPL-2+
188}
189
190variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
191    configure.args-delete   --disable-libopencore-amrnb \
192                            --disable-libopencore-amrwb
193    configure.args-append   --enable-version3 \
194                            --enable-libopencore-amrnb \
195                            --enable-libopencore-amrwb
196    depends_lib-append      port:opencore-amr
197    license-delete          LGPL-2.1+
198    license-append          GPL-3+
199}
200
201
202# the build server uses the default variants, and we want distributable binaries
203# nonfree code is disabled by default but can be enabled using the +nonfree variant
204
205variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
206    configure.args-append   --enable-nonfree \
207                            --enable-libfaac
208    depends_lib-append      port:faac
209    license-delete          LGPL-2.1+
210    license-append          Restrictive
211}
212
213if {[variant_isset nonfree]} {
214notes "
215*******
216******* This build of ${name} includes nonfree code as follows:
217*******
218*******     libfaac
219*******
220******* The following libraries and binaries may not be redistributed:
221*******
222*******     ffmpeg
223*******     libavcodec
224*******     libavdevice
225*******     libavfilter
226*******     libavformat
227*******     libavutil
228*******
229******* To remove this restriction remove the variant +nonfree
230*******
231"
232} elseif {[variant_isset gpl3]} {
233notes "
234*******
235******* This build of ${name} includes GPLed code and
236******* is therefore licensed under GPL v3 or later.
237*******
238******* The following modules are GPLed:
239*******
240*******      postproc
241*******      libx264
242*******      libxvid
243*******      opencore-amr
244*******
245******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
246******* To remove nonfree and GPLed code leaving only LGPL code remove the
247******* +gpl2 and +gpl3 variants.
248*******
249"
250} elseif {[variant_isset gpl2]} {
251notes "
252*******
253******* This build of ${name} includes GPLed code and
254******* is therefore licensed under GPL v2 or later.
255*******
256******* The following modules are GPLed:
257*******
258*******      postproc
259*******      libx264
260*******      libxvid
261*******
262******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
263******* To remove nonfree and GPLed code leaving only LGPL code remove the
264******* +gpl2 variant.
265*******
266"
267} else {
268notes "
269*******
270******* This build of ${name} includes no GPLed or nonfree
271******* code and is therefore licensed under LGPL v2.1 or later.
272*******
273"
274}
275
276livecheck.type  regex
277livecheck.url   ${master_sites}
278livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.