source: trunk/dports/multimedia/MPlayer/Portfile @ 102151

Last change on this file since 102151 was 102151, checked in by jeremyhu@…, 7 years ago

MPlayer: Use compiler_blacklist_versions for gcc-4.2 blacklisting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.1 KB
Line 
1# $Id: Portfile 102151 2013-01-28 18:06:24Z jeremyhu@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            2
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# Do not use pipes, otherwise the build phase will fail.
51configure.pipe      no
52
53configure.args \
54    --extra-cflags="-I${prefix}/include/lzo -I${prefix}/include" \
55    --extra-ldflags="-L${prefix}/lib -L${prefix}/lib/samba3" \
56    --datadir=${prefix}/share/${name} \
57    --confdir=${prefix}/etc/${name} \
58    --mandir=${prefix}/share/man \
59    --enable-png --enable-jpeg --enable-liblzo \
60    --enable-theora --enable-libvorbis --enable-mad
61
62# MPlayer autodetects many support libs.  To prevent undeclared
63# dependencies, explicitly disable everything optional first.
64# This list should be expanded each time the port is updated to a
65# new version, disabling any newly added options.
66configure.args-append \
67    --disable-smb --disable-live \
68    --disable-cdparanoia --disable-freetype \
69    --disable-fontconfig --disable-fribidi \
70    --disable-enca --disable-libcdio --disable-xvid \
71    --disable-x264 --disable-speex \
72    --disable-faac --disable-libdv \
73    --disable-toolame --disable-twolame --disable-xmms \
74    --disable-musepack --disable-sdl --disable-aa \
75    --disable-caca --disable-x11 --disable-gl --disable-arts \
76    --disable-esd --disable-lirc --disable-mng --disable-libdirac-lavc \
77    --disable-libschroedinger-lavc --disable-liba52  \
78    --disable-gif
79
80patchfiles configure.x11.patch
81
82post-destroot {
83    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
84    eval file copy [glob ${worksrcpath}/DOCS/*] \
85        ${destroot}${prefix}/share/doc/${name}
86    xinstall -d -m 0755 ${destroot}${prefix}/etc/${name}
87    foreach etcfile {codecs.conf dvb-menu.conf example.conf \
88                     input.conf menu.conf} {
89        xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \
90            ${destroot}${prefix}/etc/${name}/${etcfile}
91    }
92    xinstall -d -m 0755 ${destroot}${prefix}/share/man/man1
93    xinstall -m 0644 ${worksrcpath}/DOCS/man/en/mplayer.1 \
94        ${destroot}${prefix}/share/man/man1/
95    xinstall -m 0755 ${worksrcpath}/TOOLS/midentify.sh ${destroot}${prefix}/bin/midentify
96}
97
98universal_variant no
99
100# When adding back in extra features it usually works better to
101# just list the correct depends_lib and then let the auto-detect
102# code find the library versus using an explicit --enable-feature.
103# The later often ends up failing to find the headers or libs or both
104
105variant man_all_lang \
106    description {Install all possible languages for man pages} {
107    configure.args-append --language=all
108}
109
110# Bundle all the font deps into one onscreen display variant
111# Allow autodetect to pick up fontconfig & freetype
112variant osd \
113    description {Enable onscreen display and TrueType font support} {
114    depends_lib-append      port:fontconfig port:freetype
115    configure.args-delete   --disable-fontconfig
116    configure.args-delete   --disable-freetype
117    configure.args-append   --enable-menu
118}
119
120variant fribidi requires osd \
121    description {Enable FriBidi Unicode support} {
122    depends_lib-append      port:fribidi
123    configure.args-delete   --disable-fribidi
124}
125
126variant noappleremote \
127    description {Disable Apple Infrared Remote support} {
128    configure.args-append   --disable-apple-remote
129}
130
131variant lirc \
132    description {Enable Linux Infrared Remote Daemon support} {
133    depends_lib-append      port:lirc
134    configure.args-delete   --disable-lirc
135}
136
137variant live \
138    description {Enable live555 support} {
139    depends_lib-append      port:live555
140    configure.args-delete   --disable-live
141}
142
143#####
144
145variant nodvd \
146    description {Disable DVD and DeCSS support} {
147    configure.args-append   --disable-dvdread-internal --disable-libdvdcss-internal
148}
149
150variant smb description {Enable Samba support} {
151    depends_lib-append port:samba3
152    configure.args-append --enable-smb
153    configure.args-delete --disable-smb
154}
155
156##### External codecs
157
158variant mencoder_extras \
159    description {Enable extra codecs for encoding (XviD, x264, aac, DV, MP2)} {
160
161    depends_lib-append      port:XviD port:x264 port:faac port:libdv \
162        port:twolame
163    configure.args-delete   --disable-xvid
164    configure.args-delete   --disable-x264
165    configure.args-delete   --disable-faac
166    configure.args-delete   --disable-libdv
167    configure.args-delete   --disable-twolame
168}
169variant xvid requires mencoder_extras \
170    description {deprecated: use +mencoder_extras instead} {}
171variant x264 requires mencoder_extras \
172    description {deprecated: use +mencoder_extras instead} {}
173variant faac requires mencoder_extras \
174    description {deprecated: use +mencoder_extras instead} {}
175variant dv requires mencoder_extras \
176    description {deprecated: use +mencoder_extras instead} {}
177variant twolame requires mencoder_extras \
178    description {deprecated: use +mencoder_extras instead} {}
179
180
181variant speex \
182    description {Enable Speex playback} {
183    depends_lib-append      path:lib/libspeex.dylib:speex
184    configure.args-delete   --disable-speex
185}
186
187variant dts \
188    description {Enable non-passthrough DTS playback} {
189    depends_lib-append      port:libdca
190    configure.args-delete   --disable-libdts
191}
192
193variant mng \
194    description {Enable mng codec support} {
195    depends_lib-append      port:libmng
196    configure.args-delete   --disable-mng
197}
198
199variant dirac \
200    description {Enable dirac codec support} {
201    depends_lib-append      port:dirac port:schroedinger
202    configure.args-delete   --disable-libdirac-lavc
203    configure.args-delete   --disable-libschroedinger-lavc
204}
205
206variant a52 \
207    description {Enable AC-3 codec support} {
208    depends_lib-append      port:a52dec
209    configure.args-delete   --disable-liba52
210}
211
212##### Outputs
213
214variant sdl \
215    description {Enable SDL video output} {
216    depends_lib-append      path:lib/pkgconfig/sdl.pc:libsdl
217    configure.args-delete   --disable-sdl
218}
219
220variant aa \
221    description {Enable animated ASCII art video output} {
222    depends_lib-append      port:aalib
223    configure.args-delete   --disable-aa
224}
225
226variant caca \
227    description {Enable animated ASCII art video output} {
228    depends_lib-append      port:libcaca
229    configure.args-delete   --disable-caca
230}
231
232variant x11 {
233    depends_lib-append \
234        port:xorg-libXinerama \
235        port:xorg-libXv \
236        port:xorg-libXxf86vm
237
238    configure.args-delete   --disable-x11
239    configure.args-append   --enable-x11 --enable-xv --enable-xinerama --enable-xshape
240}
241
242variant esd \
243    description {Enable EsounD audio output} {
244    depends_lib-append      port:esound
245    configure.args-delete   --disable-esd
246}
247
248platform macosx {
249    if { ${configure.build_arch} == "x86_64" } {
250        configure.args-append   --disable-qtx
251    } else {
252        configure.args-append   --enable-qtx
253    }
254}
255
256variant glx requires x11 description {Enable glx output support.  Due to a bug in mplayer, this disables corevideo support} {
257    depends_lib-append      port:mesa
258    configure.args-delete   --disable-gl
259    configure.args-append   --enable-gl --disable-corevideo
260}
261
262variant debug description {Compile with debugging symbols} {
263    configure.args-append   --enable-debug=gdb3 --disable-altivec
264}
265
266# gcc-4.0 and older gcc-4.2 fail to build cpudetect.c properly
267compiler.blacklist-append gcc-4.0 {gcc-4.2 < 5646}
268
269# TODO: base should do this: http://trac.macports.org/ticket/32542
270if {[portconfigure::compiler_is_port ${configure.compiler}]} {
271    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
272    depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
273}
274
275platform darwin 8 {
276    depends_build-append port:gmake
277    depends_skip_archcheck-append gmake
278
279    build.cmd               ${prefix}/bin/gmake
280    destroot.cmd            ${prefix}/bin/gmake
281}
282
283platform darwin 9 {
284    configure.args-delete   --extra-cflags="-I${prefix}/include/lzo -I${prefix}/include"
285    configure.args-append   --extra-cflags="-fomit-frame-pointer -I${prefix}/include/lzo -I${prefix}/include"
286}
287
288if {${configure.compiler} == "llvm-gcc-4.2"} {
289    # llvm-gcc-4.2 fails to build vf_fspp.c properly with -O2 and above
290    patchfiles-append llvm-gcc-workaround.patch
291
292    post-patch {
293        # link time optimization fails to find references for ff_mlp_firorder*
294        # For some reason -O4 -fno-lto doesn't work as well, so just use -O3
295        reinplace "s:-O4:-O3:" ${worksrcpath}/configure
296    }
297}
298
299platform darwin {
300    if { ${configure.build_arch} == "x86_64" } {
301        configure.args-append --target=${configure.build_arch}-Darwin
302    }
303    build.env           LD=${configure.cc}
304}
Note: See TracBrowser for help on using the repository browser.