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

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

More revbumps for x264 change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.7 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 104705 2013-04-01 03:22:23Z 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.2
13revision        1
14set branch      [join [lrange [split ${version} .] 0 1] .]
15license         LGPL-2.1+
16categories      multimedia
17maintainers     devans jeremyhu openmaintainer
18
19description     FFmpeg is a complete solution to play, record, convert and \
20                stream audio and video.
21
22long_description        FFmpeg is a complete solution to record, convert and \
23                        stream audio and video. It includes libavcodec, the \
24                        leading audio/video codec library. \
25                        \
26                        The project is made of several components: \
27                        \
28                        ffmpeg is a command line tool to convert one video \
29                        file format to another. It also supports grabbing and \
30                        encoding in real time from a TV card. \
31                        \
32                        ffserver is an HTTP (RTSP is being developed) \
33                        multimedia streaming server for live broadcasts. Time \
34                        shifting of live broadcast is also supported. \
35                        \
36                        ffplay is a simple media player based on SDL and on \
37                        the ffmpeg libraries. \
38                        \
39                        ffprobe gathers information from multimedia streams and \
40                        prints it in human- and machine-readable fashion. \
41                        \
42                        libavcodec is a library containing all the ffmpeg \
43                        audio/video encoders and decoders. Most codecs were \
44                        developed from scratch to ensure best performance \
45                        and high code reusability. \
46                        \
47                        libavformat is a library containing parsers and \
48                        generators for all common audio/video formats.
49
50platforms       darwin
51homepage        http://www.ffmpeg.org/
52master_sites    http://www.ffmpeg.org/releases/
53
54use_bzip2       yes
55
56checksums       sha256  9a39fbc07dae0c893059e07491bcfb1e2409cc220f72b41eed23a04becea5aaf \
57                rmd160  f1b1122ee39276cf5eb00b4113794a2c23c1e66f
58
59depends_build   port:pkgconfig \
60                port:gmake \
61                port:texi2html
62
63depends_lib     port:lame \
64                port:libvorbis \
65                port:libopus \
66                port:libogg \
67                port:libtheora \
68                port:libmodplug \
69                port:jack \
70                port:dirac \
71                port:schroedinger \
72                port:openjpeg \
73                port:freetype \
74                path:lib/libspeex.dylib:speex \
75                port:libvpx \
76                path:lib/pkgconfig/sdl.pc:libsdl \
77                port:bzip2 \
78                port:zlib
79
80build.cmd       ${prefix}/bin/gmake
81build.env-append V=1
82
83#
84# enable auto configure of asm optimizations
85# requires Xcode 3.1 or better on Leopard
86#
87minimum_xcodeversions {9 3.1}
88
89if {[lsearch [get_canonical_archs] i386] != -1} {
90    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
91    # clang-139 hits https://trac.macports.org/ticket/38141
92    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
93
94    # https://trac.macports.org/ticket/37802
95    compiler.blacklist-append llvm-gcc-4.2 macports-llvm-gcc-4.2
96}
97
98# TODO: base should do this: http://trac.macports.org/ticket/32542
99if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
100    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
101
102    # base 2.1.x ignores the argument and just use ${configure.compiler}
103    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
104        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
105    }
106
107    if {[string match macports-gcc* ${configure.compiler}]} {
108        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
109    }
110}
111
112# And similarly, disable asm on Tiger
113platform darwin {
114    if {${os.major} < 9} {
115        configure.args-append --disable-asm
116    }
117}
118
119# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
120# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
121default_variants-append +gpl2
122
123configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
124configure.args \
125        --enable-swscale --enable-avfilter \
126        --enable-libmp3lame \
127        --enable-libvorbis \
128        --enable-libopus \
129        --enable-libtheora \
130        --enable-libschroedinger \
131        --enable-libopenjpeg \
132        --enable-libmodplug \
133        --enable-libvpx \
134        --enable-libspeex \
135        --enable-libfreetype \
136        --mandir=${prefix}/share/man \
137        --enable-shared --enable-pthreads \
138        --cc=${configure.cc}
139
140test.run        yes
141
142#
143# configure isn't autoconf and they do use a dep cache
144#
145
146post-destroot {
147    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
148    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
149    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
150    foreach f [glob ${worksrcpath}/doc/*.txt] {
151        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
152    }
153}
154
155platform powerpc {
156    # absence of altivec is not automatically detected
157    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
158        configure.args-append --disable-altivec
159    }
160}
161
162platform darwin 8 {
163    post-patch {
164        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
165    }
166}
167
168configure.universal_args-delete --disable-dependency-tracking
169
170if {[variant_isset universal]} {
171    foreach arch ${configure.universal_archs} {
172        set merger_host($arch) ""
173        lappend merger_configure_args($arch) --arch=${arch}
174        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
175    }
176    if {[string match "*86*" ${configure.universal_archs}]} {
177        depends_build-append port:yasm
178    }
179    lappend merger_configure_args(i386) --enable-yasm
180    lappend merger_configure_args(x86_64) --enable-yasm
181} else {
182    configure.args-append --arch=${configure.build_arch}
183    configure.env-append  ASFLAGS='[get_canonical_archflags]'
184    if {$build_arch == "i386" || $build_arch == "x86_64"} {
185        depends_build-append port:yasm
186        configure.args-append --enable-yasm
187    }
188}
189
190variant gpl2 description {Enable GPL code, license will be GPL-2+} {
191    configure.args-append   --enable-gpl \
192                            --enable-postproc \
193                            --enable-libx264 \
194                            --enable-libxvid
195    depends_lib-append      port:XviD \
196                            port:x264
197    license-delete          LGPL-2.1+
198    license-append          GPL-2+
199}
200
201variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
202    configure.args-delete   --disable-libopencore-amrnb \
203                            --disable-libopencore-amrwb
204    configure.args-append   --enable-version3 \
205                            --enable-libopencore-amrnb \
206                            --enable-libopencore-amrwb
207    depends_lib-append      port:opencore-amr
208    license-delete          LGPL-2.1+
209    license-append          GPL-3+
210}
211
212
213# the build server uses the default variants, and we want distributable binaries
214# nonfree code is disabled by default but can be enabled using the +nonfree variant
215
216variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
217    configure.args-append   --enable-nonfree \
218                            --enable-libfaac
219    depends_lib-append      port:faac
220    license-delete          LGPL-2.1+
221    license-append          Restrictive
222}
223
224if {[variant_isset nonfree]} {
225notes "
226*******
227******* This build of ${name} includes nonfree code as follows:
228*******
229*******     libfaac
230*******
231******* The following libraries and binaries may not be redistributed:
232*******
233*******     ffmpeg
234*******     libavcodec
235*******     libavdevice
236*******     libavfilter
237*******     libavformat
238*******     libavutil
239*******
240******* To remove this restriction remove the variant +nonfree
241*******
242"
243} elseif {[variant_isset gpl3]} {
244notes "
245*******
246******* This build of ${name} includes GPLed code and
247******* is therefore licensed under GPL v3 or later.
248*******
249******* The following modules are GPLed:
250*******
251*******      postproc
252*******      libx264
253*******      libxvid
254*******      opencore-amr
255*******
256******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
257******* To remove nonfree and GPLed code leaving only LGPL code remove the
258******* +gpl2 and +gpl3 variants.
259*******
260"
261} elseif {[variant_isset gpl2]} {
262notes "
263*******
264******* This build of ${name} includes GPLed code and
265******* is therefore licensed under GPL v2 or later.
266*******
267******* The following modules are GPLed:
268*******
269*******      postproc
270*******      libx264
271*******      libxvid
272*******
273******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
274******* To remove nonfree and GPLed code leaving only LGPL code remove the
275******* +gpl2 variant.
276*******
277"
278} else {
279notes "
280*******
281******* This build of ${name} includes no GPLed or nonfree
282******* code and is therefore licensed under LGPL v2.1 or later.
283*******
284"
285}
286
287livecheck.type  regex
288livecheck.url   ${master_sites}
289livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.