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

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

Fix for displaying version number. Closes ticket #16589.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1# $Id: Portfile 40473 2008-10-02 18:33:51Z macsforever2000@macports.org $
2
3PortSystem 1.0
4
5name            ffmpeg
6version         0.4.9-pre1
7revision        12
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
37distfiles
38use_parallel_build  yes
39worksrcdir     trunk
40depends_build  bin:svn:subversion port:gmake
41build.cmd      gmake
42configure.compiler      gcc-4.0
43
44set svn_rev 14381
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 -r27349 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
75pre-configure {
76        if {[variant_isset universal]} {
77                configure.args-delete --disable-dependency-tracking
78        }
79}
80post-destroot {
81        file mkdir ${destroot}${prefix}/share/doc/${name}
82        file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
83        foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
84                file copy $f ${destroot}${prefix}/share/doc/${name}
85        }
86}
87
88platform darwin i386 {
89        post-patch {
90                reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c
91        }
92}
93
94variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} {
95# make no-mmx default and allow mmx enabling for the brave.
96        configure.args-delete --disable-mmx
97# Fix Leopard problems by disabling the cavs decoder for now
98        configure.args-append --disable-decoder=cavs
99}
100
101variant gpl description {allow use of GPL code, the resulting libav* and ffmpeg will be under GPL} {
102        configure.args-append --enable-gpl
103}
104
105variant postproc requires gpl description {enable GPLed postprocessing support} {
106        configure.args-append --enable-postproc
107}
108
109# Adds MP3 support
110variant lame description {enable MP3 encoding via libmp3lame} {
111        depends_lib-append port:lame
112        configure.args-append --enable-libmp3lame
113}
114
115variant extvorbis description {enable Vorbis encoding via libvorbis, native implementation exists} {
116        depends_lib-append port:libvorbis port:libogg
117        configure.args-append --enable-libvorbis
118}
119
120variant theora description {enable Theora encoding via libtheora} {
121        depends_lib-append port:libtheora port:libogg
122        configure.args-append --enable-libtheora
123}
124
125variant faac requires gpl description {enable FAAC support via libfaac} {
126        depends_lib-append port:faac
127        configure.args-append --enable-libfaac
128}
129
130variant faad requires gpl description {enable FAAD support via libfaad} {
131        depends_lib-append port:faad2
132        configure.args-append --enable-libfaad
133}
134
135variant xvid requires gpl description {enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists} {
136        depends_lib-append port:XviD
137        configure.args-append --enable-libxvid
138}
139
140# depends build until x264 port supports shared libraries
141variant x264 requires gpl description {enable H.264 encoding via x264} {
142        depends_build-append port:x264
143        configure.args-append --enable-libx264
144}
145
146variant a52 requires gpl description {enable GPLed liba52 support} {
147        depends_lib-append port:a52dec
148        configure.args-append --enable-liba52
149        post-destroot {
150                file mkdir ${destroot}${prefix}/include/ffmpeg
151                foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] {
152        regsub -all $destroot ${f} "" srclink
153        ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end]
154                }
155               
156        }
157}
158variant avfilter requires gpl description {video filter support (replaces vhook)} {
159        patchfiles-append patch-libswscale-Makefile.diff \
160                patch-configure.diff
161        configure.args-append --enable-swscale --enable-avfilter
162
163        # keep vhook as long as avfilter isnt working fully
164        configure.args-delete --disable-vhook
165}
Note: See TracBrowser for help on using the repository browser.