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

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

ffmpeg: apply upstream patch to fix +gpl3 libsmbclient regression and re-enable libsmbclient support (#46244).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.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 129574 2014-12-15 22:27:08Z devans@macports.org $
3
4PortSystem      1.0
5PortGroup       xcodeversion 1.0
6PortGroup       muniversal 1.0
7PortGroup       compiler_blacklist_versions 1.0
8PortGroup       active_variants 1.1
9
10name            ffmpeg
11conflicts       ffmpeg-devel
12epoch           1
13version         2.5
14revision        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  285404e0e99463769d2e0189a8c1ae8b811453d8 \
57                sha256  148cfd694b60245f9116f5932f3f60bb6dba47bcfef395cdda7a7d8ed48d57ac
58
59depends_build   port:pkgconfig \
60                port:gmake \
61                port:texi2html
62
63depends_lib     port:lame \
64                port:libiconv \
65                port:libvorbis \
66                port:libopus \
67                port:libogg \
68                port:libtheora \
69                port:libmodplug \
70                port:schroedinger \
71                port:libass \
72                port:libbluray \
73                port:gnutls \
74                port:openjpeg15 \
75                port:fontconfig \
76                port:freetype \
77                port:fribidi \
78                path:lib/libspeex.dylib:speex \
79                port:libvpx \
80                port:libsdl \
81                port:bzip2 \
82                port:xz \
83                port:zlib
84
85patchfiles      patch-libdc1394.diff \
86                patch-libsmbclient.diff
87
88build.cmd       ${prefix}/bin/gmake
89build.env-append V=1
90
91#
92# enable auto configure of asm optimizations
93# requires Xcode 3.1 or better on Leopard
94#
95minimum_xcodeversions {9 3.1}
96
97if {[lsearch [get_canonical_archs] i386] != -1} {
98    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
99    # clang-139 hits https://trac.macports.org/ticket/38141
100    compiler.blacklist-append {clang < 422.1.7} macports-clang-3.1
101}
102
103# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
104# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
105default_variants-append +gpl2
106
107configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
108configure.args \
109        --enable-swscale \
110        --enable-avfilter \
111        --enable-avresample \
112        --enable-libmp3lame \
113        --enable-libvorbis \
114        --enable-libopus \
115        --enable-libtheora \
116        --enable-libschroedinger \
117        --enable-libopenjpeg \
118        --enable-libmodplug \
119        --enable-libvpx \
120        --enable-libspeex \
121        --enable-libass \
122        --enable-libbluray \
123        --enable-lzma \
124        --enable-gnutls \
125        --enable-fontconfig \
126        --enable-libfreetype \
127        --enable-libfribidi \
128        --disable-libxcb \
129        --disable-libxcb-shm \
130        --disable-libxcb-xfixes \
131        --disable-indev=jack \
132        --disable-outdev=xv \
133        --disable-vda \
134        --mandir=${prefix}/share/man \
135        --enable-shared --enable-pthreads \
136        --cc=${configure.cc}
137
138# disable asm on Tiger
139# libblueray doesn't build on Tiger so disable for now (#39442)
140
141platform darwin {
142    if {${os.major} < 9} {
143        depends_lib-delete    port:libbluray
144        configure.args-delete --enable-libbluray
145        configure.args-append --disable-libbluray
146        configure.args-append --disable-asm
147    }
148
149    # FIXME: use ${os.minor} once it hits stable base
150    # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+
151    if {${os.major} > 10 || (${os.major} == 10 && [lindex [split ${os.version} .] 1] >= 3)} {
152        configure.args-delete --disable-vda
153        configure.args-append --enable-vda
154    }
155
156    # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+
157    if {${os.major} < 12} {
158        configure.args-append --disable-indev=avfoundation
159    }
160}
161
162test.run        yes
163
164#
165# configure isn't autoconf and they do use a dep cache
166#
167
168post-destroot {
169    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
170    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
171    foreach f [glob ${worksrcpath}/doc/*.txt] {
172        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
173    }
174}
175
176platform powerpc {
177    # absence of altivec is not automatically detected
178    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
179        configure.args-append --disable-altivec
180    }
181}
182
183platform darwin 8 {
184    post-patch {
185        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
186    }
187}
188
189configure.universal_args-delete --disable-dependency-tracking
190
191if {[variant_isset universal]} {
192    foreach arch ${configure.universal_archs} {
193        set merger_host($arch) ""
194        lappend merger_configure_args($arch) --arch=${arch}
195        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
196    }
197    if {[string match "*86*" ${configure.universal_archs}]} {
198        depends_build-append port:yasm
199    }
200    lappend merger_configure_args(i386) --enable-yasm
201    lappend merger_configure_args(x86_64) --enable-yasm
202} else {
203    configure.args-append --arch=${configure.build_arch}
204    configure.env-append  ASFLAGS='[get_canonical_archflags]'
205    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
206        depends_build-append port:yasm
207        configure.args-append --enable-yasm
208    }
209}
210
211# this dummy variant is used to mark whether ffmpeg is built with
212# libsdl +x11 and hence has a binary dependency on xorg-libX11
213# or libsdl -x11 and does not
214
215variant x11 {}
216default_variants +x11
217
218if {[variant_isset x11]} {
219    require_active_variants libsdl x11
220} else {
221    require_active_variants libsdl "" x11
222}
223
224variant libdc1394 description {Enable IIDC-1394 frame grabbing using libdc1394 (experimental)} {
225    depends_lib-append port:libdc1394
226    configure.args-append --enable-libdc1394
227}
228
229# Allow use of librtmp instead of ffmpeg's internal rtmp implementation
230# May address interoperability issues with CRtmpServer and others
231# https://trac.macports.org/ticket/32219
232# https://groups.google.com/forum/#!topic/c-rtmp-server/ywQPjvciPgc
233# https://trac.ffmpeg.org/ticket/1700
234
235variant librtmp description {Use librtmp (from rtmpdump) as rtmp[t][es]:// protocol handler} {
236    configure.args-append   --enable-librtmp
237
238    depends_lib-append      port:rtmpdump
239}
240
241variant gpl2 description {Enable GPL code, license will be GPL-2+} {
242    configure.args-append   --enable-gpl \
243                            --enable-postproc \
244                            --enable-libx264 \
245                            --enable-libxvid
246    depends_lib-append      port:XviD \
247                            port:x264
248    license-delete          LGPL-2.1+
249    license-append          GPL-2+
250}
251
252# libsmbclient causes build failure when +gpl3 is selected (#46244)
253# disable until underlying cause is identified and addressed
254
255variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
256    configure.args-append   --enable-version3 \
257                            --enable-libopencore-amrnb \
258                            --enable-libopencore-amrwb \
259                            --enable-libsmbclient
260
261    depends_lib-append      port:opencore-amr \
262                            port:samba3
263
264    license-delete          LGPL-2.1+
265    license-append          GPL-3+
266}
267
268# the build server uses the default variants, and we want distributable binaries
269# nonfree code is disabled by default but can be enabled using the +nonfree variant
270
271variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
272    configure.args-append   --enable-nonfree \
273                            --enable-libfdk-aac \
274                            --enable-libfaac
275    depends_lib-append      port:libfdk-aac \
276                            port:faac
277    license-delete          LGPL-2.1+
278    license-append          Restrictive
279}
280
281if {[variant_isset nonfree]} {
282notes "
283*******
284******* This build of ${name} includes nonfree code as follows:
285*******
286*******     libfaac
287*******     libfdk-aac
288*******
289******* The following libraries and binaries may not be redistributed:
290*******
291*******     ffmpeg
292*******     libavcodec
293*******     libavdevice
294*******     libavfilter
295*******     libavformat
296*******     libavutil
297*******
298******* To remove this restriction remove the variant +nonfree
299*******
300"
301} elseif {[variant_isset gpl3]} {
302notes "
303*******
304******* This build of ${name} includes GPLed code and
305******* is therefore licensed under GPL v3 or later.
306*******
307******* The following modules are GPLed:
308*******
309*******      postproc
310*******      libsambaclient
311*******      libx264
312*******      libxvid
313*******      opencore-amr
314*******
315******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
316******* To remove nonfree and GPLed code leaving only LGPL code remove the
317******* +gpl2 and +gpl3 variants.
318*******
319"
320} elseif {[variant_isset gpl2]} {
321notes "
322*******
323******* This build of ${name} includes GPLed code and
324******* is therefore licensed under GPL v2 or later.
325*******
326******* The following modules are GPLed:
327*******
328*******      postproc
329*******      libx264
330*******      libxvid
331*******
332******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
333******* To remove nonfree and GPLed code leaving only LGPL code remove the
334******* +gpl2 variant.
335*******
336"
337} else {
338notes "
339*******
340******* This build of ${name} includes no GPLed or nonfree
341******* code and is therefore licensed under LGPL v2.1 or later.
342*******
343"
344}
345
346livecheck.type  regex
347livecheck.url   ${master_sites}
348livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.