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

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

ffmpeg: enable build of libavresample, #38916.

  • 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 111541 2013-09-25 12:56:22Z 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.0.1
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       rmd160  e1e5cfe9417b40833a5234b521ebe9c8b8e89cd9 \
57                sha256  611eae7e3485d5fd9ff03e0ac7575ea89bc8105e40e99a40de02324957482f95
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
98# And similarly, disable asm on Tiger
99# libblueray doesn't build on Tiger so disable for now (#39442)
100platform darwin {
101    if {${os.major} < 9} {
102        depends_lib-delete    port:libbluray
103        configure.args-delete --enable-libbluray
104        configure.args-append --disable-asm
105    }
106}
107
108# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
109# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
110default_variants-append +gpl2
111
112configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
113configure.args \
114        --enable-swscale \
115        --enable-avfilter \
116        --enable-avresample \
117        --enable-libmp3lame \
118        --enable-libvorbis \
119        --enable-libopus \
120        --enable-libtheora \
121        --enable-libschroedinger \
122        --enable-libopenjpeg \
123        --enable-libmodplug \
124        --enable-libvpx \
125        --enable-libspeex \
126        --enable-libass \
127        --enable-libbluray \
128        --enable-gnutls \
129        --enable-libfreetype \
130        --disable-outdev=xv \
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
157platform darwin 8 {
158    post-patch {
159        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
160    }
161}
162
163configure.universal_args-delete --disable-dependency-tracking
164
165if {[variant_isset universal]} {
166    foreach arch ${configure.universal_archs} {
167        set merger_host($arch) ""
168        lappend merger_configure_args($arch) --arch=${arch}
169        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
170    }
171    if {[string match "*86*" ${configure.universal_archs}]} {
172        depends_build-append port:yasm
173    }
174    lappend merger_configure_args(i386) --enable-yasm
175    lappend merger_configure_args(x86_64) --enable-yasm
176} else {
177    configure.args-append --arch=${configure.build_arch}
178    configure.env-append  ASFLAGS='[get_canonical_archflags]'
179    if {$build_arch == "i386" || $build_arch == "x86_64"} {
180        depends_build-append port:yasm
181        configure.args-append --enable-yasm
182    }
183}
184
185variant gpl2 description {Enable GPL code, license will be GPL-2+} {
186    configure.args-append   --enable-gpl \
187                            --enable-postproc \
188                            --enable-libx264 \
189                            --enable-libxvid
190    depends_lib-append      port:XviD \
191                            port:x264
192    license-delete          LGPL-2.1+
193    license-append          GPL-2+
194}
195
196variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
197    configure.args-delete   --disable-libopencore-amrnb \
198                            --disable-libopencore-amrwb
199    configure.args-append   --enable-version3 \
200                            --enable-libopencore-amrnb \
201                            --enable-libopencore-amrwb
202    depends_lib-append      port:opencore-amr
203    license-delete          LGPL-2.1+
204    license-append          GPL-3+
205}
206
207
208# the build server uses the default variants, and we want distributable binaries
209# nonfree code is disabled by default but can be enabled using the +nonfree variant
210
211variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
212    configure.args-append   --enable-nonfree \
213                            --enable-libfaac
214    depends_lib-append      port:faac
215    license-delete          LGPL-2.1+
216    license-append          Restrictive
217}
218
219if {[variant_isset nonfree]} {
220notes "
221*******
222******* This build of ${name} includes nonfree code as follows:
223*******
224*******     libfaac
225*******
226******* The following libraries and binaries may not be redistributed:
227*******
228*******     ffmpeg
229*******     libavcodec
230*******     libavdevice
231*******     libavfilter
232*******     libavformat
233*******     libavutil
234*******
235******* To remove this restriction remove the variant +nonfree
236*******
237"
238} elseif {[variant_isset gpl3]} {
239notes "
240*******
241******* This build of ${name} includes GPLed code and
242******* is therefore licensed under GPL v3 or later.
243*******
244******* The following modules are GPLed:
245*******
246*******      postproc
247*******      libx264
248*******      libxvid
249*******      opencore-amr
250*******
251******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
252******* To remove nonfree and GPLed code leaving only LGPL code remove the
253******* +gpl2 and +gpl3 variants.
254*******
255"
256} elseif {[variant_isset gpl2]} {
257notes "
258*******
259******* This build of ${name} includes GPLed code and
260******* is therefore licensed under GPL v2 or later.
261*******
262******* The following modules are GPLed:
263*******
264*******      postproc
265*******      libx264
266*******      libxvid
267*******
268******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
269******* To remove nonfree and GPLed code leaving only LGPL code remove the
270******* +gpl2 variant.
271*******
272"
273} else {
274notes "
275*******
276******* This build of ${name} includes no GPLed or nonfree
277******* code and is therefore licensed under LGPL v2.1 or later.
278*******
279"
280}
281
282livecheck.type  regex
283livecheck.url   ${master_sites}
284livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.