source: trunk/dports/multimedia/ffmpeg-devel/Portfile

Last change on this file was 154237, checked in by devans@…, 6 weeks ago

ffmpeg-devel: update to upstream git master as 20161024

  • libsdl outdev dropped, replaced by libsdl2
  • update dependencies
  • to match libsdl2, +x11 is no longer a default variant
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.7 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 154237 2016-10-25 07:47:20Z ryandesign@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
9PortGroup           github 1.0
10
11github.setup        FFmpeg FFmpeg 85d23e5cbc9ad6835eef870a5b4247de78febe56
12name                ffmpeg-devel
13conflicts           ffmpeg
14version             20161024
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/
52
53checksums           rmd160  4f82065f34a43fb381e6fa2d0b3523c00b23867e \
54                    sha256  98bd06d24ae17e567ef37633aaec2147bcef90e05b355b9b1e29ff90dc784e5f
55
56depends_build       port:pkgconfig \
57                    port:gmake \
58                    port:texinfo
59
60# libvpx is static only so can be considered a build dependency (#47934)
61
62depends_build-append \
63                    port:libvpx
64
65depends_lib         port:lame \
66                    port:libiconv \
67                    port:libvorbis \
68                    port:libopus \
69                    port:libogg \
70                    port:libtheora \
71                    port:libmodplug \
72                    port:schroedinger \
73                    port:libass \
74                    port:libbluray \
75                    port:gnutls \
76                    port:openjpeg \
77                    port:fontconfig \
78                    port:freetype \
79                    port:fribidi \
80                    path:lib/libspeex.dylib:speex \
81                    port:libsdl2 \
82                    port:soxr \
83                    port:bzip2 \
84                    port:xz \
85                    port:zlib
86
87patchfiles          patch-libavcodec-audiotoolboxenc.c.diff
88
89#
90# enable auto configure of asm optimizations
91# requires Xcode 3.1 or better on Leopard
92#
93minimum_xcodeversions {9 3.1}
94
95if {[lsearch [get_canonical_archs] i386] != -1} {
96    # clang-3.1 hits https://trac.macports.org/ticket/30137 (<rdar://problem/11542429>)
97    # clang-139 hits https://trac.macports.org/ticket/38141
98    compiler.blacklist-append {clang < 422.1.7}
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      --enable-swscale \
107                    --enable-avfilter \
108                    --enable-avresample \
109                    --enable-libmp3lame \
110                    --enable-libvorbis \
111                    --enable-libopus \
112                    --enable-libtheora \
113                    --enable-libschroedinger \
114                    --enable-libopenjpeg \
115                    --enable-libmodplug \
116                    --enable-libvpx \
117                    --enable-libsoxr \
118                    --enable-libspeex \
119                    --enable-libass \
120                    --enable-libbluray \
121                    --enable-lzma \
122                    --enable-gnutls \
123                    --enable-fontconfig \
124                    --enable-libfreetype \
125                    --enable-libfribidi \
126                    --disable-libxcb \
127                    --disable-libxcb-shm \
128                    --disable-libxcb-xfixes \
129                    --disable-indev=jack \
130                    --disable-outdev=xv \
131                    --disable-vda \
132                    --disable-audiotoolbox \
133                    --disable-videotoolbox \
134                    --mandir=${prefix}/share/man \
135                    --enable-shared --enable-pthreads \
136                    --cc=${configure.cc}
137
138
139platform darwin {
140    # disable asm on Tiger
141    # libblueray doesn't build on Tiger so disable for now (#39442)
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    # filters coreimage and coreimagesrc don't build on 10.6
150    # and earlier due to use of bridged casts in Objective C (#51823)
151    if {${os.major} < 11} {
152        configure.args-append --disable-filter=coreimage \
153                              --disable-filter=coreimagesrc
154    }
155
156    # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+ up to (excluding) 10.11.
157    #if {(${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)) && (${os.major} < 15)}
158    # Due to a bug in ffmpeg(?), we have to enable VDA on 10.11 as well, even though it shouldn't be supported.
159    # More information: https://github.com/mpv-player/mpv/issues/2299
160    if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} {
161        configure.args-delete --disable-vda
162        configure.args-append --enable-vda
163    }
164
165    # AudiotoolBox support requires CoreMedia Framework available on 10.7+
166    if {${os.major} > 10} {
167        configure.args-delete --disable-audiotoolbox
168        configure.args-append --enable-audiotoolbox
169    }
170
171    # VideotoolBox, a new hardware acceleration framework, is supported on 10.8+ and "here to stay".
172    # It provides support for H264, H263, MPEG1, MPEG2 and MPEG4.
173    if {${os.major} > 11} {
174        configure.args-delete --disable-videotoolbox
175        configure.args-append --enable-videotoolbox
176    }
177
178    # Apple GCC has problems with SIMD intrinsics and -Werror=no-missing-prototypes.
179    if {${os.major} < 11} {
180        patchfiles-append patch-configure-no-error-on-missing-prototypes.diff
181    }
182
183    # kCVPixelFormatType_OneComponent8 used in avfoundation indev is only available on 10.8+
184    if {${os.major} < 12} {
185        configure.args-append --disable-indev=avfoundation
186    }
187}
188
189build.cmd           ${prefix}/bin/gmake
190build.env-append    V=1
191
192test.run            yes
193
194destroot.env-append V=1
195
196#
197# configure isn't autoconf and they do use a dep cache
198#
199
200post-destroot {
201    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
202    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
203    foreach f [glob ${worksrcpath}/doc/*.txt] {
204        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
205    }
206}
207
208platform powerpc {
209    # absence of altivec is not automatically detected
210    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
211        configure.args-append --disable-altivec
212    }
213}
214
215platform darwin 8 {
216    post-patch {
217        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
218    }
219}
220
221configure.universal_args-delete --disable-dependency-tracking
222
223if {[variant_isset universal]} {
224    foreach arch ${configure.universal_archs} {
225        set merger_host($arch) ""
226        lappend merger_configure_args($arch) --arch=${arch}
227        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
228    }
229    if {[string match "*86*" ${configure.universal_archs}]} {
230        depends_build-append port:yasm
231    }
232    lappend merger_configure_args(i386) --enable-yasm
233    lappend merger_configure_args(x86_64) --enable-yasm
234} else {
235    configure.args-append --arch=${configure.build_arch}
236    configure.env-append  ASFLAGS='[get_canonical_archflags]'
237    if {${build_arch} eq "i386" || ${build_arch} eq "x86_64"} {
238        depends_build-append port:yasm
239        configure.args-append --enable-yasm
240    }
241}
242
243variant x11 {
244#
245# enable x11grab_xcb input device
246#
247    depends_lib-append      port:xorg-libxcb \
248                            port:xorg-libXext \
249                            port:xorg-libXfixes
250
251    configure.args-delete   --disable-libxcb \
252                            --disable-libxcb-shm \
253                            --disable-libxcb-xfixes \
254}
255
256if {[variant_isset x11]} {
257    require_active_variants libsdl2 x11
258} else {
259    require_active_variants libsdl2 "" x11
260}
261
262variant libdc1394 description {Enable IIDC-1394 frame grabbing using libdc1394 (experimental)} {
263    depends_lib-append port:libdc1394
264    configure.args-append --enable-libdc1394
265}
266
267# Allow use of librtmp instead of ffmpeg's internal rtmp implementation
268# May address interoperability issues with CRtmpServer and others
269# https://trac.macports.org/ticket/32219
270# https://groups.google.com/forum/#!topic/c-rtmp-server/ywQPjvciPgc
271# https://trac.ffmpeg.org/ticket/1700
272
273variant librtmp description {Use librtmp (from rtmpdump) as rtmp[t][es]:// protocol handler} {
274    configure.args-append   --enable-librtmp
275
276    depends_lib-append      port:rtmpdump
277}
278
279# x265 currently does not support OS X < 10.6 (#48336, #48338)
280# x265 cmake issues cause universal build to fail (#48331)
281# make libx265 support optional via +libx265 variant
282# only define variant for non-universal builds on 10.6 or greater
283
284platform darwin {
285    if {${os.major} > 8 && [variant_isset gpl2] && ![variant_isset universal]} {
286        variant libx265 description {Build with support for encoding HEVC video using libx265} {
287            configure.args-append   --enable-libx265
288            depends_lib-append      port:x265
289        }
290    }
291}
292
293variant high10 requires gpl2 description {Build using libx264 with 10-bit output} {}
294
295if {[variant_isset high10]} {
296    require_active_variants x264 high10
297} else {
298    require_active_variants x264 "" high10
299}
300
301variant gpl2 description {Enable GPL code, license will be GPL-2+} {
302    configure.args-append   --enable-gpl \
303                            --enable-postproc \
304                            --enable-libx264 \
305                            --enable-libxvid
306    depends_lib-append      port:XviD \
307                            port:x264
308
309    license                 GPL-2+
310}
311
312variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
313    configure.args-append   --enable-version3 \
314                            --enable-libopencore-amrnb \
315                            --enable-libopencore-amrwb \
316                            --enable-libsmbclient
317
318    depends_lib-append      port:opencore-amr \
319                            port:samba3
320
321    license                 GPL-3+
322}
323
324# the build server uses the default variants, and we want distributable binaries
325# nonfree code is disabled by default but can be enabled using the +nonfree variant
326
327variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
328    configure.args-append   --enable-nonfree \
329                            --enable-libfdk-aac
330    depends_lib-append      port:libfdk-aac
331    license                 Restrictive
332}
333
334if {[variant_isset nonfree]} {
335notes "
336*******
337******* This build of ${name} includes nonfree code as follows:
338*******
339*******     libfdk-aac
340*******
341******* The following libraries and binaries may not be redistributed:
342*******
343*******     ffmpeg
344*******     libavcodec
345*******     libavdevice
346*******     libavfilter
347*******     libavformat
348*******     libavutil
349*******
350******* To remove this restriction remove the variant +nonfree
351*******
352"
353} elseif {[variant_isset gpl3]} {
354notes "
355*******
356******* This build of ${name} includes GPLed code and
357******* is therefore licensed under GPL v3 or later.
358*******
359******* The following modules are GPLed:
360*******
361*******      postproc
362*******      libsambaclient
363*******      libx264
364*******      libx265
365*******      libxvid
366*******      opencore-amr
367*******
368******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
369******* To remove nonfree and GPLed code leaving only LGPL code remove the
370******* +gpl2 and +gpl3 variants.
371*******
372"
373} elseif {[variant_isset gpl2]} {
374notes "
375*******
376******* This build of ${name} includes GPLed code and
377******* is therefore licensed under GPL v2 or later.
378*******
379******* The following modules are GPLed:
380*******
381*******      postproc
382*******      libx264
383*******      libx265
384*******      libxvid
385*******
386******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
387******* To remove nonfree and GPLed code leaving only LGPL code remove the
388******* +gpl2 variant.
389*******
390"
391} else {
392notes "
393*******
394******* This build of ${name} includes no GPLed or nonfree
395******* code and is therefore licensed under LGPL v2.1 or later.
396*******
397"
398}
399
400#
401#disable livecheck
402#
403
404livecheck.type      none
Note: See TracBrowser for help on using the repository browser.