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

Last change on this file since 85594 was 85594, checked in by ryandesign@…, 8 years ago

Undo r85585 (depends_skip_archcheck apple-gcc42)
apple-gcc42: installs_libs no
#31584

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.9 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 85594 2011-10-15 00:25:59Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmpeg
9conflicts       ffmpeg-devel
10epoch           1
11version         0.7.6
12set branch      [join [lrange [split ${version} .] 0 1] .]
13license         GPL-2+ LGPL-2.1+
14categories      multimedia
15maintainers     devans 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 developped) \
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                        developped from scratch to ensure best performances \
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       sha1    0ea9ea769e195bf79d1b787acf253582481413b5 \
55                rmd160  18641ae249d8b6f14f99013d1fccd85b0baddfa5
56
57depends_build   port:pkgconfig \
58                port:gmake \
59                port:texi2html
60
61depends_lib     port:lame \
62                port:libvorbis \
63                port:libogg \
64                port:libtheora \
65                port:dirac \
66                port:schroedinger \
67                port:openjpeg \
68                path:lib/libspeex.dylib:speex \
69                port:XviD \
70                port:x264 \
71                port:libvpx \
72                path:lib/pkgconfig/sdl.pc:libsdl \
73                port:bzip2 \
74                port:zlib
75
76build.cmd       ${prefix}/bin/gmake
77build.env-append V=1
78
79#
80# enable auto configure of mmx and related Intel optimizations by default
81# requires Xcode 3.1 or better on Leopard
82#
83minimum_xcodeversions {9 3.1}
84
85# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used
86# fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
87#
88# similarly clang fails to build on i386 platforms
89#
90# use code provided by jeremyhu here to use gcc-4.2 instead
91#
92# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
93#
94
95if {${configure.compiler} == "clang" ||
96    ${configure.compiler} == "llvm-gcc-4.2"} {
97    configure.compiler gcc-4.2
98    if {![file executable ${configure.cc}]} {
99        depends_build-append port:apple-gcc42
100        configure.compiler apple-gcc-4.2
101    }
102}
103
104configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
105configure.args \
106        --enable-gpl \
107        --enable-postproc \
108        --enable-swscale --enable-avfilter \
109        --enable-libmp3lame \
110        --enable-libvorbis \
111        --enable-libtheora \
112        --enable-libdirac --enable-libschroedinger \
113        --enable-libopenjpeg \
114        --enable-libxvid \
115        --enable-libx264 \
116        --enable-libvpx \
117        --enable-libspeex \
118        --mandir=${prefix}/share/man \
119        --enable-shared --enable-pthreads \
120        --cc=${configure.cc}
121
122test.run        yes
123
124#
125# configure isn't autoconf and they do use a dep cache
126#
127
128post-destroot {
129    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
130    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
131    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
132    foreach f [glob ${worksrcpath}/doc/*.txt] {
133        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
134    }
135}
136
137platform powerpc {
138    # absence of altivec is not automatically detected
139    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
140        configure.args-append --disable-altivec
141    }
142}
143
144configure.universal_args-delete --disable-dependency-tracking
145
146if {[variant_isset universal]} {
147    foreach arch ${configure.universal_archs} {
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 no_mmx description {disable all x86 asm optimizations} {
166    configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
167}
168
169variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
170    configure.args-delete   --enable-gpl \
171                            --enable-postproc \
172                            --enable-libx264 \
173                            --enable-libxvid
174    depends_lib-delete      port:XviD \
175                            port:x264
176    license-delete          GPL-2+
177}
178
179# the build server uses the default variants, and we want distributable binaries
180# nonfree code is disabled by default but can be enabled using the +nonfree variant
181
182variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
183    configure.args-append   --enable-nonfree \
184                            --enable-libfaac
185    depends_lib-append      port:faac
186    license-append          nonfree
187}
188
189if {[variant_isset nonfree]} {
190notes "
191*******
192******* This build of ${name} includes nonfree code as follows:
193*******
194*******     libfaac
195*******
196******* The following libraries and binaries may not be redistributed:
197*******
198*******     ffmpeg
199*******     libavcodec
200*******     libavdevice
201*******     libavfilter
202*******     libavformat
203*******     libavutil
204*******
205******* To remove this restriction remove the variant +nonfree
206*******
207"
208} elseif {![variant_isset no_gpl]} {
209notes "
210*******
211******* This build of ${name} includes GPLed code and
212******* is therefore licensed under GPL v2 or later.
213*******
214******* The following modules are GPLed:
215*******
216*******      postproc
217*******      libx264
218*******      libxvid
219*******
220******* To include all nonfree, GPLed and LGPL code use variant +nonfree
221******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
222*******
223"
224} else {
225notes "
226*******
227******* This build of ${name} includes no GPLed or nonfree
228******* code and is therefore licensed under LGPL v2.1 or later.
229*******
230"
231}
232
233livecheck.type  regex
234livecheck.url   ${master_sites}
235livecheck.regex "${name}-(${branch}(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.