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

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

use eq and ne instead of == and != when comparing ${os.arch}, ${configure.build_arch}, ${build_arch}, and some port-specific variables for referring to architectures

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