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

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

mplayer: Expand blacklist

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.8 KB
Line 
1# $Id: Portfile 115374 2014-01-01 02:53:09Z 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            7
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:openjpeg15 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 vo_corevideo.m.patch
81
82post-patch {
83    # https://trac.macports.org/ticket/38935
84    reinplace "s|-maltivec|-faltivec -maltivec|g" \
85        ${worksrcpath}/configure \
86        ${worksrcpath}/ffmpeg/configure
87}
88
89post-destroot {
90    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
91    eval file copy [glob ${worksrcpath}/DOCS/*] \
92        ${destroot}${prefix}/share/doc/${name}
93    xinstall -d -m 0755 ${destroot}${prefix}/etc/${name}
94    foreach etcfile {codecs.conf dvb-menu.conf example.conf \
95                     input.conf menu.conf} {
96        xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \
97            ${destroot}${prefix}/etc/${name}/${etcfile}
98    }
99    xinstall -d -m 0755 ${destroot}${prefix}/share/man/man1
100    xinstall -m 0644 ${worksrcpath}/DOCS/man/en/mplayer.1 \
101        ${destroot}${prefix}/share/man/man1/
102    xinstall -m 0755 ${worksrcpath}/TOOLS/midentify.sh ${destroot}${prefix}/bin/midentify
103}
104
105universal_variant no
106
107# When adding back in extra features it usually works better to
108# just list the correct depends_lib and then let the auto-detect
109# code find the library versus using an explicit --enable-feature.
110# The later often ends up failing to find the headers or libs or both
111
112variant man_all_lang \
113    description {Install all possible languages for man pages} {
114    configure.args-append --language=all
115}
116
117# Bundle all the font deps into one onscreen display variant
118# Allow autodetect to pick up fontconfig & freetype
119variant osd \
120    description {Enable onscreen display and TrueType font support} {
121    depends_lib-append      port:fontconfig port:freetype
122    configure.args-delete   --disable-fontconfig
123    configure.args-delete   --disable-freetype
124    configure.args-append   --enable-menu
125}
126
127variant fribidi requires osd \
128    description {Enable FriBidi Unicode support} {
129    depends_lib-append      port:fribidi
130    configure.args-delete   --disable-fribidi
131}
132
133variant noappleremote \
134    description {Disable Apple Infrared Remote support} {
135    configure.args-append   --disable-apple-remote
136}
137
138variant lirc \
139    description {Enable Linux Infrared Remote Daemon support} {
140    depends_lib-append      port:lirc
141    configure.args-delete   --disable-lirc
142}
143
144variant live \
145    description {Enable live555 support} {
146    depends_lib-append      port:live555
147    configure.args-delete   --disable-live
148}
149
150#####
151
152variant nodvd \
153    description {Disable DVD and DeCSS support} {
154    configure.args-append   --disable-dvdread-internal --disable-libdvdcss-internal
155}
156
157variant smb description {Enable Samba support} {
158    depends_lib-append port:samba3
159    configure.args-append --enable-smb
160    configure.args-delete --disable-smb
161}
162
163##### External codecs
164
165variant mencoder_extras \
166    description {Enable extra codecs for encoding (XviD, x264, aac, DV, MP2)} {
167
168    depends_lib-append      port:XviD port:x264 port:faac port:libdv \
169        port:twolame
170    configure.args-delete   --disable-xvid
171    configure.args-delete   --disable-x264
172    configure.args-delete   --disable-faac
173    configure.args-delete   --disable-libdv
174    configure.args-delete   --disable-twolame
175}
176variant xvid requires mencoder_extras \
177    description {deprecated: use +mencoder_extras instead} {}
178variant x264 requires mencoder_extras \
179    description {deprecated: use +mencoder_extras instead} {}
180variant faac requires mencoder_extras \
181    description {deprecated: use +mencoder_extras instead} {}
182variant dv requires mencoder_extras \
183    description {deprecated: use +mencoder_extras instead} {}
184variant twolame requires mencoder_extras \
185    description {deprecated: use +mencoder_extras instead} {}
186
187
188variant speex \
189    description {Enable Speex playback} {
190    depends_lib-append      path:lib/libspeex.dylib:speex
191    configure.args-delete   --disable-speex
192}
193
194variant dts \
195    description {Enable non-passthrough DTS playback} {
196    depends_lib-append      port:libdca
197    configure.args-delete   --disable-libdts
198}
199
200variant mng \
201    description {Enable mng codec support} {
202    depends_lib-append      port:libmng
203    configure.args-delete   --disable-mng
204}
205
206variant dirac \
207    description {Enable dirac codec support} {
208    depends_lib-append      port:dirac port:schroedinger
209    configure.args-delete   --disable-libdirac-lavc
210    configure.args-delete   --disable-libschroedinger-lavc
211}
212
213variant a52 \
214    description {Enable AC-3 codec support} {
215    depends_lib-append      port:a52dec
216    configure.args-delete   --disable-liba52
217}
218
219##### Outputs
220
221variant sdl \
222    description {Enable SDL video output} {
223    depends_lib-append      port:libsdl
224    configure.args-delete   --disable-sdl
225}
226
227variant aa \
228    description {Enable animated ASCII art video output} {
229    depends_lib-append      port:aalib
230    configure.args-delete   --disable-aa
231}
232
233variant caca \
234    description {Enable animated ASCII art video output} {
235    depends_lib-append      port:libcaca
236    configure.args-delete   --disable-caca
237}
238
239variant x11 {
240    depends_lib-append \
241        port:xorg-libXinerama \
242        port:xorg-libXv \
243        port:xorg-libXxf86vm
244
245    configure.args-delete   --disable-x11
246    configure.args-append   --enable-x11 --enable-xv --enable-xinerama --enable-xshape
247}
248
249variant esd \
250    description {Enable EsounD audio output} {
251    depends_lib-append      port:esound
252    configure.args-delete   --disable-esd
253}
254
255platform macosx {
256    if {${configure.build_arch} eq "x86_64"} {
257        configure.args-append   --disable-qtx
258    } else {
259        configure.args-append   --enable-qtx
260    }
261}
262
263variant glx requires x11 description {Enable glx output support.  Due to a bug in mplayer, this disables corevideo support} {
264    depends_lib-append      port:mesa
265    configure.args-delete   --disable-gl
266    configure.args-append   --enable-gl --disable-corevideo
267}
268
269variant debug description {Compile with debugging symbols} {
270    configure.args-append   --enable-debug=gdb3 --disable-altivec
271}
272
273# gcc-4.0 and older gcc-4.2 (< 5646) used to fail to build cpudetect.c properly, but it seems to work now (38007#comment:20)
274# llvm-gcc-4.2 macports-llvm-gcc-4.2 fail (38007#comment:19)
275# gcc-4.2 5577 fails to build cpudetect.c for x86_64
276compiler.blacklist-append gcc-3.3 {gcc-4.0 < 5493} {gcc-4.2 < 5666} llvm-gcc-4.2 macports-llvm-gcc-4.2
277
278if {[lsearch [get_canonical_archs] i386] != -1} {
279    # http://trac.macports.org/ticket/38248
280    compiler.blacklist-append {clang < 300}
281}
282
283platform darwin 8 {
284    depends_build-append port:gmake
285    build.cmd               ${prefix}/bin/gmake
286}
287
288platform darwin 9 {
289    configure.args-delete   --extra-cflags="-I${prefix}/include/lzo -I${prefix}/include"
290    configure.args-append   --extra-cflags="-fomit-frame-pointer -I${prefix}/include/lzo -I${prefix}/include"
291}
292
293platform darwin {
294    if {${configure.build_arch} eq "x86_64"} {
295        configure.args-append --target=${configure.build_arch}-Darwin
296    }
297    build.env           LD=${configure.cc}
298}
Note: See TracBrowser for help on using the repository browser.