Ticket #32799: Portfile

File Portfile, 6.5 KB (added by deric@…, 13 years ago)

The actual Portfile, it needs the patch from the ffmpeg port to build.

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$
3
4PortSystem 1.0
5PortGroup xcodeversion 1.0
6PortGroup muniversal 1.0
7
8name            ffmbc
9conflicts       ffmpeg-devel ffmpeg
10version         0.7-rc7
11revision        1
12license         GPL-2+
13categories      multimedia
14maintainers     deric openmaintainer
15
16description     FFmbc is FFmpeg customized for broadcast and professional usage.
17
18long_description        ...
19
20platforms       darwin
21homepage        http://code.google.com/p/ffmbc/
22master_sites    googlecode:ffmbc
23distname        FFmbc-${version}
24
25use_bzip2       yes
26
27checksums       rmd160  477bb0632358ebdd3be389fb9ac3ecd28d7643e2 \
28                sha256  08e1b4a7abe6f9493bd5905ece1cecd291bdb1efbd2af6dd830a42273238f3c7
29
30depends_build   port:pkgconfig \
31                port:gmake \
32                port:texi2html
33
34depends_lib     port:lame \
35                port:libvorbis \
36                port:libogg \
37                port:libtheora \
38                port:dirac \
39                port:schroedinger \
40                port:openjpeg \
41                path:lib/libspeex.dylib:speex \
42                port:XviD \
43                port:x264 \
44                port:libvpx \
45                path:lib/pkgconfig/sdl.pc:libsdl \
46                port:bzip2 \
47                port:zlib
48
49patchfiles      patch-configure.diff
50
51build.cmd       ${prefix}/bin/gmake
52build.env-append V=1
53
54#
55# enable auto configure of mmx and related Intel optimizations by default
56# requires Xcode 3.1 or better on Leopard
57#
58minimum_xcodeversions {9 3.1}
59
60# And similarly, disable mmx on Tiger
61platform darwin {
62    if {${os.major} < 9} {
63        default_variants -mmx
64    } else {
65        default_variants +mmx
66    }
67}
68
69# Under some conditions, llvm-gcc-4.2 drops some "unused" code even though it is used.
70# This is fixed in llvm-gcc trunk, but not in Apple's shipped llvm-gccs.
71if {${configure.compiler} == "llvm-gcc-4.2"} {
72    configure.compiler clang
73}
74
75# Xcode 4.1's clang has issues with ffmpeg
76# See https://trac.macports.org/ticket/30137
77if {$xcodeversion == "4.1"} {
78    pre-configure {
79        error "XCode 4.1 cannot compile ${name}; please upgrade"
80    }
81}
82
83configure.cflags-append    -DHAVE_LRINTF ${configure.cppflags}
84configure.args \
85        --enable-gpl \
86        --enable-postproc \
87        --enable-swscale --enable-avfilter \
88        --enable-libmp3lame \
89        --enable-libvorbis \
90        --enable-libtheora \
91        --enable-libdirac --enable-libschroedinger \
92        --enable-libopenjpeg \
93        --enable-libxvid \
94        --enable-libx264 \
95        --enable-libvpx \
96        --enable-libspeex \
97        --disable-mmx \
98        --disable-mmx2 \
99        --disable-sse \
100        --disable-ssse3 \
101        --disable-amd3dnow \
102        --disable-amd3dnowext \
103        --mandir=${prefix}/share/man \
104        --enable-shared --enable-pthreads \
105        --cc=${configure.cc}
106
107test.run        yes
108
109#
110# configure isn't autoconf and they do use a dep cache
111#
112
113post-destroot {
114    file mkdir ${destroot}${prefix}/share/doc/ffmpeg
115    file copy ${worksrcpath}/doc/APIchanges ${destroot}${prefix}/share/doc/ffmpeg
116    file copy ${worksrcpath}/doc/RELEASE_NOTES ${destroot}${prefix}/share/doc/ffmpeg
117    foreach f [glob ${worksrcpath}/doc/*.txt] {
118        file copy $f ${destroot}${prefix}/share/doc/ffmpeg
119    }
120}
121
122platform powerpc {
123    # absence of altivec is not automatically detected
124    if {[catch {sysctl hw.vectorunit} result] || $result == 0} {
125        configure.args-append --disable-altivec
126    }
127}
128
129configure.universal_args-delete --disable-dependency-tracking
130
131if {[variant_isset universal]} {
132    foreach arch ${configure.universal_archs} {
133        set merger_host($arch) ""
134        lappend merger_configure_args($arch) --arch=${arch}
135        lappend merger_configure_env($arch)  ASFLAGS='-arch ${arch}'
136    }
137    if {[string match "*86*" ${configure.universal_archs}]} {
138        depends_build-append port:yasm
139    }
140    lappend merger_configure_args(i386) --enable-yasm
141    lappend merger_configure_args(x86_64) --enable-yasm
142} else {
143    configure.args-append --arch=${configure.build_arch}
144    configure.env-append  ASFLAGS='[get_canonical_archflags]'
145    if {$build_arch == "i386" || $build_arch == "x86_64"} {
146        depends_build-append port:yasm
147        configure.args-append --enable-yasm
148    }
149}
150
151variant mmx description {enable all supported x86 asm optimizations} {
152    configure.args-delete --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
153}
154
155variant no_gpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
156    configure.args-delete   --enable-gpl \
157                            --enable-postproc \
158                            --enable-libx264 \
159                            --enable-libxvid
160    depends_lib-delete      port:XviD \
161                            port:x264
162    license-delete          GPL-2+
163    license-append          LGPL-2.1+
164}
165
166# the build server uses the default variants, and we want distributable binaries
167# nonfree code is disabled by default but can be enabled using the +nonfree variant
168
169variant nonfree conflicts no_gpl description {enable nonfree code, libraries and binaries will not be redistributable} {
170    configure.args-append   --enable-nonfree \
171                            --enable-libfaac
172    depends_lib-append      port:faac
173    license-delete          GPL-2+
174    license-append          Restrictive
175}
176
177if {[variant_isset nonfree]} {
178notes "
179*******
180******* This build of ${name} includes nonfree code as follows:
181*******
182*******     libfaac
183*******
184******* The following libraries and binaries may not be redistributed:
185*******
186*******     ffmpeg
187*******     libavcodec
188*******     libavdevice
189*******     libavfilter
190*******     libavformat
191*******     libavutil
192*******
193******* To remove this restriction remove the variant +nonfree
194*******
195"
196} elseif {![variant_isset no_gpl]} {
197notes "
198*******
199******* This build of ${name} includes GPLed code and
200******* is therefore licensed under GPL v2 or later.
201*******
202******* The following modules are GPLed:
203*******
204*******      postproc
205*******      libx264
206*******      libxvid
207*******
208******* To include all nonfree, GPLed and LGPL code use variant +nonfree
209******* To remove nonfree and GPLed code leaving only LGPL code use variant +no_gpl
210*******
211"
212} else {
213notes "
214*******
215******* This build of ${name} includes no GPLed or nonfree
216******* code and is therefore licensed under LGPL v2.1 or later.
217*******
218"
219}
220
221livecheck.regex FFmbc-(\[0-9\]+\.\[0-9\]+-rc\[0-9\])