1 | # -*- 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 |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup github 1.0 |
---|
6 | PortGroup waf 1.0 |
---|
7 | |
---|
8 | # Please revbump mpv whenever ffmpeg{,-devel} is updated! |
---|
9 | github.setup mpv-player mpv 0.8.3 v |
---|
10 | revision 4 |
---|
11 | categories multimedia |
---|
12 | license GPL-2+ |
---|
13 | maintainers ionic |
---|
14 | platforms darwin |
---|
15 | |
---|
16 | description mpv is a movie player based on MPlayer and mplayer2. |
---|
17 | long_description ${description} It plays most MPEG/VOB, AVI, Ogg/OGM, \ |
---|
18 | VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, \ |
---|
19 | NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, \ |
---|
20 | supported by many native, XAnim, and Win32 DLL codecs. \ |
---|
21 | You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV \ |
---|
22 | and even H.264 movies. |
---|
23 | homepage http://www.mpv.io/ |
---|
24 | |
---|
25 | set waf_version 1.8.4 |
---|
26 | set waf_distfile waf-${waf_version} |
---|
27 | set mpv_distfile ${distfiles} |
---|
28 | master_sites-append http://ftp.waf.io/pub/release:waf |
---|
29 | distfiles-append ${waf_distfile}:waf |
---|
30 | |
---|
31 | extract.only-delete ${waf_distfile} |
---|
32 | |
---|
33 | checksums ${mpv_distfile} \ |
---|
34 | rmd160 47b05fed9dfcb8e858e5f1ad1090c6ec392afe8b \ |
---|
35 | sha256 1dee09eb47bb26241af0f9f267424e078166e5182b5cdc4653d22ceef63bc20d \ |
---|
36 | ${waf_distfile} \ |
---|
37 | rmd160 d58b790001664fe5f6a720e4ff9ce9f4105d195a \ |
---|
38 | sha256 f02035fa5d8814f33f19b2b20d43822ddef6bb39b955ca196c2a247a1f9ffaa8 |
---|
39 | |
---|
40 | depends_build path:bin/pkg-config:pkgconfig |
---|
41 | depends_lib path:lib/libavcodec.dylib:ffmpeg \ |
---|
42 | path:bin/perl:perl5 \ |
---|
43 | port:libiconv \ |
---|
44 | port:zlib \ |
---|
45 | port:libass \ |
---|
46 | port:libbluray \ |
---|
47 | port:lcms2 \ |
---|
48 | port:ossp-uuid |
---|
49 | |
---|
50 | universal_variant no |
---|
51 | |
---|
52 | default_variants +bundle +network +osd +mp3 +opengl +dvd +audiocd |
---|
53 | |
---|
54 | # Current waf doesn't support --nocache anymore. Set by PortGroup. |
---|
55 | configure.args-delete --nocache |
---|
56 | |
---|
57 | # Default configuration options. Mostly Mac OS X specific. |
---|
58 | # We cannot use --enable-cplayer here. Only --disable-cplayer |
---|
59 | # is recognized. Boo! |
---|
60 | configure.args-append --enable-manpage-build \ |
---|
61 | --enable-libass \ |
---|
62 | --enable-coreaudio \ |
---|
63 | --enable-cocoa \ |
---|
64 | --disable-vda-hwaccel \ |
---|
65 | --disable-vda-gl |
---|
66 | |
---|
67 | # mpv autodetects many support libs. To prevent undeclared |
---|
68 | # dependencies, explicitly disable everything optional first. |
---|
69 | # This list should be expanded each time the port is updated to a |
---|
70 | # new version, disabling any newly added options. |
---|
71 | configure.args-append --disable-pdf-build \ |
---|
72 | --disable-test \ |
---|
73 | --disable-clang-database \ |
---|
74 | --disable-debug-build \ |
---|
75 | --disable-libsmbclient \ |
---|
76 | --disable-libass-osd \ |
---|
77 | --disable-lirc \ |
---|
78 | --disable-dvdread \ |
---|
79 | --disable-dvdnav \ |
---|
80 | --disable-cdda \ |
---|
81 | --disable-vapoursynth \ |
---|
82 | --disable-vapoursynth-lazy \ |
---|
83 | --disable-enca \ |
---|
84 | --disable-mpg123 \ |
---|
85 | --disable-pulse \ |
---|
86 | --disable-jack \ |
---|
87 | --disable-openal \ |
---|
88 | --disable-gl-cocoa \ |
---|
89 | --disable-x11 \ |
---|
90 | --disable-xss \ |
---|
91 | --disable-xext \ |
---|
92 | --disable-xv \ |
---|
93 | --disable-gl-x11 \ |
---|
94 | --disable-egl-x11 \ |
---|
95 | --disable-xinerama \ |
---|
96 | --disable-xrandr \ |
---|
97 | --disable-caca \ |
---|
98 | --disable-jpeg \ |
---|
99 | --disable-tv \ |
---|
100 | --disable-lua \ |
---|
101 | --disable-apple-remote |
---|
102 | |
---|
103 | # Fix picking up the correct talloc version. |
---|
104 | # -isystem has the added benefit of moving the include |
---|
105 | # directory specified to the end of the include path list. |
---|
106 | # This will help the build system respect custom include |
---|
107 | # paths correctly (i.e., searching them before the MP include |
---|
108 | # directory.) |
---|
109 | configure.cppflags-replace -I${prefix}/include -isystem${prefix}/include |
---|
110 | |
---|
111 | build.args-append -v |
---|
112 | |
---|
113 | platform macosx { |
---|
114 | if {${os.major} > 10} { |
---|
115 | # Force recent enough Xcode. |
---|
116 | # We have to compile with the compiler provided by Xcode/CLT |
---|
117 | # due to only it shipping libarclite on 10.7 and knowing where |
---|
118 | # it is. |
---|
119 | # Could "emulate" the same behavior by using MacPort's clang |
---|
120 | # and appending -L/usr/lib/arc/ to CFLAGS/CXXFLAGS on 10.7, |
---|
121 | # but I don't particularily like that idea (yet.) |
---|
122 | # Keep using the "system compiler" for now. Also means one less |
---|
123 | # dependency on recent systems, so yay. |
---|
124 | PortGroup xcodeversion 1.0 |
---|
125 | minimum_xcodeversions {11 4.4} |
---|
126 | |
---|
127 | # Force clang compiler as installed by Xcode's CLT's... hopefully. |
---|
128 | compiler.blacklist-append *gcc* cc macports-* |
---|
129 | } else { |
---|
130 | # clang is required to build mpv. The newer, the merrier. |
---|
131 | # Part of getting mpv to work on SL -- c.f. #44662 |
---|
132 | compiler.blacklist-append *gcc* cc |
---|
133 | |
---|
134 | compiler.fallback-delete macports-clang-3.4 |
---|
135 | compiler.fallback-append macports-clang-3.4 |
---|
136 | |
---|
137 | # Reorder list, move older or unknown versions to the end. |
---|
138 | compiler.fallback-delete clang macports-clang-3.3 |
---|
139 | compiler.fallback-append clang macports-clang-3.3 |
---|
140 | } |
---|
141 | |
---|
142 | configure.args-replace --disable-apple-remote \ |
---|
143 | --enable-apple-remote |
---|
144 | } |
---|
145 | |
---|
146 | platform darwin { |
---|
147 | notes-append " |
---|
148 | The maintainer ships his personal config file in |
---|
149 | * ${prefix}/share/examples/${name}/config-maintainer. |
---|
150 | |
---|
151 | You are strongly encouraged to copy this file to either |
---|
152 | * ${prefix}/etc/${name}/${name}.conf (globally for all users of the system) or |
---|
153 | * ~/.${name}/config (only for your current user) |
---|
154 | and adjust it to your needs. |
---|
155 | " |
---|
156 | |
---|
157 | # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+ |
---|
158 | if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} { |
---|
159 | configure.args-delete --disable-vda-hwaccel \ |
---|
160 | --disable-vda-gl |
---|
161 | configure.args-append --enable-vda-hwaccel \ |
---|
162 | --enable-vda-gl |
---|
163 | |
---|
164 | notes-append { |
---|
165 | This config file already defines the necessary video output settings to make |
---|
166 | use of the hardware acceleration features provided by your operating system. |
---|
167 | } |
---|
168 | } else { |
---|
169 | notes-append { |
---|
170 | Sadly, your system is incapable of utilizing mpv's hardware decoding features. |
---|
171 | |
---|
172 | Please make sure to edit the file after copying and replace the "vo=" line with |
---|
173 | options suited for your system or mpv won't work as expected. |
---|
174 | Consult ``man mpv'' for further information. |
---|
175 | } |
---|
176 | } |
---|
177 | |
---|
178 | # Shared build fixes for 10.6 and 10.7. |
---|
179 | if {${os.major} < 12} { |
---|
180 | patchfiles-append patch-misc-import-CoreVideo.diff |
---|
181 | } |
---|
182 | |
---|
183 | # Versions 10.6 and below don't support XCode 4, which is required for ARCLite. |
---|
184 | # We will have to patch mpv for unofficial Cocoa support. |
---|
185 | # Also fix some other minor compile issues only manifesting on 10.6 and below along the way. |
---|
186 | if {${os.major} < 11} { |
---|
187 | patchfiles-append patch-waftools_checks_custom.py-disable-libarclite.diff \ |
---|
188 | patch-misc-add-strnlen.diff \ |
---|
189 | patch-audio_out_ao_coreaudio_exclusive.c-compile-fix.diff \ |
---|
190 | patch-video_out_cocoa_events_view.h-remove-NSDraggingDestination-protocol.diff \ |
---|
191 | patch-video_out_cocoa_events_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff \ |
---|
192 | patch-video_out_cocoa_video_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff \ |
---|
193 | patch-video_out_cocoa_events_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff \ |
---|
194 | patch-video_out_cocoa_window.m-fullscreen-fixes.diff \ |
---|
195 | patch-video_out_cocoa_common.m-define-constants.diff \ |
---|
196 | patch-video_out_gl_cocoa.c-hardcode-OpenGL-2.diff \ |
---|
197 | patch-osdep_macosx_compat.m-add-subscripting-implementation.diff |
---|
198 | |
---|
199 | # Let's hope this is actually unneeded... |
---|
200 | #patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff |
---|
201 | |
---|
202 | notes-append { |
---|
203 | On systems older than Lion (10.7), Cocoa output support is currently |
---|
204 | being patched by the MacPorts maintainer to make it work. |
---|
205 | |
---|
206 | It is known to be broken. |
---|
207 | |
---|
208 | Please do not expect it to work or be bug free. |
---|
209 | } |
---|
210 | } |
---|
211 | |
---|
212 | post-extract { |
---|
213 | xinstall -m 0644 -W "${filespath}" config-maintainer "${worksrcpath}/TOOLS/" |
---|
214 | } |
---|
215 | |
---|
216 | pre-configure { |
---|
217 | if {[variant_isset network]} { |
---|
218 | reinplace -W "${worksrcpath}/TOOLS" "s|@@NETWORK@@||" config-maintainer |
---|
219 | } else { |
---|
220 | reinplace -W "${worksrcpath}/TOOLS" "|@@NETWORK@@|d" config-maintainer |
---|
221 | } |
---|
222 | } |
---|
223 | } |
---|
224 | |
---|
225 | |
---|
226 | # Shameless copy from ipe-tools. |
---|
227 | set python.versions {27 34} |
---|
228 | set python.default_version 27 |
---|
229 | |
---|
230 | # Create python variants. |
---|
231 | foreach ver ${python.versions} { |
---|
232 | set variant_line {variant python${ver} description } |
---|
233 | append variant_line " {Use python${ver} to generate man pages}" |
---|
234 | |
---|
235 | foreach over ${python.versions} { |
---|
236 | if {${ver} == ${over}} { |
---|
237 | continue |
---|
238 | } |
---|
239 | |
---|
240 | append variant_line " conflicts python${over}" |
---|
241 | } |
---|
242 | |
---|
243 | append variant_line " { depends_build-append port:py${ver}-docutils }" |
---|
244 | eval $variant_line |
---|
245 | } |
---|
246 | |
---|
247 | # Set default python variant. |
---|
248 | set variant_none true |
---|
249 | foreach ver ${python.versions} { |
---|
250 | if {[variant_isset python${ver}]} { |
---|
251 | set variant_none [expr $variant_none && ![variant_isset python${ver}]] |
---|
252 | } |
---|
253 | } |
---|
254 | |
---|
255 | if {${variant_none}} { |
---|
256 | default_variants-append "+python${python.default_version}" |
---|
257 | } |
---|
258 | |
---|
259 | # Set ${python.version} to the currently active variant. |
---|
260 | foreach ver ${python.versions} { |
---|
261 | if {[variant_isset python${ver}]} { |
---|
262 | set python.version ${ver} |
---|
263 | } |
---|
264 | } |
---|
265 | |
---|
266 | post-patch { |
---|
267 | set python_ver_dot [join [split ${python.version} {}] "."] |
---|
268 | reinplace -W "${worksrcpath}" "s|'rst2man'|'rst2man-${python_ver_dot}'|" wscript |
---|
269 | } |
---|
270 | |
---|
271 | post-extract { |
---|
272 | xinstall -m 0644 -W "${distpath}" "${waf_distfile}" "${worksrcpath}/waf" |
---|
273 | } |
---|
274 | |
---|
275 | post-destroot { |
---|
276 | xinstall -d -m 0755 ${destroot}${prefix}/etc/${name} |
---|
277 | foreach etcfile {encoding-profiles.conf example.conf input.conf} { |
---|
278 | xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \ |
---|
279 | ${destroot}${prefix}/etc/${name}/${etcfile} |
---|
280 | } |
---|
281 | xinstall -d -m 0755 ${destroot}${prefix}/share/examples/${name} |
---|
282 | copy {*}[glob ${worksrcpath}/TOOLS/lua ${worksrcpath}/TOOLS/*.pl \ |
---|
283 | ${worksrcpath}/TOOLS/*.sh ${worksrcpath}/TOOLS/*.py \ |
---|
284 | ${worksrcpath}/TOOLS/umpv ${worksrcpath}/TOOLS/lib] \ |
---|
285 | ${destroot}${prefix}/share/examples/${name} |
---|
286 | |
---|
287 | if {${os.platform} eq "darwin"} { |
---|
288 | xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer \ |
---|
289 | ${destroot}${prefix}/share/examples/${name} |
---|
290 | } |
---|
291 | } |
---|
292 | |
---|
293 | |
---|
294 | # When enabling features, make sure to replace the "disable" flags with |
---|
295 | # "enable" flags in order to make the waf build system error out in case |
---|
296 | # a feature cannot be used/found. Problems like that indicate a missing |
---|
297 | # runtime dependency. |
---|
298 | |
---|
299 | variant bundle description {Enable the optional Mac OS X bundle of mpv} { |
---|
300 | post-build { |
---|
301 | system -W "${worksrcpath}" "${waf.python} TOOLS/osxbundle.py -s build/mpv" |
---|
302 | } |
---|
303 | |
---|
304 | post-destroot { |
---|
305 | xinstall -d -m 0755 ${destroot}${applications_dir} |
---|
306 | move ${worksrcpath}/build/mpv.app ${destroot}${applications_dir} |
---|
307 | } |
---|
308 | } |
---|
309 | |
---|
310 | variant screenshot description {Enable optional screenshot support} { |
---|
311 | depends_lib-append path:lib/libjpeg.dylib:jpeg |
---|
312 | configure.args-replace --disable-jpeg \ |
---|
313 | --enable-jpeg |
---|
314 | } |
---|
315 | |
---|
316 | variant network description {Enable networking support via youtube-dl (supports wide variety of pages)} { |
---|
317 | depends_run-append port:youtube-dl |
---|
318 | } |
---|
319 | |
---|
320 | variant lirc description {Enable Linux Infrared Remote Daemon support} { |
---|
321 | depends_lib-append port:lirc |
---|
322 | configure.args-replace --disable-lirc \ |
---|
323 | --enable-lirc |
---|
324 | } |
---|
325 | |
---|
326 | variant dvd description {Enable DVD and DeCSS support} { |
---|
327 | depends_lib-append port:libdvdread \ |
---|
328 | port:libdvdnav |
---|
329 | configure.args-replace --disable-dvdread \ |
---|
330 | --enable-dvdread |
---|
331 | configure.args-replace --disable-dvdnav \ |
---|
332 | --enable-dvdnav |
---|
333 | } |
---|
334 | |
---|
335 | variant audiocd description {Enable Audio CD support via libcdio-paranoia} { |
---|
336 | depends_lib-append port:libcdio-paranoia |
---|
337 | configure.args-replace --disable-cdda \ |
---|
338 | --enable-cdda |
---|
339 | } |
---|
340 | |
---|
341 | variant enca description {Enable encoding support via ENCA} { |
---|
342 | depends_lib-append port:enca |
---|
343 | configure.args-replace --disable-enca \ |
---|
344 | --enable-enca |
---|
345 | } |
---|
346 | |
---|
347 | variant mp3 description {Enable mp3 support via mpg123} { |
---|
348 | depends_lib-append port:mpg123 |
---|
349 | configure.args-replace --disable-mpg123 \ |
---|
350 | --enable-mpg123 |
---|
351 | } |
---|
352 | |
---|
353 | variant pulseaudio description {Enable PulseAudio support} { |
---|
354 | depends_lib-append port:pulseaudio |
---|
355 | configure.args-replace --disable-pulse \ |
---|
356 | --enable-pulse |
---|
357 | } |
---|
358 | |
---|
359 | # Remove after 03-04-2016. |
---|
360 | variant portaudio description {Legacy compatibility variant for portaudio support. Will be removed soon.} { |
---|
361 | } |
---|
362 | |
---|
363 | variant jack description {Enable Jack Audio Connection Kit support} { |
---|
364 | depends_lib-append port:jack |
---|
365 | configure.args-replace --disable-jack \ |
---|
366 | --enable-jack |
---|
367 | } |
---|
368 | |
---|
369 | # TODO: switch that to openal-soft? Leave it as-is? |
---|
370 | variant openal description {Enable OpenAL support} { |
---|
371 | depends_lib-append port:openal |
---|
372 | configure.args-replace --disable-openal \ |
---|
373 | --enable-openal |
---|
374 | } |
---|
375 | |
---|
376 | variant x11 { |
---|
377 | depends_lib-append port:xorg-libXext \ |
---|
378 | port:xorg-libXScrnSaver \ |
---|
379 | port:xorg-libXinerama \ |
---|
380 | port:xorg-libXv \ |
---|
381 | port:xorg-libXrandr |
---|
382 | |
---|
383 | configure.args-delete --disable-x11 \ |
---|
384 | --disable-xss \ |
---|
385 | --disable-xext \ |
---|
386 | --disable-xinerama \ |
---|
387 | --disable-xv \ |
---|
388 | --disable-xrandr |
---|
389 | configure.args-append --enable-x11 \ |
---|
390 | --enable-xss \ |
---|
391 | --enable-xext \ |
---|
392 | --enable-xv \ |
---|
393 | --enable-xinerama \ |
---|
394 | --enable-xrandr |
---|
395 | } |
---|
396 | |
---|
397 | variant opengl description {Enable glx output support. Both the CoreVideo and X11 outputs are supported} { |
---|
398 | configure.args-replace --disable-gl-cocoa \ |
---|
399 | --enable-gl-cocoa |
---|
400 | |
---|
401 | if {[variant_isset x11]} { |
---|
402 | depends_lib-append port:mesa |
---|
403 | configure.args-replace --disable-gl-x11 \ |
---|
404 | --enable-gl-x11 |
---|
405 | # FIXME: add EGL? Leave it disabled? Test! |
---|
406 | #configure.args-replace --disable-egl-x11 \ |
---|
407 | # --enable-egl-x11 |
---|
408 | } |
---|
409 | } |
---|
410 | |
---|
411 | variant caca description {Enable animated ASCII art video output} { |
---|
412 | depends_lib-append port:libcaca |
---|
413 | configure.args-replace --disable-caca \ |
---|
414 | --enable-caca |
---|
415 | } |
---|
416 | |
---|
417 | variant osd description {Enable onscreen display and TrueType font support} { |
---|
418 | depends_lib-append port:lua |
---|
419 | configure.args-delete --disable-lua \ |
---|
420 | --disable-libass-osd |
---|
421 | configure.args-append --enable-lua \ |
---|
422 | --lua=52 \ |
---|
423 | --enable-libass-osd |
---|
424 | } |
---|
425 | |
---|
426 | variant smb description {Enable Samba support} { |
---|
427 | depends_lib-append path:lib/pkgconfig/smbclient.pc:samba3 |
---|
428 | configure.args-replace --disable-libsmbclient \ |
---|
429 | --enable-libsmbclient |
---|
430 | } |
---|
431 | |
---|
432 | variant debug description {Compile with debugging symbols} { |
---|
433 | configure.args-replace --disable-debug-build \ |
---|
434 | --enable-debug-build |
---|
435 | } |
---|
436 | |
---|
437 | variant printable_doc description {Generate printable documents (PDF help)} { |
---|
438 | # py27-pdfrw and py27-Pillow are needed by rst2pdf. |
---|
439 | depends_build-append port:rst2pdf \ |
---|
440 | port:py27-pdfrw \ |
---|
441 | port:py27-Pillow |
---|
442 | configure.args-replace --disable-pdf-build \ |
---|
443 | --enable-pdf-build |
---|
444 | } |
---|