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

Last change on this file since 107091 was 107091, checked in by devans@…, 6 years ago

ffmpeg, ffmpeg-devel: disable libbluray support on Tiger, #39442.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.0 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 107091 2013-06-18 01:23:16Z devans@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.1
13set branch      [join [lrange [split ${version} .] 0 1] .]
14revision        2
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       rmd160  bbccff41da7fb5731051b5bd4ececc41ed1d5749 \
57                sha256  0302375c3a64e9c2facfa7cbeb1aa333a39fdf6bbacda228cd48e04bf9ee32ca
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:libass \
73                port:libbluray \
74                port:gnutls \
75                port:openjpeg15 \
76                port:freetype \
77                path:lib/libspeex.dylib:speex \
78                port:libvpx \
79                path:lib/pkgconfig/sdl.pc:libsdl \
80                port:bzip2 \
81                port:zlib
82
83build.cmd       ${prefix}/bin/gmake
84build.env-append V=1
85
86#
87# enable auto configure of asm optimizations
88# requires Xcode 3.1 or better on Leopard
89#
90minimum_xcodeversions {9 3.1}
91
92if {[lsearch [get_canonical_archs] i386] != -1} {
93    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
94    # clang-139 hits https://trac.macports.org/ticket/38141
95    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
96
97    # https://trac.macports.org/ticket/37802
98    compiler.blacklist-append llvm-gcc-4.2 macports-llvm-gcc-4.2
99}
100
101# TODO: base should do this: http://trac.macports.org/ticket/32542
102if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
103    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
104
105    # base 2.1.x ignores the argument and just use ${configure.compiler}
106    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
107        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
108    }
109
110    if {[string match macports-gcc* ${configure.compiler}]} {
111        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
112    }
113}
114
115# And similarly, disable asm on Tiger
116# libblueray doesn't build on Tiger so disable for now (#39442)
117platform darwin {
118    if {${os.major} < 9} {
119        depends_lib-delete    port:libbluray
120        configure.args-delete --enable-libbluray
121        configure.args-append --disable-asm
122    }
123}
124
125# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
126# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
127default_variants-append +gpl2
128
129configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
130configure.args \
131        --enable-swscale --enable-avfilter \
132        --enable-libmp3lame \
133        --enable-libvorbis \
134        --enable-libopus \
135        --enable-libtheora \
136        --enable-libschroedinger \
137        --enable-libopenjpeg \
138        --enable-libmodplug \
139        --enable-libvpx \
140        --enable-libspeex \
141        --enable-libass \
142        --enable-libbluray \
143        --enable-gnutls \
144        --enable-libfreetype \
145        --mandir=${prefix}/share/man \
146        --enable-shared --enable-pthreads \
147        --cc=${configure.cc}
148
149test.run        yes
150
151#
152# configure isn't autoconf and they do use a dep cache
153#
154
155post-destroot {
156    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
157    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
158    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
159    foreach f [glob ${worksrcpath}/doc/*.txt] {
160        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
161    }
162}
163
164platform powerpc {
165    # absence of altivec is not automatically detected
166    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
167        configure.args-append --disable-altivec
168    }
169}
170
171platform darwin 8 {
172    post-patch {
173        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
174    }
175}
176
177configure.universal_args-delete --disable-dependency-tracking
178
179if {[variant_isset universal]} {
180    foreach arch ${configure.universal_archs} {
181        set merger_host($arch) ""
182        lappend merger_configure_args($arch) --arch=${arch}
183        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
184    }
185    if {[string match "*86*" ${configure.universal_archs}]} {
186        depends_build-append port:yasm
187    }
188    lappend merger_configure_args(i386) --enable-yasm
189    lappend merger_configure_args(x86_64) --enable-yasm
190} else {
191    configure.args-append --arch=${configure.build_arch}
192    configure.env-append  ASFLAGS='[get_canonical_archflags]'
193    if {$build_arch == "i386" || $build_arch == "x86_64"} {
194        depends_build-append port:yasm
195        configure.args-append --enable-yasm
196    }
197}
198
199variant gpl2 description {Enable GPL code, license will be GPL-2+} {
200    configure.args-append   --enable-gpl \
201                            --enable-postproc \
202                            --enable-libx264 \
203                            --enable-libxvid
204    depends_lib-append      port:XviD \
205                            port:x264
206    license-delete          LGPL-2.1+
207    license-append          GPL-2+
208}
209
210variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
211    configure.args-delete   --disable-libopencore-amrnb \
212                            --disable-libopencore-amrwb
213    configure.args-append   --enable-version3 \
214                            --enable-libopencore-amrnb \
215                            --enable-libopencore-amrwb
216    depends_lib-append      port:opencore-amr
217    license-delete          LGPL-2.1+
218    license-append          GPL-3+
219}
220
221
222# the build server uses the default variants, and we want distributable binaries
223# nonfree code is disabled by default but can be enabled using the +nonfree variant
224
225variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
226    configure.args-append   --enable-nonfree \
227                            --enable-libfaac
228    depends_lib-append      port:faac
229    license-delete          LGPL-2.1+
230    license-append          Restrictive
231}
232
233if {[variant_isset nonfree]} {
234notes "
235*******
236******* This build of ${name} includes nonfree code as follows:
237*******
238*******     libfaac
239*******
240******* The following libraries and binaries may not be redistributed:
241*******
242*******     ffmpeg
243*******     libavcodec
244*******     libavdevice
245*******     libavfilter
246*******     libavformat
247*******     libavutil
248*******
249******* To remove this restriction remove the variant +nonfree
250*******
251"
252} elseif {[variant_isset gpl3]} {
253notes "
254*******
255******* This build of ${name} includes GPLed code and
256******* is therefore licensed under GPL v3 or later.
257*******
258******* The following modules are GPLed:
259*******
260*******      postproc
261*******      libx264
262*******      libxvid
263*******      opencore-amr
264*******
265******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
266******* To remove nonfree and GPLed code leaving only LGPL code remove the
267******* +gpl2 and +gpl3 variants.
268*******
269"
270} elseif {[variant_isset gpl2]} {
271notes "
272*******
273******* This build of ${name} includes GPLed code and
274******* is therefore licensed under GPL v2 or later.
275*******
276******* The following modules are GPLed:
277*******
278*******      postproc
279*******      libx264
280*******      libxvid
281*******
282******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
283******* To remove nonfree and GPLed code leaving only LGPL code remove the
284******* +gpl2 variant.
285*******
286"
287} else {
288notes "
289*******
290******* This build of ${name} includes no GPLed or nonfree
291******* code and is therefore licensed under LGPL v2.1 or later.
292*******
293"
294}
295
296livecheck.type  regex
297livecheck.url   ${master_sites}
298livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.