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

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

ffmpeg:

  • update to latest (post-0.8.5) git master
  • remove ineffective +jack variant
  • enable JPEG2000 support via openjpeg
  • adds new libmodplug support
  • lavfi input device now available
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.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 84932 2011-10-04 23:22:47Z devans@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmpeg-devel
9conflicts       ffmpeg
10version         20111004
11license         GPL-2+ LGPL-2.1+
12categories      multimedia
13maintainers     devans openmaintainer
14
15fetch.type      git
16git.url         git://git.videolan.org/ffmpeg.git
17git.branch      751a4efd4d754b15ebc6027b09051f27860bb1e8
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 developped) \
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                        developped from scratch to ensure best performances \
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
53depends_build   port:pkgconfig \
54                port:gmake \
55                port:texi2html
56
57depends_lib     port:lame \
58                port:libvorbis \
59                port:libogg \
60                port:libtheora \
61                port:libmodplug \
62                port:dirac \
63                port:schroedinger \
64                port:openjpeg \
65                path:lib/libspeex.dylib:speex \
66                port:XviD \
67                port:x264 \
68                port:libvpx \
69                path:lib/pkgconfig/sdl.pc:libsdl \
70                port:bzip2 \
71                port:zlib
72
73build.cmd       ${prefix}/bin/gmake
74build.env-append V=1
75
76#
77# enable auto configure of mmx and related Intel optimizations by default
78# requires Xcode 3.1 or better on Leopard
79#
80minimum_xcodeversions {9 3.1}
81
82# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used
83# fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
84#
85# similarly clang fails to build on i386 platforms
86#
87# use code provided by jeremyhu here to use gcc-4.2 instead
88#
89# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
90#
91
92if {${configure.compiler} == "clang" ||
93    ${configure.compiler} == "llvm-gcc-4.2"} {
94    configure.compiler gcc-4.2
95    if {![file executable ${configure.cc}]} {
96        depends_build-append port:apple-gcc42
97        configure.compiler apple-gcc-4.2
98    }
99}
100
101configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
102configure.args \
103        --enable-gpl \
104        --enable-postproc \
105        --enable-swscale --enable-avfilter \
106        --enable-libmp3lame \
107        --enable-libvorbis \
108        --enable-libtheora \
109        --enable-libdirac --enable-libschroedinger \
110        --enable-libopenjpeg \
111        --enable-libmodplug \
112        --enable-libxvid \
113        --enable-libx264 \
114        --enable-libvpx \
115        --enable-libspeex \
116        --mandir=${prefix}/share/man \
117        --enable-shared --enable-pthreads \
118        --cc=${configure.cc}
119
120test.run        yes
121
122#
123# configure isn't autoconf and they do use a dep cache
124#
125
126post-destroot {
127    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
128    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
129    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
130    foreach f [glob ${worksrcpath}/doc/*.txt] {
131        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
132    }
133}
134
135platform powerpc {
136    # absence of altivec is not automatically detected
137    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
138        configure.args-append --disable-altivec
139    }
140}
141
142configure.universal_args-delete --disable-dependency-tracking
143
144if {[variant_isset universal]} {
145    foreach arch ${configure.universal_archs} {
146        lappend merger_configure_args($arch) --arch=${arch}
147        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
148    }
149    if {[string match "*86*" ${configure.universal_archs}]} {
150        depends_build-append port:yasm
151    }
152    lappend merger_configure_args(i386) --enable-yasm
153    lappend merger_configure_args(x86_64) --enable-yasm
154} else {
155    configure.args-append --arch=${configure.build_arch}
156    configure.env-append  ASFLAGS='[get_canonical_archflags]'
157    if {$build_arch == "i386" || $build_arch == "x86_64"} {
158        depends_build-append port:yasm
159        configure.args-append --enable-yasm
160    }
161}
162
163variant no_mmx description {disable all x86 asm optimizations} {
164    configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
165}
166
167variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
168    configure.args-delete   --enable-gpl \
169                            --enable-postproc \
170                            --enable-libx264 \
171                            --enable-libxvid
172    depends_lib-delete      port:XviD \
173                            port:x264
174    license-delete          GPL-2+
175}
176
177# the build server uses the default variants, and we want distributable binaries
178# nonfree code is disabled by default but can be enabled using the +nonfree variant
179
180variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
181    configure.args-append   --enable-nonfree \
182                            --enable-libfaac
183    depends_lib-append      port:faac
184    license-append          nonfree
185}
186
187if {[variant_isset nonfree]} {
188notes "
189*******
190******* This build of ${name} includes nonfree code as follows:
191*******
192*******     libfaac
193*******
194******* The following libraries and binaries may not be redistributed:
195*******
196*******     ffmpeg
197*******     libavcodec
198*******     libavdevice
199*******     libavfilter
200*******     libavformat
201*******     libavutil
202*******
203******* To remove this restriction remove the variant +nonfree
204*******
205"
206} elseif {![variant_isset no_gpl]} {
207notes "
208*******
209******* This build of ${name} includes GPLed code and
210******* is therefore licensed under GPL v2 or later.
211*******
212******* The following modules are GPLed:
213*******
214*******      postproc
215*******      libx264
216*******      libxvid
217*******
218******* To include all nonfree, GPLed and LGPL code use variant +nonfree
219******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
220*******
221"
222} else {
223notes "
224*******
225******* This build of ${name} includes no GPLed or nonfree
226******* code and is therefore licensed under LGPL v2.1 or later.
227*******
228"
229}
230
231#
232#disable livecheck
233#
234
235livecheck.type  none
Note: See TracBrowser for help on using the repository browser.