Ticket #34289: Portfile

File Portfile, 8.3 KB (added by jonasjonas (Frank Hellenkamp), 11 years ago)

Portfile

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 91842 2012-04-11 20:18:16Z jeremyhu@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmpeg-devel
9conflicts       ffmpeg
10version         20120329
11set git_branch  d3d5e84f33496f7c6ed704d53998db97a69f02e8
12license         GPL-2+
13categories      multimedia
14maintainers     devans jeremyhu openmaintainer
15
16description     FFmpeg is a complete solution to play, record, convert and \
17                stream audio and video.
18
19long_description        FFmpeg is a complete solution to record, convert and \
20                        stream audio and video. It includes libavcodec, the \
21                        leading audio/video codec library. \
22                        \
23                        The project is made of several components: \
24                        \
25                        ffmpeg is a command line tool to convert one video \
26                        file format to another. It also supports grabbing and \
27                        encoding in real time from a TV card. \
28                        \
29                        ffserver is an HTTP (RTSP is being developped) \
30                        multimedia streaming server for live broadcasts. Time \
31                        shifting of live broadcast is also supported. \
32                        \
33                        ffplay is a simple media player based on SDL and on \
34                        the ffmpeg libraries. \
35                        \
36                        ffprobe gathers information from multimedia streams and \
37                        prints it in human- and machine-readable fashion. \
38                        \
39                        libavcodec is a library containing all the ffmpeg \
40                        audio/video encoders and decoders. Most codecs were \
41                        developped from scratch to ensure best performances \
42                        and high code reusability. \
43                        \
44                        libavformat is a library containing parsers and \
45                        generators for all common audio/video formats.
46
47platforms       darwin
48homepage        http://www.ffmpeg.org/
49master_sites    "http://git.videolan.org/gitweb.cgi?p=ffmpeg.git;a=snapshot;h=${git_branch};sf=tgz;dummy="
50dist_subdir     ffmpeg
51
52depends_build   port:pkgconfig \
53                port:gmake \
54                port:texi2html
55
56depends_lib     port:lame \
57                port:libvorbis \
58                port:libogg \
59                port:libtheora \
60                port:libmodplug \
61                port:dirac \
62                port:schroedinger \
63                port:openjpeg \
64                path:lib/libspeex.dylib:speex \
65                port:XviD \
66                port:x264 \
67                port:libvpx \
68                path:lib/pkgconfig/sdl.pc:libsdl \
69                port:bzip2 \
70                port:zlib
71
72if {[string length "${git_branch}"] >= 7} {
73    set filetag [string range "${git_branch}" 0 6]
74    distname ffmpeg-${filetag}
75} else {
76    error "git branch hash must be at least 7 characters long."
77}
78
79checksums           sha1    64cf20d99666de94b54e05bad9c2e8a4161a2912 \
80                    rmd160  1fd0365a277de963ac81a6dfbce17fddb671ad5a \
81                    sha256  e8f11708bc74be3f754e6f2a20c0982e50a3d556142ae7b4ad7a88c6c27c366e
82
83build.cmd       ${prefix}/bin/gmake
84build.env-append V=1
85build.target-append alltools
86
87#
88# enable auto configure of mmx and related Intel optimizations by default
89# requires Xcode 3.1 or better on Leopard
90#
91minimum_xcodeversions {9 3.1}
92
93# And similarly, disable mmx on Tiger
94platform darwin {
95    if {${os.major} < 9} {
96        default_variants -mmx
97    } else {
98        default_variants +mmx
99    }
100} 
101
102configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
103configure.args \
104        --enable-gpl \
105        --enable-postproc \
106        --enable-swscale --enable-avfilter \
107        --enable-libmp3lame \
108        --enable-libvorbis \
109        --enable-libtheora \
110        --enable-libdirac --enable-libschroedinger \
111        --enable-libopenjpeg \
112        --enable-libmodplug \
113        --enable-libxvid \
114        --enable-libx264 \
115        --enable-libvpx \
116        --enable-libspeex \
117        --disable-mmx \
118        --disable-mmx2 \
119        --disable-sse \
120        --disable-ssse3 \
121        --disable-amd3dnow \
122        --disable-amd3dnowext \
123        --mandir=${prefix}/share/man \
124        --enable-shared --enable-pthreads \
125        --cc=${configure.cc}
126
127test.run        yes
128
129#
130# configure isn't autoconf and they do use a dep cache
131#
132
133post-destroot {
134    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
135    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
136    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
137    foreach f [glob ${worksrcpath}/doc/*.txt] {
138        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
139    }
140    file copy ${worksrcpath}/tools/qt-faststart ${destroot}${prefix}/bin
141}
142
143platform powerpc {
144    # absence of altivec is not automatically detected
145    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
146        configure.args-append --disable-altivec
147    }
148}
149
150platform darwin 8 {
151    post-patch {
152        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
153    }
154}
155
156configure.universal_args-delete --disable-dependency-tracking
157
158if {[variant_isset universal]} {
159    foreach arch ${configure.universal_archs} {
160        set merger_host($arch) ""
161        lappend merger_configure_args($arch) --arch=${arch}
162        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
163    }
164    if {[string match "*86*" ${configure.universal_archs}]} {
165        depends_build-append port:yasm
166    }
167    lappend merger_configure_args(i386) --enable-yasm
168    lappend merger_configure_args(x86_64) --enable-yasm
169} else {
170    configure.args-append --arch=${configure.build_arch}
171    configure.env-append  ASFLAGS='[get_canonical_archflags]'
172    if {$build_arch == "i386" || $build_arch == "x86_64"} {
173        depends_build-append port:yasm
174        configure.args-append --enable-yasm
175    }
176}
177
178variant mmx description {enable all supported x86 asm optimizations} {
179    configure.args-delete --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
180}
181
182variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
183    configure.args-delete   --enable-gpl \
184                            --enable-postproc \
185                            --enable-libx264 \
186                            --enable-libxvid
187    depends_lib-delete      port:XviD \
188                            port:x264
189    license-delete          GPL-2+
190    license-append          LGPL-2.1+
191}
192
193# the build server uses the default variants, and we want distributable binaries
194# nonfree code is disabled by default but can be enabled using the +nonfree variant
195
196variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
197    configure.args-append   --enable-nonfree \
198                            --enable-libfaac
199    depends_lib-append      port:faac
200    license-delete          GPL-2+
201    license-append          Restrictive
202}
203
204if {[variant_isset nonfree]} {
205notes "
206*******
207******* This build of ${name} includes nonfree code as follows:
208*******
209*******     libfaac
210*******
211******* The following libraries and binaries may not be redistributed:
212*******
213*******     ffmpeg
214*******     libavcodec
215*******     libavdevice
216*******     libavfilter
217*******     libavformat
218*******     libavutil
219*******
220******* To remove this restriction remove the variant +nonfree
221*******
222"
223} elseif {![variant_isset no_gpl]} {
224notes "
225*******
226******* This build of ${name} includes GPLed code and
227******* is therefore licensed under GPL v2 or later.
228*******
229******* The following modules are GPLed:
230*******
231*******      postproc
232*******      libx264
233*******      libxvid
234*******
235******* To include all nonfree, GPLed and LGPL code use variant +nonfree
236******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
237*******
238"
239} else {
240notes "
241*******
242******* This build of ${name} includes no GPLed or nonfree
243******* code and is therefore licensed under LGPL v2.1 or later.
244*******
245"
246}
247
248#
249#disable livecheck
250#
251
252livecheck.type  none