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

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

x264: Bump to 20130105 and revbump dependents

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.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 101211 2013-01-06 11:12:21Z jeremyhu@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmpeg
9conflicts       ffmpeg-devel
10epoch           1
11version         1.0.1
12revision        1
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  758840dcfc94eb7fd6263718d26408658a59422e5fb8ac4de8e7ecf0cbed6e76 \
56                rmd160  363ba32002ed79def6d0f160975b751d15818c1e
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
88# And similarly, disable asm on Tiger
89platform darwin {
90    if {${os.major} < 9} {
91        configure.args-append --disable-asm
92    }
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 --enable-avfilter \
102        --enable-libmp3lame \
103        --enable-libvorbis \
104        --enable-libopus \
105        --enable-libtheora \
106        --enable-libschroedinger \
107        --enable-libopenjpeg \
108        --enable-libmodplug \
109        --enable-libvpx \
110        --enable-libspeex \
111        --enable-libfreetype \
112        --mandir=${prefix}/share/man \
113        --enable-shared --enable-pthreads \
114        --cc=${configure.cc}
115
116test.run        yes
117
118#
119# configure isn't autoconf and they do use a dep cache
120#
121
122post-destroot {
123    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
124    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
125    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
126    foreach f [glob ${worksrcpath}/doc/*.txt] {
127        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
128    }
129}
130
131platform powerpc {
132    # absence of altivec is not automatically detected
133    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
134        configure.args-append --disable-altivec
135    }
136}
137
138platform darwin 8 {
139    post-patch {
140        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
141    }
142}
143
144configure.universal_args-delete --disable-dependency-tracking
145
146if {[variant_isset universal]} {
147    foreach arch ${configure.universal_archs} {
148        set merger_host($arch) ""
149        lappend merger_configure_args($arch) --arch=${arch}
150        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
151    }
152    if {[string match "*86*" ${configure.universal_archs}]} {
153        depends_build-append port:yasm
154    }
155    lappend merger_configure_args(i386) --enable-yasm
156    lappend merger_configure_args(x86_64) --enable-yasm
157} else {
158    configure.args-append --arch=${configure.build_arch}
159    configure.env-append  ASFLAGS='[get_canonical_archflags]'
160    if {$build_arch == "i386" || $build_arch == "x86_64"} {
161        depends_build-append port:yasm
162        configure.args-append --enable-yasm
163    }
164}
165
166variant gpl2 description {Enable GPL code, license will be GPL-2+} {
167    configure.args-append   --enable-gpl \
168                            --enable-postproc \
169                            --enable-libx264 \
170                            --enable-libxvid
171    depends_lib-append      port:XviD \
172                            port:x264
173    license-delete          LGPL-2.1+
174    license-append          GPL-2+
175}
176
177variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
178    configure.args-delete   --disable-libopencore-amrnb \
179                            --disable-libopencore-amrwb
180    configure.args-append   --enable-version3 \
181                            --enable-libopencore-amrnb \
182                            --enable-libopencore-amrwb
183    depends_lib-append      port:opencore-amr
184    license-delete          LGPL-2.1+
185    license-append          GPL-3+
186}
187
188
189# the build server uses the default variants, and we want distributable binaries
190# nonfree code is disabled by default but can be enabled using the +nonfree variant
191
192variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
193    configure.args-append   --enable-nonfree \
194                            --enable-libfaac
195    depends_lib-append      port:faac
196    license-delete          LGPL-2.1+
197    license-append          Restrictive
198}
199
200if {[variant_isset nonfree]} {
201notes "
202*******
203******* This build of ${name} includes nonfree code as follows:
204*******
205*******     libfaac
206*******
207******* The following libraries and binaries may not be redistributed:
208*******
209*******     ffmpeg
210*******     libavcodec
211*******     libavdevice
212*******     libavfilter
213*******     libavformat
214*******     libavutil
215*******
216******* To remove this restriction remove the variant +nonfree
217*******
218"
219} elseif {[variant_isset gpl3]} {
220notes "
221*******
222******* This build of ${name} includes GPLed code and
223******* is therefore licensed under GPL v3 or later.
224*******
225******* The following modules are GPLed:
226*******
227*******      postproc
228*******      libx264
229*******      libxvid
230*******      opencore-amr
231*******
232******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
233******* To remove nonfree and GPLed code leaving only LGPL code remove the
234******* +gpl2 and +gpl3 variants.
235*******
236"
237} elseif {[variant_isset gpl2]} {
238notes "
239*******
240******* This build of ${name} includes GPLed code and
241******* is therefore licensed under GPL v2 or later.
242*******
243******* The following modules are GPLed:
244*******
245*******      postproc
246*******      libx264
247*******      libxvid
248*******
249******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
250******* To remove nonfree and GPLed code leaving only LGPL code remove the
251******* +gpl2 variant.
252*******
253"
254} else {
255notes "
256*******
257******* This build of ${name} includes no GPLed or nonfree
258******* code and is therefore licensed under LGPL v2.1 or later.
259*******
260"
261}
262
263livecheck.type  regex
264livecheck.url   ${master_sites}
265livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.