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

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

ffmpeg*: Workaround #30137 for i386

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