Ticket #24499: Portfile

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

ffmpeg-configure doesn't pick up the right gcc, added gcc_select as depends_build

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