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

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

ffmpeg: update to version 2.1.1.

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