Ticket #24499: Portfile.3

File Portfile.3, 7.9 KB (added by macports.users@…, 14 years ago)

added --prefix=${prefix} to avoid mtree violation

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