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

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

ffmpeg: update to version 1.0.1.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.6 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 100262 2012-12-06 05:08:57Z devans@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmpeg
9conflicts       ffmpeg-devel
10epoch           1
11version         1.0.1
12set branch      [join [lrange [split ${version} .] 0 1] .]
13license         LGPL-2.1+
14categories      multimedia
15maintainers     devans jeremyhu openmaintainer
16
17description     FFmpeg is a complete solution to play, record, convert and \
18                stream audio and video.
19
20long_description        FFmpeg is a complete solution to record, convert and \
21                        stream audio and video. It includes libavcodec, the \
22                        leading audio/video codec library. \
23                        \
24                        The project is made of several components: \
25                        \
26                        ffmpeg is a command line tool to convert one video \
27                        file format to another. It also supports grabbing and \
28                        encoding in real time from a TV card. \
29                        \
30                        ffserver is an HTTP (RTSP is being developed) \
31                        multimedia streaming server for live broadcasts. Time \
32                        shifting of live broadcast is also supported. \
33                        \
34                        ffplay is a simple media player based on SDL and on \
35                        the ffmpeg libraries. \
36                        \
37                        ffprobe gathers information from multimedia streams and \
38                        prints it in human- and machine-readable fashion. \
39                        \
40                        libavcodec is a library containing all the ffmpeg \
41                        audio/video encoders and decoders. Most codecs were \
42                        developed from scratch to ensure best performance \
43                        and high code reusability. \
44                        \
45                        libavformat is a library containing parsers and \
46                        generators for all common audio/video formats.
47
48platforms       darwin
49homepage        http://www.ffmpeg.org/
50master_sites    http://www.ffmpeg.org/releases/
51
52use_bzip2       yes
53
54checksums       sha256  758840dcfc94eb7fd6263718d26408658a59422e5fb8ac4de8e7ecf0cbed6e76 \
55                rmd160  363ba32002ed79def6d0f160975b751d15818c1e
56
57depends_build   port:pkgconfig \
58                port:gmake \
59                port:texi2html
60
61depends_lib     port:lame \
62                port:libvorbis \
63                port:libopus \
64                port:libogg \
65                port:libtheora \
66                port:libmodplug \
67                port:jack \
68                port:dirac \
69                port:schroedinger \
70                port:openjpeg \
71                port:freetype \
72                path:lib/libspeex.dylib:speex \
73                port:libvpx \
74                path:lib/pkgconfig/sdl.pc:libsdl \
75                port:bzip2 \
76                port:zlib
77
78build.cmd       ${prefix}/bin/gmake
79build.env-append V=1
80
81#
82# enable auto configure of asm optimizations
83# requires Xcode 3.1 or better on Leopard
84#
85minimum_xcodeversions {9 3.1}
86
87# And similarly, disable asm on Tiger
88platform darwin {
89    if {${os.major} < 9} {
90        configure.args-append --disable-asm
91    }
92}
93
94# The old ffmpeg port was GPL-2+ as base and had a no_gpl variant, so this keeps us consistent
95# Also, -gpl2 causes other ports to fail to build due to the missing libpostproc (#35473)
96default_variants-append +gpl2
97
98configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
99configure.args \
100        --enable-swscale --enable-avfilter \
101        --enable-libmp3lame \
102        --enable-libvorbis \
103        --enable-libopus \
104        --enable-libtheora \
105        --enable-libschroedinger \
106        --enable-libopenjpeg \
107        --enable-libmodplug \
108        --enable-libvpx \
109        --enable-libspeex \
110        --enable-libfreetype \
111        --mandir=${prefix}/share/man \
112        --enable-shared --enable-pthreads \
113        --cc=${configure.cc}
114
115test.run        yes
116
117#
118# configure isn't autoconf and they do use a dep cache
119#
120
121post-destroot {
122    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
123    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
124    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
125    foreach f [glob ${worksrcpath}/doc/*.txt] {
126        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
127    }
128}
129
130platform powerpc {
131    # absence of altivec is not automatically detected
132    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
133        configure.args-append --disable-altivec
134    }
135}
136
137platform darwin 8 {
138    post-patch {
139        reinplace "s:,-compatibility_version,$\(LIBMAJOR\)::" ${worksrcpath}/configure
140    }
141}
142
143configure.universal_args-delete --disable-dependency-tracking
144
145if {[variant_isset universal]} {
146    foreach arch ${configure.universal_archs} {
147        set merger_host($arch) ""
148        lappend merger_configure_args($arch) --arch=${arch}
149        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
150    }
151    if {[string match "*86*" ${configure.universal_archs}]} {
152        depends_build-append port:yasm
153    }
154    lappend merger_configure_args(i386) --enable-yasm
155    lappend merger_configure_args(x86_64) --enable-yasm
156} else {
157    configure.args-append --arch=${configure.build_arch}
158    configure.env-append  ASFLAGS='[get_canonical_archflags]'
159    if {$build_arch == "i386" || $build_arch == "x86_64"} {
160        depends_build-append port:yasm
161        configure.args-append --enable-yasm
162    }
163}
164
165variant gpl2 description {Enable GPL code, license will be GPL-2+} {
166    configure.args-append   --enable-gpl \
167                            --enable-postproc \
168                            --enable-libx264 \
169                            --enable-libxvid
170    depends_lib-append      port:XviD \
171                            port:x264
172    license-delete          LGPL-2.1+
173    license-append          GPL-2+
174}
175
176variant gpl3 requires gpl2 description {Enable GPL code, license will be GPL-3+} {
177    configure.args-delete   --disable-libopencore-amrnb \
178                            --disable-libopencore-amrwb
179    configure.args-append   --enable-version3 \
180                            --enable-libopencore-amrnb \
181                            --enable-libopencore-amrwb
182    depends_lib-append      port:opencore-amr
183    license-delete          LGPL-2.1+
184    license-append          GPL-3+
185}
186
187
188# the build server uses the default variants, and we want distributable binaries
189# nonfree code is disabled by default but can be enabled using the +nonfree variant
190
191variant nonfree description {enable nonfree code, libraries and binaries will not be redistributable} {
192    configure.args-append   --enable-nonfree \
193                            --enable-libfaac
194    depends_lib-append      port:faac
195    license-delete          LGPL-2.1+
196    license-append          Restrictive
197}
198
199if {[variant_isset nonfree]} {
200notes "
201*******
202******* This build of ${name} includes nonfree code as follows:
203*******
204*******     libfaac
205*******
206******* The following libraries and binaries may not be redistributed:
207*******
208*******     ffmpeg
209*******     libavcodec
210*******     libavdevice
211*******     libavfilter
212*******     libavformat
213*******     libavutil
214*******
215******* To remove this restriction remove the variant +nonfree
216*******
217"
218} elseif {[variant_isset gpl3]} {
219notes "
220*******
221******* This build of ${name} includes GPLed code and
222******* is therefore licensed under GPL v3 or later.
223*******
224******* The following modules are GPLed:
225*******
226*******      postproc
227*******      libx264
228*******      libxvid
229*******      opencore-amr
230*******
231******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
232******* To remove nonfree and GPLed code leaving only LGPL code remove the
233******* +gpl2 and +gpl3 variants.
234*******
235"
236} elseif {[variant_isset gpl2]} {
237notes "
238*******
239******* This build of ${name} includes GPLed code and
240******* is therefore licensed under GPL v2 or later.
241*******
242******* The following modules are GPLed:
243*******
244*******      postproc
245*******      libx264
246*******      libxvid
247*******
248******* To include all nonfree, GPLed and LGPL code use variant +nonfree.
249******* To remove nonfree and GPLed code leaving only LGPL code remove the
250******* +gpl2 variant.
251*******
252"
253} else {
254notes "
255*******
256******* This build of ${name} includes no GPLed or nonfree
257******* code and is therefore licensed under LGPL v2.1 or later.
258*******
259"
260}
261
262livecheck.type  regex
263livecheck.url   ${master_sites}
264livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.