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

Last change on this file since 43093 was 43093, checked in by simon@…, 11 years ago

multimedia/ffmpeg: Updated to "stable" SVN version, maintainer timeout.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1# $Id: Portfile 43093 2008-12-04 20:21:12Z simon@macports.org $
2
3PortSystem 1.0
4
5name            ffmpeg
6version         15261
7categories      multimedia
8maintainers     acho@macports.org openmaintainer
9description     Digital VCR and streaming server
10long_description        FFmpeg is a complete solution to record, convert and \
11                        stream audio and video. It includes libavcodec, the \
12                        leading audio/video codec library. \
13                        \
14                        The project is made of several components: \
15                        \
16                        ffmpeg is a command line tool to convert one video \
17                        file format to another. It also supports grabbing and \
18                        encoding in real time from a TV card. \
19                        \
20                        ffserver is an HTTP (RTSP is being developped) \
21                        multimedia streaming server for live broadcasts. Time \
22                        shifting of live broadcast is also supported. \
23                        \
24                        ffplay is a simple media player based on SDL and on \
25                        the ffmpeg libraries. \
26                        \
27                        libavcodec is a library containing all the ffmpeg \
28                        audio/video encoders and decoders. Most codecs were \
29                        developped from scratch to ensure best performances \
30                        and high code reusability. \
31                        \
32                        libavformat is a library containing parsers and \
33                        generators for all common audio/video formats.
34homepage        http://ffmpeg.mplayerhq.hu/
35master_sites
36distfiles
37use_parallel_build  yes
38worksrcdir     trunk
39depends_build  bin:svn:subversion port:gmake
40build.cmd      gmake
41configure.compiler      gcc-4.0
42
43set svn_rev ${version}
44set libswscale_rev 27728
45
46pre-fetch {
47    if {[file isdirectory ${distpath}/${svn_rev}]} {
48        if {![file isdirectory ${distpath}/${svn_rev}/trunk/.svn]} {
49             file delete -force ${distpath}/${svn_rev}
50        }
51    }
52}
53
54fetch {
55    if {![file isdirectory ${distpath}/${svn_rev}]} {
56        file mkdir ${distpath}/${svn_rev}
57        system "svn co -r${svn_rev} --ignore-externals svn://svn.mplayerhq.hu/ffmpeg/trunk ${distpath}/${svn_rev}/trunk"
58        system "svn co -r${libswscale_rev} svn://svn.mplayerhq.hu/mplayer/trunk/libswscale ${distpath}/${svn_rev}/trunk/libswscale"
59    }
60}
61
62extract {
63    file copy ${distpath}/${svn_rev}/trunk ${worksrcpath}
64}
65
66platforms       darwin
67configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
68configure.args  --disable-vhook \
69                --mandir=${prefix}/share/man \
70                --enable-shared --enable-pthreads \
71                --disable-mmx --cc=gcc-4.0
72
73default_variants        +a52
74
75# configure isn't autoconf and they do use a dep cache
76universal_variant no
77
78post-destroot {
79        file mkdir ${destroot}${prefix}/share/doc/${name}
80        file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
81        foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
82                file copy $f ${destroot}${prefix}/share/doc/${name}
83        }
84}
85
86platform darwin i386 {
87        post-patch {
88                reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c
89        }
90}
91
92variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} {
93# make no-mmx default and allow mmx enabling for the brave.
94        configure.args-delete --disable-mmx
95# Fix Leopard problems by disabling the cavs decoder for now
96        configure.args-append --disable-decoder=cavs
97}
98
99variant gpl description {allow use of GPL code, the resulting libav* and ffmpeg will be under GPL} {
100        configure.args-append --enable-gpl
101}
102
103variant postproc requires gpl description {enable GPLed postprocessing support} {
104        configure.args-append --enable-postproc
105}
106
107# Adds MP3 support
108variant lame description {enable MP3 encoding via libmp3lame} {
109        depends_lib-append port:lame
110        configure.args-append --enable-libmp3lame
111}
112
113variant extvorbis description {enable Vorbis encoding via libvorbis, native implementation exists} {
114        depends_lib-append port:libvorbis port:libogg
115        configure.args-append --enable-libvorbis
116}
117
118variant theora description {enable Theora encoding via libtheora} {
119        depends_lib-append port:libtheora port:libogg
120        configure.args-append --enable-libtheora
121}
122
123variant faac requires gpl description {enable FAAC support via libfaac} {
124        depends_lib-append port:faac
125        configure.args-append --enable-libfaac
126}
127
128variant faad requires gpl description {enable FAAD support via libfaad} {
129        depends_lib-append port:faad2
130        configure.args-append --enable-libfaad
131}
132
133variant xvid requires gpl description {enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists} {
134        depends_lib-append port:XviD
135        configure.args-append --enable-libxvid
136}
137
138# depends build until x264 port supports shared libraries
139variant x264 requires gpl description {enable H.264 encoding via x264} {
140        depends_build-append port:x264
141        configure.args-append --enable-libx264
142}
143
144variant a52 requires gpl description {enable GPLed liba52 support} {
145        depends_lib-append port:a52dec
146        configure.args-append --enable-liba52
147        post-destroot {
148                file mkdir ${destroot}${prefix}/include/ffmpeg
149                foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] {
150        regsub -all $destroot ${f} "" srclink
151        ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end]
152                }
153               
154        }
155}
156
157variant avfilter requires gpl description {video filter support (replaces vhook)} {
158        patchfiles-append patch-libswscale-Makefile.diff \
159                patch-configure.diff
160        configure.args-append --enable-swscale --enable-avfilter
161
162        # keep vhook as long as avfilter isnt working fully
163        configure.args-delete --disable-vhook
164}
165
166#disable livecheck
167livecheck.check none
Note: See TracBrowser for help on using the repository browser.