Ticket #38007: Portfile

File Portfile, 10.5 KB (added by reeskm (Rees Machtemes), 11 years ago)

Modded portfile that seems to fix this bug!

Line 
1# $Id: Portfile 102822 2013-02-09 00:51:24Z jmr@macports.org $
2
3# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
4
5PortSystem          1.0
6PortGroup           compiler_blacklist_versions 1.0
7
8name                MPlayer
9version             1.1
10revision            3
11categories          multimedia
12license             GPL-2+
13maintainers         jeremyhu openmaintainer
14platforms           darwin
15
16description         The MPlayer movie player built from SVN.
17long_description    ${description} It plays most MPEG/VOB, AVI, Ogg/OGM, \
18                    VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, \
19                    NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, \
20                    supported by many native, XAnim, and Win32 DLL codecs. \
21                    You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV \
22                    and even H.264 movies.
23homepage            http://www.mplayerhq.hu/
24
25livecheck.type      none
26
27depends_build       port:pkgconfig port:yasm
28depends_lib \
29    port:jpeg port:openjpeg port:lame port:libiconv port:libmad \
30    port:libogg port:libpng port:libtheora port:libvorbis \
31    port:lzo2 port:ncurses port:zlib port:bzip2 port:liboil
32
33master_sites    http://www.mplayerhq.hu/MPlayer/releases/ \
34                ftp://ftp.mplayerhq.hu/MPlayer/releases/ 
35use_xz          yes
36
37checksums           sha1    913a4bbeab7cbb515c2f43ad39bc83071b2efd75 \
38                    rmd160  3722aac0847c4e2cd1e704c6ec610784a6b7a477 \
39                    sha256  76cb47eadb52b420ca028276ebd8112114ad0ab3b726af60f07fb2f39dae6c9c
40
41# Do not use the following environment variables, otherwise the build phase
42# will fail.
43configure.cflags    {}
44configure.cppflags  {}
45configure.cxxflags  {}
46configure.ldflags   {}
47configure.cc_archflags  {}
48configure.cxx_archflags {}
49
50# change the default compiler
51configure.compiler apple-gcc-4.2
52
53
54# Do not use pipes, otherwise the build phase will fail.
55configure.pipe      no
56
57configure.args \
58    --extra-cflags="-I${prefix}/include/lzo -I${prefix}/include" \
59    --extra-ldflags="-L${prefix}/lib -L${prefix}/lib/samba3" \
60    --datadir=${prefix}/share/${name} \
61    --confdir=${prefix}/etc/${name} \
62    --mandir=${prefix}/share/man \
63    --enable-png --enable-jpeg --enable-liblzo \
64    --enable-theora --enable-libvorbis --enable-mad
65
66# MPlayer autodetects many support libs.  To prevent undeclared
67# dependencies, explicitly disable everything optional first.
68# This list should be expanded each time the port is updated to a
69# new version, disabling any newly added options.
70configure.args-append \
71    --disable-smb --disable-live \
72    --disable-cdparanoia --disable-freetype \
73    --disable-fontconfig --disable-fribidi \
74    --disable-enca --disable-libcdio --disable-xvid \
75    --disable-x264 --disable-speex \
76    --disable-faac --disable-libdv \
77    --disable-toolame --disable-twolame --disable-xmms \
78    --disable-musepack --disable-sdl --disable-aa \
79    --disable-caca --disable-x11 --disable-gl --disable-arts \
80    --disable-esd --disable-lirc --disable-mng --disable-libdirac-lavc \
81    --disable-libschroedinger-lavc --disable-liba52  \
82    --disable-gif
83
84patchfiles configure.x11.patch
85
86post-destroot {
87    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
88    eval file copy [glob ${worksrcpath}/DOCS/*] \
89        ${destroot}${prefix}/share/doc/${name}
90    xinstall -d -m 0755 ${destroot}${prefix}/etc/${name}
91    foreach etcfile {codecs.conf dvb-menu.conf example.conf \
92                     input.conf menu.conf} {
93        xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \
94            ${destroot}${prefix}/etc/${name}/${etcfile}
95    }
96    xinstall -d -m 0755 ${destroot}${prefix}/share/man/man1
97    xinstall -m 0644 ${worksrcpath}/DOCS/man/en/mplayer.1 \
98        ${destroot}${prefix}/share/man/man1/
99    xinstall -m 0755 ${worksrcpath}/TOOLS/midentify.sh ${destroot}${prefix}/bin/midentify
100}
101
102universal_variant no
103
104# When adding back in extra features it usually works better to
105# just list the correct depends_lib and then let the auto-detect
106# code find the library versus using an explicit --enable-feature.
107# The later often ends up failing to find the headers or libs or both
108
109variant man_all_lang \
110    description {Install all possible languages for man pages} {
111    configure.args-append --language=all
112}
113
114# Bundle all the font deps into one onscreen display variant
115# Allow autodetect to pick up fontconfig & freetype
116variant osd \
117    description {Enable onscreen display and TrueType font support} {
118    depends_lib-append      port:fontconfig port:freetype
119    configure.args-delete   --disable-fontconfig
120    configure.args-delete   --disable-freetype
121    configure.args-append   --enable-menu
122}
123
124variant fribidi requires osd \
125    description {Enable FriBidi Unicode support} {
126    depends_lib-append      port:fribidi
127    configure.args-delete   --disable-fribidi
128}
129
130variant noappleremote \
131    description {Disable Apple Infrared Remote support} {
132    configure.args-append   --disable-apple-remote
133}
134
135variant lirc \
136    description {Enable Linux Infrared Remote Daemon support} {
137    depends_lib-append      port:lirc
138    configure.args-delete   --disable-lirc
139}
140
141variant live \
142    description {Enable live555 support} {
143    depends_lib-append      port:live555
144    configure.args-delete   --disable-live
145}
146
147#####
148
149variant nodvd \
150    description {Disable DVD and DeCSS support} {
151    configure.args-append   --disable-dvdread-internal --disable-libdvdcss-internal
152}
153
154variant smb description {Enable Samba support} {
155    depends_lib-append port:samba3
156    configure.args-append --enable-smb
157    configure.args-delete --disable-smb
158}
159
160##### External codecs
161
162variant mencoder_extras \
163    description {Enable extra codecs for encoding (XviD, x264, aac, DV, MP2)} {
164
165    depends_lib-append      port:XviD port:x264 port:faac port:libdv \
166        port:twolame
167    configure.args-delete   --disable-xvid
168    configure.args-delete   --disable-x264
169    configure.args-delete   --disable-faac
170    configure.args-delete   --disable-libdv
171    configure.args-delete   --disable-twolame
172}
173variant xvid requires mencoder_extras \
174    description {deprecated: use +mencoder_extras instead} {}
175variant x264 requires mencoder_extras \
176    description {deprecated: use +mencoder_extras instead} {}
177variant faac requires mencoder_extras \
178    description {deprecated: use +mencoder_extras instead} {}
179variant dv requires mencoder_extras \
180    description {deprecated: use +mencoder_extras instead} {}
181variant twolame requires mencoder_extras \
182    description {deprecated: use +mencoder_extras instead} {}
183
184
185variant speex \
186    description {Enable Speex playback} {
187    depends_lib-append      path:lib/libspeex.dylib:speex
188    configure.args-delete   --disable-speex
189}
190
191variant dts \
192    description {Enable non-passthrough DTS playback} {
193    depends_lib-append      port:libdca
194    configure.args-delete   --disable-libdts
195}
196
197variant mng \
198    description {Enable mng codec support} {
199    depends_lib-append      port:libmng
200    configure.args-delete   --disable-mng
201}
202
203variant dirac \
204    description {Enable dirac codec support} {
205    depends_lib-append      port:dirac port:schroedinger
206    configure.args-delete   --disable-libdirac-lavc
207    configure.args-delete   --disable-libschroedinger-lavc
208}
209
210variant a52 \
211    description {Enable AC-3 codec support} {
212    depends_lib-append      port:a52dec
213    configure.args-delete   --disable-liba52
214}
215
216##### Outputs
217
218variant sdl \
219    description {Enable SDL video output} {
220    depends_lib-append      path:lib/pkgconfig/sdl.pc:libsdl
221    configure.args-delete   --disable-sdl
222}
223
224variant aa \
225    description {Enable animated ASCII art video output} {
226    depends_lib-append      port:aalib
227    configure.args-delete   --disable-aa
228}
229
230variant caca \
231    description {Enable animated ASCII art video output} {
232    depends_lib-append      port:libcaca
233    configure.args-delete   --disable-caca
234}
235
236variant x11 {
237    depends_lib-append \
238        port:xorg-libXinerama \
239        port:xorg-libXv \
240        port:xorg-libXxf86vm
241
242    configure.args-delete   --disable-x11
243    configure.args-append   --enable-x11 --enable-xv --enable-xinerama --enable-xshape
244}
245
246variant esd \
247    description {Enable EsounD audio output} {
248    depends_lib-append      port:esound
249    configure.args-delete   --disable-esd
250}
251
252platform macosx {
253    if { ${configure.build_arch} == "x86_64" } {
254        configure.args-append   --disable-qtx
255    } else {
256        configure.args-append   --enable-qtx
257    }
258}
259
260variant glx requires x11 description {Enable glx output support.  Due to a bug in mplayer, this disables corevideo support} {
261    depends_lib-append      port:mesa
262    configure.args-delete   --disable-gl
263    configure.args-append   --enable-gl --disable-corevideo
264}
265
266variant debug description {Compile with debugging symbols} {
267    configure.args-append   --enable-debug=gdb3 --disable-altivec
268}
269
270# gcc-4.0 and older gcc-4.2 fail to build cpudetect.c properly
271compiler.blacklist-append gcc-4.0 {gcc-4.2 < 5646}
272
273# TODO: base should do this: http://trac.macports.org/ticket/32542
274if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
275    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
276
277    # base 2.1.x ignores the argument and just use ${configure.compiler}
278    if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
279        depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
280    }
281
282    if {[string match macports-gcc* ${configure.compiler}]} {
283        depends_lib-append port:$portconfigure::compiler_name_map(${configure.compiler})
284    }
285}
286
287platform darwin 8 {
288    depends_build-append port:gmake
289    depends_skip_archcheck-append gmake
290
291    build.cmd               ${prefix}/bin/gmake
292    destroot.cmd            ${prefix}/bin/gmake
293}
294
295platform darwin 9 {
296    configure.args-delete   --extra-cflags="-I${prefix}/include/lzo -I${prefix}/include"
297    configure.args-append   --extra-cflags="-fomit-frame-pointer -I${prefix}/include/lzo -I${prefix}/include"
298}
299
300if {${configure.compiler} == "llvm-gcc-4.2"} {
301    # llvm-gcc-4.2 fails to build vf_fspp.c properly with -O2 and above
302    patchfiles-append llvm-gcc-workaround.patch
303
304    post-patch {
305        # link time optimization fails to find references for ff_mlp_firorder*
306        # For some reason -O4 -fno-lto doesn't work as well, so just use -O3
307        reinplace "s:-O4:-O3:" ${worksrcpath}/configure
308    }
309}
310
311platform darwin {
312    if { ${configure.build_arch} == "x86_64" } {
313        configure.args-append --target=${configure.build_arch}-Darwin
314    }
315    build.env           LD=${configure.cc}
316}