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

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

ffmpeg*: Build fix for Tiger (#36877)

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