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

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

ffmpeg, ffmpeg-devel: update urls to use domain ffmpeg.org, see #18520.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.0 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 46923 2009-02-17 16:10:45Z devans@macports.org $
3
4PortSystem 1.0
5
6name            ffmpeg
7version         15261
8revision        4
9categories      multimedia
10maintainers     acho@macports.org openmaintainer
11description     Digital VCR and streaming server
12long_description        FFmpeg is a complete solution to record, convert and \
13                        stream audio and video. It includes libavcodec, the \
14                        leading audio/video codec library. \
15                        \
16                        The project is made of several components: \
17                        \
18                        ffmpeg is a command line tool to convert one video \
19                        file format to another. It also supports grabbing and \
20                        encoding in real time from a TV card. \
21                        \
22                        ffserver is an HTTP (RTSP is being developped) \
23                        multimedia streaming server for live broadcasts. Time \
24                        shifting of live broadcast is also supported. \
25                        \
26                        ffplay is a simple media player based on SDL and on \
27                        the ffmpeg libraries. \
28                        \
29                        libavcodec is a library containing all the ffmpeg \
30                        audio/video encoders and decoders. Most codecs were \
31                        developped from scratch to ensure best performances \
32                        and high code reusability. \
33                        \
34                        libavformat is a library containing parsers and \
35                        generators for all common audio/video formats.
36homepage        http://www.ffmpeg.org/
37master_sites
38distfiles
39patchfiles      patch-libavcodec_ppc_check_altivec.c.diff \
40                patch-libavfilter-avfilter.h.diff \
41                patch-libswscale-Makefile.diff \
42                patch-libswscale-swscale.h.diff
43
44use_parallel_build  yes
45worksrcdir     trunk
46
47depends_build   bin:svn:subversion \
48                port:gmake
49
50depends_lib     port:lame \
51                port:libvorbis \
52                port:libogg \
53                port:libtheora \
54                port:dirac \
55                port:schroedinger \
56                port:faac \
57                port:faad2 \
58                port:XviD \
59                port:libsdl \
60                port:bzip2 \
61                port:zlib
62
63build.cmd      gmake
64configure.compiler      gcc-4.0
65
66set svn_rev ${version}
67set libswscale_rev 27728
68
69pre-fetch {
70    if {[file isdirectory ${distpath}/${svn_rev}]} {
71        if {![file isdirectory ${distpath}/${svn_rev}/trunk/.svn] || ![file exists ${distpath}/${svn_rev}/trunk/.complete]} {
72             file delete -force ${distpath}/${svn_rev}
73        }
74    }
75}
76
77fetch {
78    if {![file isdirectory ${distpath}/${svn_rev}]} {
79        file mkdir ${distpath}/${svn_rev}
80        system "svn co -r${svn_rev} --ignore-externals svn://svn.ffmpeg.org/ffmpeg/trunk ${distpath}/${svn_rev}/trunk"
81        system "svn co -r${libswscale_rev} svn://svn.ffmpeg.org/mplayer/trunk/libswscale ${distpath}/${svn_rev}/trunk/libswscale"
82        system "touch ${distpath}/${svn_rev}/trunk/.complete"
83    }
84}
85
86extract {
87    file copy ${distpath}/${svn_rev}/trunk ${worksrcpath}
88}
89
90platforms       darwin
91
92configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
93configure.args \
94                --disable-vhook \
95                --enable-gpl \
96                --enable-swscale --enable-avfilter --enable-avfilter-lavf \
97                --enable-postproc \
98                --enable-libmp3lame \
99                --enable-libvorbis \
100                --enable-libtheora \
101                --enable-libdirac --enable-libschroedinger \
102                --enable-libfaac \
103                --enable-libfaad \
104                --enable-libxvid \
105                --mandir=${prefix}/share/man \
106                --enable-shared --enable-pthreads \
107                --disable-mmx \
108                --cc=gcc-4.0
109
110test.run        yes
111
112default_variants +a52
113
114# configure isn't autoconf and they do use a dep cache
115universal_variant no
116
117post-destroot {
118        file mkdir ${destroot}${prefix}/share/doc/${name}
119        file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
120        foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
121                file copy $f ${destroot}${prefix}/share/doc/${name}
122        }
123}
124
125platform darwin i386 {
126        post-patch {
127                reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c
128        }
129}
130
131variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} {
132# make no-mmx default and allow mmx enabling for the brave.
133        configure.args-delete --disable-mmx
134# Fix Leopard problems by disabling the cavs decoder for now
135        configure.args-append --disable-decoder=cavs
136}
137
138variant a52 description {enable GPLed liba52 support} {
139        depends_lib-append port:a52dec
140        configure.args-append --enable-liba52
141        post-destroot {
142                file mkdir ${destroot}${prefix}/include/ffmpeg
143                foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] {
144        regsub -all $destroot ${f} "" srclink
145        ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end]
146                }
147               
148        }
149}
150
151variant no_gpl conflicts a52 description {disallow use of GPL code, license will be LGPL} {
152    configure.args-delete   --enable-gpl
153    configure.args-delete   --enable-postproc
154    configure.args-delete   --enable-swscale
155    configure.args-delete   --enable-libfaad
156    depends_lib-delete      port:faad2
157    configure.args-delete   --enable-libxvid
158    depends_lib-delete      port:XviD
159}
160
161post-activate {
162    if {![variant_isset no_gpl]} {
163        ui_msg "
164*******
165******* This build of ${name} includes GPLed code and
166******* is therefore licensed under GPL.
167*******
168******* The following modules are GPLed:
169*******
170*******      postproc
171*******      swscale
172*******      liba52
173*******      libfaad
174*******      libx264 (disabled due to API changes in latest x264, use ffmpeg-devel)
175*******      libxvid
176*******
177******* To include only LGPLed code use variants +no_gpl -a52
178*******
179"
180    } else {
181        ui_msg "
182*******
183******* This build of ${name} includes no GPLed
184******* code and is therefore licensed under LGPL.
185*******
186"
187    }
188}
189
190#
191#disable livecheck
192#
193
194livecheck.check none
Note: See TracBrowser for help on using the repository browser.