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

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

ffmpeg: as per suggestion from simon, back-port patch from ffmpeg trunk to allow ffmpeg to build with libx264 support using current (version 66) api, update activate message. Closes #18747.

  • 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 47772 2009-03-05 23:54:53Z devans@macports.org $
3
4PortSystem 1.0
5
6name            ffmpeg
7version         15261
8revision        5
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-libavcodec_libx264.c.diff \
41                patch-libavfilter-avfilter.h.diff \
42                patch-libswscale-Makefile.diff \
43                patch-libswscale-swscale.h.diff
44
45use_parallel_build  yes
46worksrcdir     trunk
47
48depends_build   bin:svn:subversion \
49                port:gmake
50
51depends_lib     port:lame \
52                port:libvorbis \
53                port:libogg \
54                port:libtheora \
55                port:x264 \
56                port:dirac \
57                port:schroedinger \
58                port:faac \
59                port:faad2 \
60                port:XviD \
61                port:libsdl \
62                port:bzip2 \
63                port:zlib
64
65build.cmd      gmake
66configure.compiler      gcc-4.0
67
68set svn_rev ${version}
69set libswscale_rev 27728
70
71pre-fetch {
72    if {[file isdirectory ${distpath}/${svn_rev}]} {
73        if {![file isdirectory ${distpath}/${svn_rev}/trunk/.svn] || ![file exists ${distpath}/${svn_rev}/trunk/.complete]} {
74             file delete -force ${distpath}/${svn_rev}
75        }
76    }
77}
78
79fetch {
80    if {![file isdirectory ${distpath}/${svn_rev}]} {
81        file mkdir ${distpath}/${svn_rev}
82        system "svn co -r${svn_rev} --ignore-externals svn://svn.ffmpeg.org/ffmpeg/trunk ${distpath}/${svn_rev}/trunk"
83        system "svn co -r${libswscale_rev} svn://svn.ffmpeg.org/mplayer/trunk/libswscale ${distpath}/${svn_rev}/trunk/libswscale"
84        system "touch ${distpath}/${svn_rev}/trunk/.complete"
85    }
86}
87
88extract {
89    file copy ${distpath}/${svn_rev}/trunk ${worksrcpath}
90}
91
92platforms       darwin
93
94configure.cflags-append -DHAVE_LRINTF ${configure.cppflags}
95configure.args \
96                --disable-vhook \
97                --enable-gpl \
98                --enable-swscale --enable-avfilter --enable-avfilter-lavf \
99                --enable-postproc \
100                --enable-libmp3lame \
101                --enable-libvorbis \
102                --enable-libtheora \
103                --enable-libdirac --enable-libschroedinger \
104                --enable-libfaac \
105                --enable-libfaad \
106                --enable-libx264 \
107                --enable-libxvid \
108                --mandir=${prefix}/share/man \
109                --enable-shared --enable-pthreads \
110                --disable-mmx \
111                --cc=gcc-4.0
112
113test.run        yes
114
115default_variants +a52
116
117# configure isn't autoconf and they do use a dep cache
118universal_variant no
119
120post-destroot {
121        file mkdir ${destroot}${prefix}/share/doc/${name}
122        file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
123        foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
124                file copy $f ${destroot}${prefix}/share/doc/${name}
125        }
126}
127
128platform darwin i386 {
129        post-patch {
130                reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c
131        }
132}
133
134variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} {
135# make no-mmx default and allow mmx enabling for the brave.
136        configure.args-delete --disable-mmx
137# Fix Leopard problems by disabling the cavs decoder for now
138        configure.args-append --disable-decoder=cavs
139}
140
141variant a52 description {enable GPLed liba52 support} {
142        depends_lib-append port:a52dec
143        configure.args-append --enable-liba52
144        post-destroot {
145                file mkdir ${destroot}${prefix}/include/ffmpeg
146                foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] {
147        regsub -all $destroot ${f} "" srclink
148        ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end]
149                }
150               
151        }
152}
153
154variant no_gpl conflicts a52 description {disallow use of GPL code, license will be LGPL} {
155    configure.args-delete   --enable-gpl
156    configure.args-delete   --enable-postproc
157    configure.args-delete   --enable-swscale
158    configure.args-delete   --enable-libfaad
159    depends_lib-delete      port:faad2
160    configure.args-delete   --enable-libxvid
161    depends_lib-delete      port:XviD
162}
163
164post-activate {
165    if {![variant_isset no_gpl]} {
166        ui_msg "
167*******
168******* This build of ${name} includes GPLed code and
169******* is therefore licensed under GPL.
170*******
171******* The following modules are GPLed:
172*******
173*******      postproc
174*******      swscale
175*******      liba52
176*******      libfaad
177*******      libx264
178*******      libxvid
179*******
180******* To include only LGPLed code use variants +no_gpl -a52
181*******
182"
183    } else {
184        ui_msg "
185*******
186******* This build of ${name} includes no GPLed
187******* code and is therefore licensed under LGPL.
188*******
189"
190    }
191}
192
193#
194#disable livecheck
195#
196
197livecheck.check none
Note: See TracBrowser for help on using the repository browser.