source: trunk/dports/multimedia/MPlayer/Portfile

Last change on this file was 148743, checked in by jeremyhu@…, 16 months ago

MPlayer: Bump to 1.3.0

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