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 | |
---|
5 | PortSystem 1.0 |
---|
6 | |
---|
7 | name mplayer-mt |
---|
8 | version 0.0 |
---|
9 | categories multimedia |
---|
10 | maintainers macports.users@gmail.com openmaintainer |
---|
11 | platforms darwin |
---|
12 | |
---|
13 | description MPlayer with the experimental multithreaded FFmpeg-mt |
---|
14 | long_description ${description} branch which allows you to use \ |
---|
15 | multiple cores/CPU. |
---|
16 | homepage http://www.mplayerhq.hu/ |
---|
17 | |
---|
18 | depends_build port:pkgconfig port:yasm port:git-core \ |
---|
19 | port:gcc44 |
---|
20 | depends_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 | |
---|
25 | fetch.type git |
---|
26 | git.url git://repo.or.cz/mplayer-build.git |
---|
27 | |
---|
28 | configure.compiler macports-gcc-4.4 |
---|
29 | post-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 |
---|
37 | patchfiles configure.x11.patch |
---|
38 | |
---|
39 | # using macports-gcc-4.4 which understands --cpu=host |
---|
40 | # ffmpeg-config.diff |
---|
41 | checksum {} |
---|
42 | # Do not use the following environment variables, otherwise the build phase |
---|
43 | # will fail. |
---|
44 | use_configure no |
---|
45 | configure.cflags {} |
---|
46 | configure.cppflags {} |
---|
47 | configure.cxxflags {} |
---|
48 | configure.ldflags {} |
---|
49 | configure.cc_archflags {} |
---|
50 | configure.cxx_archflags {} |
---|
51 | |
---|
52 | # Do not use pipes, otherwise the build phase will fail. |
---|
53 | configure.pipe no |
---|
54 | |
---|
55 | universal_variant no |
---|
56 | build.target {} |
---|
57 | variant 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 |
---|
63 | variant enable_translation \ |
---|
64 | description {enable support for translated output} { |
---|
65 | system "printf -- '--enable-translation' >> /tmp/mplayer_options.tmp" |
---|
66 | } |
---|
67 | |
---|
68 | post-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 |
---|
78 | variant 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 | |
---|
86 | variant 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 | |
---|
92 | variant noappleremote \ |
---|
93 | description {Disable Apple Infrared Remote support} { |
---|
94 | system "printf -- '--disable-apple-remote\n' >> /tmp/mplayer_options.tmp" |
---|
95 | } |
---|
96 | |
---|
97 | variant 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 | |
---|
103 | variant 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 | |
---|
111 | variant nodvd \ |
---|
112 | description {Disable DVD and DeCSS support} { |
---|
113 | system "printf -- '--disable-dvdread-internal\n--disable-libdvdcss-internal\n' >> /tmp/mplayer_options.tmp" |
---|
114 | } |
---|
115 | variant nosamba description {Enable Samba support} { |
---|
116 | system "printf -- '--disable-smb\n' >> /tmp/mplayer_options.tmp" |
---|
117 | } |
---|
118 | |
---|
119 | ##### External codecs |
---|
120 | |
---|
121 | variant 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 | } |
---|
127 | variant xvid requires mencoder_extras \ |
---|
128 | description {deprecated: use +mencoder_extras instead} {} |
---|
129 | variant x264 requires mencoder_extras \ |
---|
130 | description {deprecated: use +mencoder_extras instead} {} |
---|
131 | variant faac requires mencoder_extras \ |
---|
132 | description {deprecated: use +mencoder_extras instead} {} |
---|
133 | variant dv requires mencoder_extras \ |
---|
134 | description {deprecated: use +mencoder_extras instead} {} |
---|
135 | variant twolame requires mencoder_extras \ |
---|
136 | description {deprecated: use +mencoder_extras instead} {} |
---|
137 | |
---|
138 | |
---|
139 | variant speex \ |
---|
140 | description {Enable Speex playback} { |
---|
141 | depends_lib-append port:speex-devel |
---|
142 | reinplace "s/--disable-speex//" /tmp/mplayer_options.tmp |
---|
143 | } |
---|
144 | |
---|
145 | variant 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 | |
---|
151 | variant mng \ |
---|
152 | description {Enable mng codec support} { |
---|
153 | depends_lib-append port:libmng |
---|
154 | reinplace "s/--disable-mng//" /tmp/mplayer_options.tmp |
---|
155 | } |
---|
156 | |
---|
157 | variant 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 | |
---|
167 | variant 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 | |
---|
173 | variant 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 | |
---|
179 | variant 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 | |
---|
185 | variant 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 | |
---|
194 | variant 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 | |
---|
217 | variant 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 | |
---|
224 | platform 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 | |
---|
231 | platform 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 | |
---|
237 | platform 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 | } |
---|