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

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

ffmpeg*: +gpl2 by default (#35473)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.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 96153 2012-08-02 03:55:28Z 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# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
96# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
97default_variants-append +gpl2
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-swscale --enable-avfilter \
116        --enable-libmp3lame \
117        --enable-libvorbis \
118        --enable-libtheora \
119        --enable-libdirac --enable-libschroedinger \
120        --enable-libopenjpeg \
121        --enable-libvpx \
122        --enable-libspeex \
123        --disable-libopencore-amrnb \
124        --disable-libopencore-amrwb \
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 gpl2 description {Enable GPL code, license will be GPL-2+} {
184    configure.args-append   --enable-gpl \
185                            --enable-postproc \
186                            --enable-libx264 \
187                            --enable-libxvid
188    depends_lib-append      port:XviD \
189                            port:x264
190    license-delete          LGPL-2.1+
191    license-append          GPL-2+
192}
193
194variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
195    configure.args-delete   --disable-libopencore-amrnb \
196                            --disable-libopencore-amrwb
197    configure.args-append   --enable-version3 \
198                            --enable-libopencore-amrnb \
199                            --enable-libopencore-amrwb
200    depends_lib-append      port:opencore-amr
201    license-delete          LGPL-2.1+
202    license-append          GPL-3+
203}
204
205
206# the build server uses the default variants, and we want distributable binaries
207# nonfree code is disabled by default but can be enabled using the +nonfree variant
208
209variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
210    configure.args-append   --enable-nonfree \
211                            --enable-libfaac
212    depends_lib-append      port:faac
213    license-delete          LGPL-2.1+
214    license-append          Restrictive
215}
216
217if {[variant_isset nonfree]} {
218notes "
219*******
220******* This build of ${name} includes nonfree code as follows:
221*******
222*******     libfaac
223*******
224******* The following libraries and binaries may not be redistributed:
225*******
226*******     ffmpeg
227*******     libavcodec
228*******     libavdevice
229*******     libavfilter
230*******     libavformat
231*******     libavutil
232*******
233******* To remove this restriction remove the variant +nonfree
234*******
235"
236} elseif {[variant_isset gpl3]} {
237notes "
238*******
239******* This build of ${name} includes GPLed code and
240******* is therefore licensed under GPL v3 or later.
241*******
242******* The following modules are GPLed:
243*******
244*******      postproc
245*******      libx264
246*******      libxvid
247*******      opencore-amr
248*******
249******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
250******* To remove nonfree and GPLed code leaving only LGPL code remove the
251******* +gpl2 and +gpl3 variants.
252*******
253"
254} elseif {[variant_isset gpl2]} {
255notes "
256*******
257******* This build of ${name} includes GPLed code and
258******* is therefore licensed under GPL v2 or later.
259*******
260******* The following modules are GPLed:
261*******
262*******      postproc
263*******      libx264
264*******      libxvid
265*******
266******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
267******* To remove nonfree and GPLed code leaving only LGPL code remove the
268******* +gpl2 variant.
269*******
270"
271} else {
272notes "
273*******
274******* This build of ${name} includes no GPLed or nonfree
275******* code and is therefore licensed under LGPL v2.1 or later.
276*******
277"
278}
279
280livecheck.type  regex
281livecheck.url   ${master_sites}
282livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.