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

Last change on this file since 57378 was 57378, checked in by ryandesign@…, 11 years ago

Change deprecated svn.tag to svn.revision
See http://lists.macosforge.org/pipermail/macports-dev/2009-August/009699.html

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.9 KB
Line 
1# $Id: Portfile 57378 2009-09-10 08:38:23Z 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
6
7name                mplayer-devel
8version             29418
9revision            1
10categories          multimedia
11maintainers         acho openmaintainer
12platforms           darwin
13
14set dvdnav_ver      1174
15set ffmpeg_ver      19425
16
17description         The MPlayer movie player built from SVN.
18long_description    ${description} It plays most MPEG/VOB, AVI, Ogg/OGM, \
19                    VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, \
20                    NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, \
21                    supported by many native, XAnim, and Win32 DLL codecs. \
22                    You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV \
23                    and even H.264 movies.
24homepage            http://www.mplayerhq.hu/
25
26livecheck.type      none
27
28depends_build       port:pkgconfig port:yasm port:subversion
29depends_lib \
30    port:jpeg port:lame port:libiconv port:libmad \
31    port:libogg port:libpng port:libvorbis port:lzo2 \
32    port:ncurses port:zlib port:bzip2 port:liboil
33
34fetch.type          svn
35#svn.revision        ${version}
36#svn.url             svn://svn.mplayerhq.hu/mplayer/trunk
37worksrcdir          trunk
38
39fetch {
40    system "svn export -r${version} --ignore-externals svn://svn.mplayerhq.hu/mplayer/trunk ${worksrcpath}/"
41    system "svn export -r${dvdnav_ver} svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav/src ${worksrcpath}/libdvdnav/"
42    system "svn export -r${dvdnav_ver} svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread/src ${worksrcpath}/libdvdread4/"
43    system "svn export -r${ffmpeg_ver} svn://svn.ffmpeg.org/ffmpeg/trunk/libavcodec ${worksrcpath}/libavcodec/"
44    system "svn export -r${ffmpeg_ver} svn://svn.ffmpeg.org/ffmpeg/trunk/libavutil ${worksrcpath}/libavutil/"
45    system "svn export -r${ffmpeg_ver} svn://svn.ffmpeg.org/ffmpeg/trunk/libavformat ${worksrcpath}/libavformat/"
46    system "svn export -r${ffmpeg_ver} svn://svn.ffmpeg.org/ffmpeg/trunk/libpostproc ${worksrcpath}/libpostproc/"
47}
48# Do not use the following environment variables, otherwise the build phase
49# will fail.
50configure.cflags    {}
51configure.cppflags  {}
52configure.cxxflags  {}
53configure.ldflags   {}
54
55# Do not use pipes, otherwise the build phase will fail.
56configure.pipe      no
57
58configure.args \
59    --extra-cflags="-I${prefix}/include/lzo -I${prefix}/include" \
60    --extra-ldflags="-L${prefix}/lib -L${prefix}/lib/samba3" \
61    --datadir=${prefix}/share/${name} \
62    --confdir=${prefix}/etc/${name} \
63    --mandir=${prefix}/share/man \
64    --enable-png --enable-jpeg --enable-liblzo \
65    --enable-libvorbis --enable-mad \
66    --enable-largefiles
67
68configure.args-append \
69    --disable-smb --disable-live --disable-dvdnav \
70    --disable-dvdread --disable-cdparanoia --disable-freetype \
71    --disable-fontconfig --disable-fribidi \
72    --disable-enca --disable-libcdio --disable-xvid \
73    --disable-x264 --disable-speex --disable-theora \
74    --disable-faac --disable-libdv \
75    --disable-toolame --disable-twolame --disable-xmms \
76    --disable-musepack --disable-sdl --disable-aa \
77    --disable-caca --disable-x11 --disable-gl --disable-arts \
78    --disable-esd --disable-lirc --disable-mng --disable-libdirac-lavc \
79    --disable-libschroedinger-lavc
80
81patchfiles configure.x11.patch
82
83post-destroot {
84    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
85    eval file copy [glob ${worksrcpath}/DOCS/*] \
86        ${destroot}${prefix}/share/doc/${name}
87    xinstall -d -m 0755 ${destroot}${prefix}/etc/${name}
88    foreach etcfile {codecs.conf dvb-menu.conf example.conf \
89                     input.conf menu.conf} {
90        xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \
91            ${destroot}${prefix}/etc/${name}/${etcfile}
92    }
93    xinstall -d -m 0755 ${destroot}${prefix}/share/man/man1
94    xinstall -m 0644 ${worksrcpath}/DOCS/man/en/mplayer.1 \
95        ${destroot}${prefix}/share/man/man1/
96    xinstall -m 0755 ${worksrcpath}/TOOLS/midentify.sh ${destroot}${prefix}/bin/midentify
97}
98
99universal_variant no
100
101variant man_all_lang \
102    description {Install all possible languages for man pages} {
103    configure.args-append --language=all
104}
105
106# Bundle all the font deps into one onscreen display variant
107# Allow autodetect to pick up fontconfig & freetype
108variant osd \
109    description {Enable onscreen display and TrueType font support} {
110    depends_lib-append      port:fontconfig port:freetype
111    configure.args-delete   --disable-fontconfig
112    configure.args-delete   --disable-freetype
113    configure.args-append   --enable-menu
114}
115
116variant fribidi requires osd \
117    description {Enable FriBidi Unicode support} {
118    depends_lib-append      port:fribidi
119    configure.args-delete   --disable-fribidi
120}
121
122variant noappleremote \
123    description {Disable Apple Infrared Remote support} {
124    configure.args-append   --disable-apple-remote
125}
126
127variant lirc \
128    description {Enable Linux Infrared Remote Daemon support} {
129    depends_lib-append      port:lirc
130    configure.args-delete   --disable-lirc
131}
132
133variant live \
134    description {Enable live555 support} {
135    depends_lib-append      port:live555
136}
137
138#####
139
140variant nodvd \
141    description {Disable DVD and DeCSS support} {
142    configure.args-append   --disable-dvdread-internal --disable-libdvdcss-internal
143}
144
145variant samba description {Enable Samba support} {
146    depends_lib-append port:samba3
147    configure.args-append --enable-smb
148    configure.args-delete --disable-smb
149}
150
151##### External codecs
152
153variant theora \
154    description {Enable OggTheora support} {
155    depends_lib-append      port:libtheora
156    configure.args-delete   --disable-theora
157    configure.args-append   --enable-theora
158}
159
160variant xvid \
161    description {Enable XviD encoding} {
162    depends_lib-append      port:XviD
163    configure.args-delete   --disable-xvid
164}
165
166variant x264 \
167    description {Enable H.264 encoding} {
168    depends_lib-append      port:x264
169    configure.args-delete   --disable-x264
170}
171
172variant speex \
173    description {Enable Speex playback} {
174    depends_lib-append      port:speex-devel
175    configure.args-delete   --disable-speex
176}
177
178variant faac \
179    description {Enable AAC encoding} {
180    depends_lib-append      port:faac
181    configure.args-delete   --disable-faac
182}
183
184variant dv \
185    description {Enable DV encoding} {
186    depends_lib-append      port:libdv
187    configure.args-delete   --disable-libdv
188}
189
190variant twolame \
191    description {Enable MPEG Audio Layer 2 encoding} {
192    depends_lib-append      port:twolame
193    configure.args-delete   --disable-twolame
194}
195
196variant dts \
197    description {Enable non-passthrough DTS playback} {
198    depends_lib-append      port:libdca
199    configure.args-delete   --disable-libdts
200}
201
202variant mng \
203    description {Enable mng codec support} {
204    depends_lib-append      port:libmng
205    configure.args-delete   --disable-mng
206}
207
208variant dirac \
209    description {Enable dirac codec support} {
210    depends_lib-append      port:dirac port:schroedinger
211    configure.args-delete   --disable-libdirac-lavc
212        configure.args-delete   --disable-libschroedinger-lavc
213}
214
215platform darwin powerpc {}
216platform darwin i386 {}
217variant binary_codecs \
218    description {Enable platform-specific binary codecs} {
219    if {[variant_isset darwin_powerpc]} {
220        global mplayercodecs mplayercodecsfile
221        set mplayercodecs       rp9codecs-macosx-20041107.pkg
222        set mplayercodecsfile   ${mplayercodecs}.zip
223        distfiles-append        ${mplayercodecsfile}:codecs
224        checksums-append        ${mplayercodecsfile} \
225                                    md5 788cf4940280fd787c0a2141d88ce3c7 \
226                                    sha1 18abd6d0424c4682815a13b34695d37d2fda2a73 \
227                                    rmd160 c6f49012633bbb84ffa405b8881dc90605d26fc6
228
229        extract.only            ${distname}${extract.suffix}
230
231        depends_build-append    bin:unzip:unzip
232    }
233    if {[variant_isset darwin_i386]} {
234        global mplayercodecs mplayercodecsfile
235        set mplayercodecs       "Essential Codecs Package (Intel).pkg"
236        set mplayercodecsfile   essential-macosx-x86-20060611.zip
237        distfiles-append        ${mplayercodecsfile}:codecs
238        checksums-append        ${mplayercodecsfile} \
239                                    md5 1e409d500336a8318cbe2a67bbf9d9ca \
240                                    sha1 4f8fee483b6c227d8cb774d2d30e1ef36a43e04a \
241                                    rmd160 87beaa40263deb0d0b9166f24d6f9dd686f594fd
242
243        extract.only            ${distname}${extract.suffix}
244
245        depends_build-append    bin:unzip:unzip
246    }
247
248    post-fetch {
249        system "curl --create-dirs http://www.mplayerhq.hu/MPlayer/releases/codecs/${mplayercodecsfile} -o ${distpath}/${mplayercodecsfile}"
250    }
251
252    post-extract {
253        system "unzip -q -d ${worksrcpath} ${distpath}/${mplayercodecsfile}"
254    }
255
256    configure.args-append   --codecsdir=${prefix}/share/${name}/codecs
257
258    post-destroot {
259        xinstall -m 755 -d ${destroot}${prefix}/share/${name}/codecs
260        system "cd ${destroot}${prefix}/share/${name}/codecs && \
261            pax -r -z -f \"${worksrcpath}/${mplayercodecs}/Contents/Archive.pax.gz\""
262    }
263}
264
265
266##### Outputs
267
268variant sdl \
269    description {Enable SDL video output} {
270    depends_lib-append      path:lib/pkgconfig/sdl.pc:libsdl
271    configure.args-delete   --disable-sdl
272}
273
274variant aa \
275    description {Enable animated ASCII art video output} {
276    depends_lib-append      port:aalib
277    configure.args-delete   --disable-aa
278}
279
280variant caca \
281    description {Enable animated ASCII art video output} {
282    depends_lib-append      port:libcaca
283    configure.args-delete   --disable-caca
284}
285
286variant x11 description {Enable x11 support} {
287    depends_lib-append \
288        port:xorg-libXinerama \
289        port:xorg-libXv \
290        port:xorg-libXxf86vm
291
292    configure.args-delete   --disable-x11
293    configure.args-append   --enable-x11 --enable-xv --enable-xinerama --enable-xshape
294}
295
296variant esd \
297    description {Enable EsounD audio output} {
298    depends_lib-append      port:esound
299    configure.args-delete   --disable-esd
300}
301
302platform macosx {
303    configure.args-append   --enable-macosx-bundle \
304                            --enable-qtx
305}
306
307variant glx requires x11 description {Enable glx output support.  Due to a bug in mplayer, this disables corevideo support} {
308    depends_lib-append      port:mesa
309    configure.args-delete   --disable-gl --enable-macosx --enable-macosx-finder-support --enable-macosx-bundle
310    configure.args-append   --enable-gl --disable-corevideo
311}
312
313variant debug description {Compile with debugging symbols} {
314    configure.args-append   --enable-debug=gdb3 --disable-altivec
315    #post-patch {
316    #    reinplace "s:-O2:-O0:g" ${worksrcpath}/configure
317    #}
318}
319
320platform darwin {
321    build.env           LD=${configure.cc}
322}
323
324platform darwin 8 {
325    # Need to force use of c++ for linking when Xcode 2.2 is used since some
326    # bits of libstdc++ are needed during linking
327    build.env           LD=${configure.cxx}
328}
Note: See TracBrowser for help on using the repository browser.