Ticket #18793: Portfile

File Portfile, 6.4 KB (added by dbevans (David B. Evans), 16 years ago)

Proposed new 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 47640 2009-03-02 17:30:40Z devans@macports.org $
3
4PortSystem 1.0
5
6name            ffmpeg
7version         0.5
8epoch           1
9categories      multimedia
10maintainers     acho openmaintainer
11
12description     FFmpeg is a complete solution to play, record, convert and \
13                stream audio and video.
14
15long_description        FFmpeg is a complete solution to record, convert and \
16                        stream audio and video. It includes libavcodec, the \
17                        leading audio/video codec library. \
18                        \
19                        The project is made of several components: \
20                        \
21                        ffmpeg is a command line tool to convert one video \
22                        file format to another. It also supports grabbing and \
23                        encoding in real time from a TV card. \
24                        \
25                        ffserver is an HTTP (RTSP is being developped) \
26                        multimedia streaming server for live broadcasts. Time \
27                        shifting of live broadcast is also supported. \
28                        \
29                        ffplay is a simple media player based on SDL and on \
30                        the ffmpeg libraries. \
31                        \
32                        libavcodec is a library containing all the ffmpeg \
33                        audio/video encoders and decoders. Most codecs were \
34                        developped from scratch to ensure best performances \
35                        and high code reusability. \
36                        \
37                        libavformat is a library containing parsers and \
38                        generators for all common audio/video formats.
39
40platforms       darwin
41homepage        http://www.ffmpeg.org/
42master_sites    http://www.ffmpeg.org/releases/
43
44use_bzip2       yes
45
46checksums       md5     be8503f15c3b81ba00eb8379ca8dcf33 \
47                sha1    f930971bc0ac3d11a4ffbb1af439425c24f6f5b1 \
48                rmd160  23b4a591c422f98b634eba0ba82817ad27a4ff07
49
50patchfiles      patch-libavfilter-avfilter.h.diff \
51                patch-libswscale-Makefile.diff \
52                patch-libswscale-swscale.h.diff
53
54
55use_parallel_build yes
56
57depends_build   port:gmake
58
59depends_lib     port:lame \
60                port:libvorbis \
61                port:libogg \
62                port:libtheora \
63                port:dirac \
64                port:schroedinger \
65                port:faac \
66                port:faad2 \
67                port:XviD \
68                port:x264 \
69                port:libsdl \
70                port:bzip2 \
71                port:zlib
72
73build.cmd       gmake
74configure.compiler gcc-4.0
75
76configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
77configure.args \
78        --disable-vhook \
79        --enable-gpl \
80        --enable-postproc \
81        --enable-swscale --enable-avfilter --enable-avfilter-lavf \
82        --enable-libmp3lame \
83        --enable-libvorbis \
84        --enable-libtheora \
85        --enable-libdirac --enable-libschroedinger \
86        --enable-libfaac \
87        --enable-libfaad \
88        --enable-libxvid \
89        --enable-libx264 \
90        --mandir=${prefix}/share/man \
91        --enable-shared --enable-pthreads \
92        --disable-mmx \
93        --cc=gcc-4.0
94
95#add --enable-libopenjpeg when problems with openjpeg.h are resolved
96
97test.run        yes
98
99#
100# configure isn't autoconf and they do use a dep cache
101#
102
103universal_variant no
104
105post-destroot {
106    file mkdir ${destroot}${prefix}/share/doc/${name}
107    file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
108    foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
109        file copy $f ${destroot}${prefix}/share/doc/${name}
110    }
111}
112
113platform darwin i386 {
114    post-patch {
115        reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c
116    }
117}
118
119#
120# comments concerning mmx problems may be out of date
121# needs testing on i386 platform to verify
122#
123
124variant mmx description {enable mmx optimizations ; may not build in gcc-4.2 or xcode 3.0 gcc-4.0} {
125# make no-mmx default and allow mmx enabling for the brave.
126    configure.args-delete --disable-mmx
127# Fix Leopard problems by disabling the cavs decoder for now (is this still required?)
128    configure.args-append --disable-decoder=cavs
129}
130
131variant no_gpl description {disallow use of GPL code, license will be LGPL if +no_nonfree is selected} {
132    configure.args-delete   --enable-gpl
133    configure.args-delete   --enable-postproc
134    configure.args-delete   --enable-swscale
135    configure.args-delete   --enable-libfaad
136    depends_lib-delete      port:faad2
137    configure.args-delete   --enable-libx264
138    depends_build-delete      port:x264
139    configure.args-delete   --enable-libxvid
140    depends_lib-delete      port:XviD
141}
142
143#
144# make speex a variant since it requires speex version 1.2
145# which is currently only available via port speex-devel
146# remove variant and make default when 1.2 is available in speex
147#
148
149variant speex description {enable Speex decoding via libspeex} {
150    configure.args-append   --enable-libspeex
151    depends_lib-append      path:lib/libspeex.dylib:speex-devel
152}
153
154pre-configure {
155    if {[variant_isset speex]} {
156        if {![file exists ${prefix}/lib/libspeexdsp.dylib]} {
157            error "
158*******
159******* Variant speex requires port speex-devel but
160******* port speex is active.  Please deactivate port speex
161******* and install/activate port speex-devel then try
162******* again.
163*******
164"
165        }
166    }
167}
168
169post-activate {
170    if {![variant_isset no_gpl]} {
171        ui_msg "
172*******
173******* This build of ${name} includes GPLed code and
174******* is therefore licensed under GPL.
175*******
176******* The following modules are GPLed:
177*******
178*******      postproc
179*******      swscale
180*******      libfaad
181*******      libx264
182*******      libxvid
183*******
184******* To include only LGPLed code use variant +no_gpl
185*******
186"
187    } else {
188        ui_msg "
189*******
190******* This build of ${name} includes no GPLed
191******* code and is therefore licensed under LGPL.
192*******
193"
194    }
195}
196#
197#disable livecheck
198#
199
200livecheck.check regex
201livecheck.url   ${master_sites}
202livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"