source: trunk/dports/multimedia/ffmpeg-devel/Portfile @ 85585

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

Add depends_skip_archcheck apple-gcc42; see #31584

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.7 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 85585 2011-10-14 20:17:51Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmpeg-devel
9conflicts       ffmpeg
10version         20111004
11license         GPL-2+ LGPL-2.1+
12categories      multimedia
13maintainers     devans openmaintainer
14
15fetch.type      git
16git.url         git://git.videolan.org/ffmpeg.git
17git.branch      751a4efd4d754b15ebc6027b09051f27860bb1e8
18
19description     FFmpeg is a complete solution to play, record, convert and \
20                stream audio and video.
21
22long_description        FFmpeg is a complete solution to record, convert and \
23                        stream audio and video. It includes libavcodec, the \
24                        leading audio/video codec library. \
25                        \
26                        The project is made of several components: \
27                        \
28                        ffmpeg is a command line tool to convert one video \
29                        file format to another. It also supports grabbing and \
30                        encoding in real time from a TV card. \
31                        \
32                        ffserver is an HTTP (RTSP is being developped) \
33                        multimedia streaming server for live broadcasts. Time \
34                        shifting of live broadcast is also supported. \
35                        \
36                        ffplay is a simple media player based on SDL and on \
37                        the ffmpeg libraries. \
38                        \
39                        ffprobe gathers information from multimedia streams and \
40                        prints it in human- and machine-readable fashion. \
41                        \
42                        libavcodec is a library containing all the ffmpeg \
43                        audio/video encoders and decoders. Most codecs were \
44                        developped from scratch to ensure best performances \
45                        and high code reusability. \
46                        \
47                        libavformat is a library containing parsers and \
48                        generators for all common audio/video formats.
49
50platforms       darwin
51homepage        http://www.ffmpeg.org/
52
53depends_build   port:pkgconfig \
54                port:gmake \
55                port:texi2html
56
57depends_lib     port:lame \
58                port:libvorbis \
59                port:libogg \
60                port:libtheora \
61                port:libmodplug \
62                port:dirac \
63                port:schroedinger \
64                port:openjpeg \
65                path:lib/libspeex.dylib:speex \
66                port:XviD \
67                port:x264 \
68                port:libvpx \
69                path:lib/pkgconfig/sdl.pc:libsdl \
70                port:bzip2 \
71                port:zlib
72
73build.cmd       ${prefix}/bin/gmake
74build.env-append V=1
75
76#
77# enable auto configure of mmx and related Intel optimizations by default
78# requires Xcode 3.1 or better on Leopard
79#
80minimum_xcodeversions {9 3.1}
81
82# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used
83# fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
84#
85# similarly clang fails to build on i386 platforms
86#
87# use code provided by jeremyhu here to use gcc-4.2 instead
88#
89# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html
90#
91
92if {${configure.compiler} == "clang" ||
93    ${configure.compiler} == "llvm-gcc-4.2"} {
94    configure.compiler gcc-4.2
95    if {![file executable ${configure.cc}]} {
96        depends_build-append port:apple-gcc42
97        depends_skip_archcheck apple-gcc42
98        configure.compiler apple-gcc-4.2
99    }
100}
101
102configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
103configure.args \
104        --enable-gpl \
105        --enable-postproc \
106        --enable-swscale --enable-avfilter \
107        --enable-libmp3lame \
108        --enable-libvorbis \
109        --enable-libtheora \
110        --enable-libdirac --enable-libschroedinger \
111        --enable-libopenjpeg \
112        --enable-libmodplug \
113        --enable-libxvid \
114        --enable-libx264 \
115        --enable-libvpx \
116        --enable-libspeex \
117        --mandir=${prefix}/share/man \
118        --enable-shared --enable-pthreads \
119        --cc=${configure.cc}
120
121test.run        yes
122
123#
124# configure isn't autoconf and they do use a dep cache
125#
126
127post-destroot {
128    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
129    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
130    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
131    foreach f [glob ${worksrcpath}/doc/*.txt] {
132        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
133    }
134}
135
136platform powerpc {
137    # absence of altivec is not automatically detected
138    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
139        configure.args-append --disable-altivec
140    }
141}
142
143configure.universal_args-delete --disable-dependency-tracking
144
145if {[variant_isset universal]} {
146    foreach arch ${configure.universal_archs} {
147        lappend merger_configure_args($arch) --arch=${arch}
148        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
149    }
150    if {[string match "*86*" ${configure.universal_archs}]} {
151        depends_build-append port:yasm
152    }
153    lappend merger_configure_args(i386) --enable-yasm
154    lappend merger_configure_args(x86_64) --enable-yasm
155} else {
156    configure.args-append --arch=${configure.build_arch}
157    configure.env-append  ASFLAGS='[get_canonical_archflags]'
158    if {$build_arch == "i386" || $build_arch == "x86_64"} {
159        depends_build-append port:yasm
160        configure.args-append --enable-yasm
161    }
162}
163
164variant no_mmx description {disable all x86 asm optimizations} {
165    configure.args-append --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
166}
167
168variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
169    configure.args-delete   --enable-gpl \
170                            --enable-postproc \
171                            --enable-libx264 \
172                            --enable-libxvid
173    depends_lib-delete      port:XviD \
174                            port:x264
175    license-delete          GPL-2+
176}
177
178# the build server uses the default variants, and we want distributable binaries
179# nonfree code is disabled by default but can be enabled using the +nonfree variant
180
181variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
182    configure.args-append   --enable-nonfree \
183                            --enable-libfaac
184    depends_lib-append      port:faac
185    license-append          nonfree
186}
187
188if {[variant_isset nonfree]} {
189notes "
190*******
191******* This build of ${name} includes nonfree code as follows:
192*******
193*******     libfaac
194*******
195******* The following libraries and binaries may not be redistributed:
196*******
197*******     ffmpeg
198*******     libavcodec
199*******     libavdevice
200*******     libavfilter
201*******     libavformat
202*******     libavutil
203*******
204******* To remove this restriction remove the variant +nonfree
205*******
206"
207} elseif {![variant_isset no_gpl]} {
208notes "
209*******
210******* This build of ${name} includes GPLed code and
211******* is therefore licensed under GPL v2 or later.
212*******
213******* The following modules are GPLed:
214*******
215*******      postproc
216*******      libx264
217*******      libxvid
218*******
219******* To include all nonfree, GPLed and LGPL code use variant +nonfree
220******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
221*******
222"
223} else {
224notes "
225*******
226******* This build of ${name} includes no GPLed or nonfree
227******* code and is therefore licensed under LGPL v2.1 or later.
228*******
229"
230}
231
232#
233#disable livecheck
234#
235
236livecheck.type  none
Note: See TracBrowser for help on using the repository browser.