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

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

ffmpeg: update to version 1.1.2.

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