Ticket #33048: Portfile

File Portfile, 7.8 KB (added by ChristianFrisson (Christian Frisson), 12 years ago)

Working ffmpeg 0.10.4 working on OSX 10.6.8 32-bit XCode 3.2.6

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 82651 2011-08-17 16:08:11Z 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.10.4
12# this Portfile has been tested with 0.11.1, just change the version and checksum to update
13license         nonfree 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           rmd160  97ec2a7690cf610a72f4198da91a59191cee3f4a \
55                    sha256  82932716a8c01a6840a2f20c1ee093e04b1d8a27c2d6318ddf21a5f95f3c581b
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:faac \
68                port:faad2 \
69                path:lib/libspeex.dylib:speex \
70                port:XviD \
71                port:x264 \
72                port:libvpx \
73                path:lib/pkgconfig/sdl.pc:libsdl \
74                port:bzip2 \
75                port:zlib
76
77build.cmd       ${prefix}/bin/gmake
78build.env-append V=1
79
80#
81# enable auto configure of mmx and related Intel optimizations by default
82# requires Xcode 3.1 or better on Leopard
83#
84minimum_xcodeversions {9 3.1}
85
86# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used
87# fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
88if {${configure.compiler} == "llvm-gcc-4.2"} {
89        configure.compiler clang
90}
91
92#/configure --prefix=/opt/local --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=i386 --enable-yasm --disable-asm --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
93configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
94configure.args \
95        --mandir=${prefix}/share/man \
96        --enable-shared --enable-pthreads \
97        --disable-indevs \
98        --cc=${configure.cc} \
99        --disable-doc
100
101#add --enable-libopenjpeg when problems with openjpeg.h are resolved
102
103test.run        yes
104
105#
106# configure isn't autoconf and they do use a dep cache
107#
108
109post-destroot {
110    file mkdir ${destroot}${prefix}/share/doc/${name}
111 #   file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name}
112    foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
113        file copy $f ${destroot}${prefix}/share/doc/${name}
114    }
115}
116
117platform powerpc {
118    # absence of altivec is not automatically detected
119    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
120        configure.args-append --disable-altivec
121    }
122}
123
124configure.universal_args-delete --disable-dependency-tracking
125
126if {[variant_isset universal]} {
127    foreach arch ${configure.universal_archs} {
128        lappend merger_configure_args($arch) --arch=${arch}
129        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
130    }
131    if {[string match "*86*" ${configure.universal_archs}]} {
132        depends_build-append port:yasm
133    }
134    lappend merger_configure_args(i386) --enable-yasm
135    lappend merger_configure_args(x86_64) --enable-yasm
136} else {
137    configure.args-append --arch=${configure.build_arch}
138    configure.env-append  ASFLAGS='[get_canonical_archflags]'
139    if {$build_arch == "i386" || $build_arch == "x86_64"} {
140        depends_build-append port:yasm
141        configure.args-append --enable-yasm
142    }
143}
144
145#variant no_mmx description {disable all x86 asm optimizations} {
146    configure.args-append --disable-asm --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
147#}
148
149variant no_gpl description {disallow use of GPL code, license will be LGPL} {
150    configure.args-delete   --enable-gpl \
151                            --enable-postproc \
152                            --enable-libfaad \
153                            --enable-libx264 \
154                            --enable-libxvid
155    depends_lib-delete      port:faad2 \
156                            port:XviD
157    depends_build-delete    port:x264
158    license-delete          GPL-2+
159}
160
161variant no_nonfree description {disallow use of nonfree code, libraries and binaries will be redistributable under GPL/LGPL} {
162    configure.args-delete   --enable-nonfree \
163                            --enable-libfaac
164    depends_lib-delete      port:faac
165    license-delete          nonfree
166}
167# the build server uses the default variants, and we want distributable binaries
168default_variants    +no_nonfree
169
170#
171# jack indev support is currently broken
172# since Darwin doesn't support memory based POSIX semaphores
173# only named ones
174#
175
176variant jack description {Enable jack input device support (currently broken)} {
177    configure.args-delete --disable-indevs
178    depends_lib-append port:jack
179}
180
181if {![variant_isset no_nonfree]} {
182notes "
183*******
184******* This build of ${name} includes nonfree code as follows:
185*******
186*******     libfaac
187*******
188******* The following libraries and binaries may not be redistributed:
189*******
190*******     ffmpeg
191*******     libavcodec
192*******     libavdevice
193*******     libavfilter
194*******     libavformat
195*******     libavutil
196*******
197******* To remove this restriction use variant +no_nonfree
198*******
199"
200} elseif {![variant_isset no_gpl]} {
201notes "
202*******
203******* This build of ${name} includes GPLed code and
204******* is therefore licensed under GPL v2 or later.
205*******
206******* The following modules are GPLed:
207*******
208*******      postproc
209*******      libfaad
210*******      libx264
211*******      libxvid
212*******
213******* To include only LGPLed code use variant +no_gpl +no_nonfree
214*******
215"
216} else {
217notes "
218*******
219******* This build of ${name} includes no GPLed or nonfree
220******* code and is therefore licensed under LGPL v2.1 or later.
221*******
222"
223}
224
225livecheck.type  regex
226livecheck.url   ${master_sites}
227livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"