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

Last change on this file since 35765 was 35765, checked in by reiffert@…, 12 years ago

ffmpeg: Add missing $worksrcpath in post-patch

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1# $Id: Portfile 35765 2008-04-05 11:21:18Z reiffert@macports.org $
2
3PortSystem 1.0
4
5name            ffmpeg
6version         0.4.9-pre1
7revision        7
8categories      multimedia
9maintainers     acho@macports.org openmaintainer
10description     Digital VCR and streaming server
11long_description        FFmpeg is a complete solution to record, convert and \
12                        stream audio and video. It includes libavcodec, the \
13                        leading audio/video codec library. \
14                        \
15                        The project is made of several components: \
16                        \
17                        ffmpeg is a command line tool to convert one video \
18                        file format to another. It also supports grabbing and \
19                        encoding in real time from a TV card. \
20                        \
21                        ffserver is an HTTP (RTSP is being developped) \
22                        multimedia streaming server for live broadcasts. Time \
23                        shifting of live broadcast is also supported. \
24                        \
25                        ffplay is a simple media player based on SDL and on \
26                        the ffmpeg libraries. \
27                        \
28                        libavcodec is a library containing all the ffmpeg \
29                        audio/video encoders and decoders. Most codecs were \
30                        developped from scratch to ensure best performances \
31                        and high code reusability. \
32                        \
33                        libavformat is a library containing parsers and \
34                        generators for all common audio/video formats.
35homepage        http://ffmpeg.sourceforge.net/
36master_sites    {}
37fetch.type     svn
38svn.url        svn://svn.mplayerhq.hu/ffmpeg/trunk
39svn.tag        12276
40worksrcdir     trunk
41depends_build  bin:svn:subversion
42
43platforms       darwin
44configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
45configure.args  --prefix=${prefix} --disable-vhook \
46                --mandir=${prefix}/share/man \
47                --enable-shared --enable-pthreads
48
49default_variants        +a52
50
51pre-configure {
52        if {[variant_isset universal]} {
53                configure.args-delete --disable-dependency-tracking
54        }
55}
56post-destroot {
57        file mkdir ${destroot}${prefix}/share/doc/${name}
58        file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
59        foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
60                file copy $f ${destroot}${prefix}/share/doc/${name}
61        }
62}
63
64platform darwin i386 {
65        # Fix Leopard problems by disabling assembly for now; see #13019.
66        configure.args-append --disable-mmx
67        post-patch {
68                reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c
69        }
70}
71
72variant gpl description {allow use of GPL code, the resulting libav* and ffmpeg will be under GPL} {
73        configure.args-append --enable-gpl
74}
75
76variant postproc requires gpl description {enable GPLed postprocessing support} {
77        configure.args-append --enable-pp
78}
79
80# Adds MP3 support
81variant lame description {enable MP3 encoding via libmp3lame} {
82        depends_lib-append port:lame
83        configure.args-append --enable-libmp3lame
84}
85
86variant extvorbis description {enable Vorbis encoding via libvorbis, native implementation exists} {
87        depends_lib-append port:libvorbis port:libogg
88        configure.args-append --enable-libvorbis
89}
90
91variant theora description {enable Theora encoding via libtheora} {
92        depends_lib-append port:libtheora port:libogg
93        configure.args-append --enable-libtheora
94}
95
96variant faac requires gpl description {enable FAAC support via libfaac} {
97        depends_lib-append port:faac
98        configure.args-append --enable-libfaac
99}
100
101variant faad requires gpl description {enable FAAD support via libfaad} {
102        depends_lib-append port:faad2
103        configure.args-append --enable-libfaad
104}
105
106variant xvid requires gpl description {enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists} {
107        depends_lib-append port:XviD
108        configure.args-append --enable-libxvid
109}
110
111# depends build until x264 port supports shared libraries
112variant x264 requires gpl description {enable H.264 encoding via x264} {
113        depends_build-append port:x264
114        configure.args-append --enable-libx264
115}
116
117variant a52 requires gpl description {enable GPLed liba52 support} {
118        depends_lib-append port:a52dec
119        configure.args-append --enable-liba52
120        post-destroot {
121                file mkdir ${destroot}${prefix}/include/ffmpeg
122                foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] {
123        regsub -all $destroot ${f} "" srclink
124        ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end]
125                }
126               
127        }
128}
129variant avfilter requires gpl description {video filter support (replaces vhook)} {
130        patchfiles-append patch-libswscale-Makefile.diff \
131                patch-Makefile.diff patch-libavfilter-Makefile.diff
132        configure.args-append --enable-swscaler --enable-avfilter
133
134        # keep vhook as long as avfilter isnt working fully
135        configure.args-delete --disable-vhook
136}
Note: See TracBrowser for help on using the repository browser.