Ticket #24499: Portfile.2

File Portfile.2, 7.6 KB (added by macports.users@…, 15 years ago)

using macports-gcc-4.4

Line 
1# $Id: Portfile 64763 2010-03-15 16:31:33Z nox@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-mt
8version                 0.0
9categories              multimedia
10maintainers             macports.users@gmail.com openmaintainer
11platforms               darwin
12
13description             MPlayer with the experimental multithreaded FFmpeg-mt
14long_description        ${description} branch which allows you to use \
15                        multiple cores/CPU.
16homepage                http://www.mplayerhq.hu/
17
18depends_build           port:pkgconfig port:yasm port:git-core \
19                        port:gcc44
20depends_lib \
21        port:jpeg port:lame port:libiconv port:libmad \
22        port:libogg port:libpng port:libtheora port:libvorbis \
23        port:lzo2 port:ncurses port:zlib port:bzip2 port:liboil
24
25fetch.type              git
26git.url                 git://repo.or.cz/mplayer-build.git
27
28configure.compiler      macports-gcc-4.4
29post-fetch {
30        system "cd ${worksrcpath} && ${worksrcpath}/enable-mt && ${worksrcpath}/init -s"
31        file delete ${worksrcpath}/mplayer_options
32        move /tmp/mplayer_options.tmp ${worksrcpath}/mplayer_options
33        file delete /tmp/mplayer_options.tmp
34}
35# TODO get the right core numbers
36# possibly using  mplayer's own configure
37patchfiles      configure.x11.patch
38
39# using macports-gcc-4.4 which understands --cpu=host
40# ffmpeg-config.diff
41checksum                {}
42# Do not use the following environment variables, otherwise the build phase
43# will fail.
44use_configure           no
45configure.cflags        {}
46configure.cppflags      {}
47configure.cxxflags  {}
48configure.ldflags   {}
49configure.cc_archflags  {}
50configure.cxx_archflags {}
51
52# Do not use pipes, otherwise the build phase will fail.
53configure.pipe  no
54
55universal_variant no
56build.target    {}     
57variant man_all_lang \
58        description {Install all possible languages for man pages} {
59        system "printf -- '--language=all' >> /tmp/mplayer_options.tmp"
60}
61
62# man bindtextdomain for this
63variant enable_translation \
64        description {enable support for translated output} {
65        system "printf -- '--enable-translation' >> /tmp/mplayer_options.tmp"
66}
67
68post-destroot {
69        xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
70        xinstall -d -m 0755 ${destroot}${prefix}/etc/${name}
71        xinstall -d -m 0755 ${destroot}${prefix}/share/man/man1
72}
73
74## TODO: test  deleting args from confgiure-args using reinplace
75
76# Bundle all the font deps into one onscreen display variant
77# Allow autodetect to pick up fontconfig & freetype
78variant osd \
79        description {Enable onscreen display and TrueType font support} {
80        depends_lib-append      port:fontconfig port:freetype
81        reinplace "s/--disable-fontconfig//" /tmp/mplayer_options.tmp
82        reinplace "s/--disable-freetype//" /tmp/mplayer_options.tmp
83        system "printf -- '--enable-menu\n' >> /tmp/mplayer_options.tmp"
84}
85
86variant fribidi requires osd \
87        description {Enable FriBidi Unicode support} {
88        depends_lib-append      port:fribidi
89        reinplace "s/--disable-fribidi//" /tmp/mplayer_options.tmp
90}
91
92variant noappleremote \
93        description {Disable Apple Infrared Remote support} {
94        system "printf -- '--disable-apple-remote\n' >> /tmp/mplayer_options.tmp"
95}
96
97variant lirc \
98        description {Enable Linux Infrared Remote Daemon support} {
99        depends_lib-append      port:lirc
100        reinplace "s/--disable-lirc//" /tmp/mplayer_options.tmp
101}
102
103variant live \
104        description {Enable live555 support} {
105        depends_lib-append      port:live555
106        reinplace "s/--disable-live//" /tmp/mplayer_options.tmp
107}
108
109#####
110
111variant nodvd \
112        description {Disable DVD and DeCSS support} {
113        system "printf -- '--disable-dvdread-internal\n--disable-libdvdcss-internal\n' >> /tmp/mplayer_options.tmp"
114}
115variant nosamba description {Enable Samba support} {
116        system "printf -- '--disable-smb\n' >> /tmp/mplayer_options.tmp"
117}
118
119##### External codecs
120
121variant mencoder_extras \
122        description {Enable extra codecs for encoding (XviD, x264, aac, DV, MP2)} {
123
124        depends_lib-append      port:XviD port:x264 port:faac port:libdv \
125            port:twolame
126}
127variant xvid requires mencoder_extras \
128        description {deprecated: use +mencoder_extras instead} {}
129variant x264 requires mencoder_extras \
130        description {deprecated: use +mencoder_extras instead} {}
131variant faac requires mencoder_extras \
132        description {deprecated: use +mencoder_extras instead} {}
133variant dv requires mencoder_extras \
134        description {deprecated: use +mencoder_extras instead} {}
135variant twolame requires mencoder_extras \
136        description {deprecated: use +mencoder_extras instead} {}
137
138
139variant speex \
140        description {Enable Speex playback} {
141        depends_lib-append      port:speex-devel
142        reinplace "s/--disable-speex//" /tmp/mplayer_options.tmp
143}
144
145variant dts \
146        description {Enable non-passthrough DTS playback} {
147        depends_lib-append      port:libdca
148        reinplace "s/--disable-libdts//" /tmp/mplayer_options.tmp
149}
150
151variant mng \
152        description {Enable mng codec support} {
153        depends_lib-append      port:libmng
154        reinplace "s/--disable-mng//" /tmp/mplayer_options.tmp
155}
156
157variant dirac \
158        description {Enable dirac codec support} {
159        depends_lib-append      port:dirac port:schroedinger
160        reinplace "s/--disable-libdirac-lavc//" /tmp/mplayer_options.tmp
161        reinplace "s/--disable-libschroedinger-lavc//" /tmp/mplayer_options.tmp
162}
163
164
165##### Outputs
166
167variant sdl \
168        description {Enable SDL video output} {
169        depends_lib-append      path:lib/pkgconfig/sdl.pc:libsdl
170        reinplace "s/--disable-sdl//" /tmp/mplayer_options.tmp
171}
172
173variant aa \
174        description {Enable animated ASCII art video output} {
175        depends_lib-append      port:aalib
176        reinplace "s/--disable-aa//" /tmp/mplayer_options.tmp
177}
178
179variant caca \
180        description {Enable animated ASCII art video output} {
181        depends_lib-append      port:libcaca
182        reinplace "s/--disable-caca//" /tmp/mplayer_options.tmp
183}
184
185variant x11 description {Enable x11 support} {
186        depends_lib-append \
187        port:xorg-libXinerama \
188        port:xorg-libXv \
189        port:xorg-libXxf86vm
190        system "printf -- '--enable-x11\n--enable-xv\n--enable-xinerama\n--enable-xshape\n--extra-cflags=-I${prefix}/include/X11\n' >> /tmp/mplayer_options.tmp"
191        # TODO figure out how to use Macport's X11
192}
193
194variant esd \
195        description {Enable EsounD audio output} {
196        depends_lib-append      port:esound
197        reinplace "s/--disable-esd//" /tmp/mplayer_options.tmp
198}
199
200#platform macosx {
201#       if { ${configure.build_arch} == "x86_64" } {
202#           system "printf -- '--disable-qtx' >> /tmp/mplayer_options.tmp"
203#       } else {
204#           system "printf -- '--enable-qtx\n' >> /tmp/mplayer_options.tmp"
205#       }
206#}
207
208# variant glx requires x11 description {Enable glx output support.  Due to a bug in mplayer, this disables corevideo support} {
209#       depends_lib-append      port:mesa
210#       reinplace "s/--disable-gl//" /tmp/mplayer_options.tmp
211#       reinplace "s/--enable-macosx//" /tmp/mplayer_options.tmp
212#       reinplace "s/--enable-macosx-finder-support//" /tmp/mplayer_options.tmp
213#       reinplace "s/--enable-macosx-bundle)//" /tmp/mplayer_options.tmp
214#       system "printf -- '--enable-gl\n--disable-corevideo\n' >> /tmp/mplayer_options.tmp"
215#}
216
217variant debug description {Compile with debugging symbols} {
218        system "printf -- '--enable-debug=gdb3\n--disable-altivec' >> /tmp/mplayer_options.tmp"
219        #post-patch {
220        #    reinplace "s:-O2:-O0:g" ${worksrcpath}/configure /tmp/mplayer_options.tmp
221        #}
222}
223
224platform darwin {
225        if { ${configure.build_arch} == "x86_64" } {
226            system "printf -- '--target=${configure.build_arch}-Darwin\n' >> /tmp/mplayer_options.tmp"
227        }
228        build.env           LD=${configure.cc}
229}
230
231platform darwin 8 {
232        # Need to force use of c++ for linking when Xcode 2.2 is used since some
233        # bits of libstdc++ are needed during linking
234        build.env           LD=${configure.cxx}
235}
236
237platform darwin 9 {
238        reinplace "s/--extra-cflags="-I${prefix}/include/lzo//" /tmp/mplayer_options.tmp
239        reinplace "s/-I${prefix}/include//" /tmp/mplayer_options.tmp
240        system "printf -- '--extra-cflags="-fomit-frame-pointer -I${prefix}/include/lzo -I${prefix}/include"'"
241}