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

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

ffmpeg: don't overwrite the universal variant from muniversal with an empty one

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