source: trunk/dports/multimedia/mplayer-devel/Portfile

Last change on this file was 148742, checked in by jeremyhu@…, 17 months ago

mplayer-devel: Bump to r37869 and recent ffmpeg master

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