| 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 | github.setup mpv-player mpv 0.4.2 v |
| 9 | revision 0 |
| 10 | categories multimedia |
| 11 | license GPL-2+ |
| 12 | maintainers ionic.de:ionic |
| 13 | platforms darwin |
| 14 | |
| 15 | description mpv is a movie player based on MPlayer and mplayer2. |
| 16 | long_description ${description} It plays most MPEG/VOB, AVI, Ogg/OGM, \ |
| 17 | VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, \ |
| 18 | NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, \ |
| 19 | supported by many native, XAnim, and Win32 DLL codecs. \ |
| 20 | You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV \ |
| 21 | and even H.264 movies. |
| 22 | homepage http://www.mpv.io/ |
| 23 | |
| 24 | checksums rmd160 700dc2d620040b9a65fbd57fd9d047d35b8bc4f9 \ |
| 25 | sha256 948fbfd5d51c69224a39b8030333078c7acfac5bd35b511453797b2989975068 |
| 26 | |
| 27 | depends_build path:bin/pkg-config:pkgconfig |
| 28 | depends_lib path:lib/libavcodec.dylib:ffmpeg \ |
| 29 | path:bin/perl:perl5 \ |
| 30 | port:libiconv \ |
| 31 | port:ncurses \ |
| 32 | port:zlib \ |
| 33 | port:libass \ |
| 34 | port:libbluray \ |
| 35 | port:lcms2 \ |
| 36 | port:ossp-uuid \ |
| 37 | port:icu |
| 38 | |
| 39 | # Without the OpenGL patch, mpv will sporadically include both <GL/gl3.h> |
| 40 | # and <GL/gl.h>. This is a problem, as it will disable compile errors for |
| 41 | # deprecated functions and may lead to crashes in OpenGL mode. |
| 42 | # This is really a bug in mpv code and should be fixed there, but |
| 43 | # we'll provide a workaround by making sure <GL/gl3.h> will |
| 44 | # not be included for the time being. |
| 45 | patchfiles patch-video_out_gl_common.h-use-OpenGL-legacy.diff |
| 46 | |
| 47 | universal_variant no |
| 48 | |
| 49 | default_variants +bundle +network +osd +mp3 +opengl +dvd |
| 50 | |
| 51 | |
| 52 | # Default configuration options. Mostly Mac OS X specific. |
| 53 | configure.args-append --enable-libass \ |
| 54 | --enable-coreaudio \ |
| 55 | --enable-cocoa \ |
| 56 | --enable-corevideo \ |
| 57 | --disable-vda-hwaccel \ |
| 58 | --disable-vda-gl |
| 59 | |
| 60 | # mpv autodetects many support libs. To prevent undeclared |
| 61 | # dependencies, explicitly disable everything optional first. |
| 62 | # This list should be expanded each time the port is updated to a |
| 63 | # new version, disabling any newly added options. |
| 64 | configure.args-append --disable-pdf-build \ |
| 65 | --disable-macosx-bundle \ |
| 66 | --disable-debug-build \ |
| 67 | --disable-libsmbclient \ |
| 68 | --disable-libass-osd \ |
| 69 | --disable-libquvi \ |
| 70 | --disable-lirc \ |
| 71 | --disable-dvdread \ |
| 72 | --disable-dvdnav \ |
| 73 | --disable-cdda \ |
| 74 | --disable-enca \ |
| 75 | --disable-mpg123 \ |
| 76 | --disable-pulse \ |
| 77 | --disable-portaudio \ |
| 78 | --disable-jack \ |
| 79 | --disable-openal \ |
| 80 | --disable-gl-cocoa \ |
| 81 | --disable-x11 \ |
| 82 | --disable-xss \ |
| 83 | --disable-xext \ |
| 84 | --disable-xv \ |
| 85 | --disable-gl-x11 \ |
| 86 | --disable-xinerama \ |
| 87 | --disable-xf86vm \ |
| 88 | --disable-xf86xk \ |
| 89 | --disable-caca \ |
| 90 | --disable-jpeg \ |
| 91 | --disable-tv \ |
| 92 | --disable-lua |
| 93 | |
| 94 | # Fix picking up the correct talloc version. |
| 95 | # -isystem has the added benefit of moving the include |
| 96 | # directory specified to the end of the include path list. |
| 97 | # This will help the build system respect custom include |
| 98 | # paths correctly (i.e., searching them before the MP include |
| 99 | # directory.) |
| 100 | configure.cppflags-replace -I${prefix}/include -isystem${prefix}/include |
| 101 | |
| 102 | platform darwin { |
| 103 | notes-append " |
| 104 | The maintainer ships its personal config file in |
| 105 | * ${prefix}/share/examples/${name}/config-maintainer. |
| 106 | |
| 107 | You are strongly encouraged to copy this file to either |
| 108 | * ${prefix}/etc/${name}/${name}.conf (globally for all users of the system) or |
| 109 | * ~/.${name}/config (only for your current user) |
| 110 | and adjust it to your needs. |
| 111 | " |
| 112 | |
| 113 | # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+ |
| 114 | if {${os.major} > 10 || {${os.major} == 10 && ${os.minor} >= 3}} { |
| 115 | configure.args-delete --disable-vda-hwaccel \ |
| 116 | --disable-vda-gl |
| 117 | configure.args-append --enable-vda-hwaccel \ |
| 118 | --enable-vda-gl |
| 119 | |
| 120 | notes-append { |
| 121 | This config file already defines the necessary video output settings to make |
| 122 | use of the hardware acceleration features provided by your operating system. |
| 123 | } |
| 124 | } else { |
| 125 | notes-append { |
| 126 | Sadly, your system is incapable of utilizing mpv's hardware decoding features. |
| 127 | |
| 128 | Please make sure to edit the file after copying and replace the "vo=" line with |
| 129 | options suited for your system or mpv won't work as expected. |
| 130 | Consult ``man mpv'' for further information. |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | |
| 136 | # Shameless copy from ipe-tools. |
| 137 | set python.versions {27 32 33 34} |
| 138 | set python.default_version 27 |
| 139 | |
| 140 | # Create python variants. |
| 141 | foreach ver ${python.versions} { |
| 142 | set variant_line {variant python${ver} description } |
| 143 | append variant_line " {Use python${ver} to generate man pages}" |
| 144 | |
| 145 | foreach over ${python.versions} { |
| 146 | if {${ver} == ${over}} { |
| 147 | continue |
| 148 | } |
| 149 | |
| 150 | append variant_line " conflicts python${over}" |
| 151 | } |
| 152 | |
| 153 | append variant_line " { depends_build-append port:py${ver}-docutils }" |
| 154 | eval $variant_line |
| 155 | } |
| 156 | |
| 157 | # Set default python variant. |
| 158 | set variant_none true |
| 159 | foreach ver ${python.versions} { |
| 160 | if {[variant_isset python${ver}]} { |
| 161 | set variant_none [expr $variant_none && ![variant_isset python${ver}]] |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | if {${variant_none}} { |
| 166 | default_variants-append "+python${python.default_version}" |
| 167 | } |
| 168 | |
| 169 | # Set ${python.version} to the currently active variant. |
| 170 | foreach ver ${python.versions} { |
| 171 | if {[variant_isset python${ver}]} { |
| 172 | set python.version ${ver} |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | post-extract { |
| 177 | if {${os.platform} eq "darwin"} { |
| 178 | xinstall -m 0644 -W ${filespath} config-maintainer ${worksrcpath}/TOOLS/ |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | post-patch { |
| 183 | set python_ver_dot [join [split ${python.version} {}] "."] |
| 184 | reinplace -W "${worksrcpath}" "s|'rst2man'|'rst2man-${python_ver_dot}'|" wscript |
| 185 | } |
| 186 | |
| 187 | pre-configure { |
| 188 | system -W "${worksrcpath}" "${waf.python} bootstrap.py" |
| 189 | } |
| 190 | |
| 191 | post-destroot { |
| 192 | xinstall -d -m 0755 ${destroot}${prefix}/etc/${name} |
| 193 | foreach etcfile {encoding-profiles.conf example.conf input.conf} { |
| 194 | xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \ |
| 195 | ${destroot}${prefix}/etc/${name}/${etcfile} |
| 196 | } |
| 197 | xinstall -d -m 0755 ${destroot}${prefix}/share/examples/${name} |
| 198 | eval file copy [glob ${worksrcpath}/TOOLS/lua ${worksrcpath}/TOOLS/*.pl \ |
| 199 | ${worksrcpath}/TOOLS/*.sh ${worksrcpath}/TOOLS/*.py \ |
| 200 | ${worksrcpath}/TOOLS/umpv ${worksrcpath}/TOOLS/lib] \ |
| 201 | ${destroot}${prefix}/share/examples/${name} |
| 202 | |
| 203 | if {${os.platform} eq "darwin"} { |
| 204 | xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer \ |
| 205 | ${destroot}${prefix}/share/examples/${name} |
| 206 | } |
| 207 | |
| 208 | if {[variant_isset bundle]} { |
| 209 | xinstall -d -m 0755 ${destroot}${applications_dir} |
| 210 | file rename ${destroot}${prefix}/bin/mpv.app ${destroot}${applications_dir} |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | |
| 215 | # When enabling features, make sure to replace the "disable" flags with |
| 216 | # "enable" flags in order to make the waf build system error out in case |
| 217 | # a feature cannot be used/found. Problems like that indicate a missing |
| 218 | # runtime dependency. |
| 219 | # libquvi is a special case. We just add libquvi-scripts as a dependency |
| 220 | # and hope for waf to autodetect this version. Do not explicitly enable |
| 221 | # libquvi, as mpv supports multiple versions and we don't want waf to |
| 222 | # throw an error if some other version wasn't found. |
| 223 | |
| 224 | variant bundle description {Enable the optional Mac OS X bundle of mpv} { |
| 225 | configure.args-replace --disable-macosx-bundle \ |
| 226 | --enable-macosx-bundle |
| 227 | } |
| 228 | |
| 229 | variant screenshot description {Enable optional screenshot support} { |
| 230 | depends_lib-append port:jpeg |
| 231 | configure.args-replace --disable-jpeg \ |
| 232 | --enable-jpeg |
| 233 | } |
| 234 | |
| 235 | variant network description {Enable networking support via libquvi-scripts} { |
| 236 | depends_lib-append port:libquvi \ |
| 237 | port:libquvi-scripts |
| 238 | configure.args-delete --disable-libquvi |
| 239 | } |
| 240 | |
| 241 | variant lirc description {Enable Linux Infrared Remote Daemon support} { |
| 242 | depends_lib-append port:lirc |
| 243 | configure.args-replace --disable-lirc \ |
| 244 | --enable-lirc |
| 245 | } |
| 246 | |
| 247 | variant dvd description {Enable DVD and DeCSS support} { |
| 248 | depends_lib-append port:libdvdread \ |
| 249 | port:libdvdnav |
| 250 | configure.args-replace --disable-dvdread \ |
| 251 | --enable-dvdread |
| 252 | configure.args-replace --disable-dvdnav \ |
| 253 | --enable-dvdnav |
| 254 | } |
| 255 | |
| 256 | variant audiocd description {Enable Audio CD support via libcdio-paranoia (currently unsupported!)} { |
| 257 | #depends_lib-append port:libcdio-paranoia |
| 258 | #configure.args-replace --disable-cdda \ |
| 259 | --enable-cdda |
| 260 | ui_error "Audio CD support is currently disabled due to a missing libcdio-paranoia port." |
| 261 | error "audiocd variant not supported" |
| 262 | } |
| 263 | |
| 264 | variant enca description {Enable encoding support via ENCA} { |
| 265 | depends_lib-append port:enca |
| 266 | configure.args-replace --disable-enca \ |
| 267 | --enable-enca |
| 268 | } |
| 269 | |
| 270 | variant mp3 description {Enable mp3 support via mpg123} { |
| 271 | depends_lib-append port:mpg123 |
| 272 | configure.args-replace --disable-mpg123 \ |
| 273 | --enable-mpg123 |
| 274 | } |
| 275 | |
| 276 | variant pulseaudio description {Enable PulseAudio support} { |
| 277 | depends_lib-append port:pulseaudio |
| 278 | configure.args-replace --disable-pulse \ |
| 279 | --enable-pulse |
| 280 | } |
| 281 | |
| 282 | variant portaudio description {Enable portaudio support} { |
| 283 | depends_lib-append port:portaudio |
| 284 | configure.args-replace --disable-portaudio \ |
| 285 | --enable-portaudio |
| 286 | } |
| 287 | |
| 288 | variant jack description {Enable Jack Audio Connection Kit support} { |
| 289 | depends_lib-append port:jack |
| 290 | configure.args-replace --disable-jack \ |
| 291 | --enable-jack |
| 292 | } |
| 293 | |
| 294 | # TODO: switch that to openal-soft? Leave it as-is? |
| 295 | variant openal description {Enable OpenAL support} { |
| 296 | depends_lib-append port:openal |
| 297 | configure.args-replace --disable-openal \ |
| 298 | --enable-openal |
| 299 | } |
| 300 | |
| 301 | variant x11 { |
| 302 | depends_lib-append port:xorg-libXext \ |
| 303 | port:xorg-libXScrnSaver \ |
| 304 | port:xorg-libXinerama \ |
| 305 | port:xorg-libXv \ |
| 306 | port:xorg-libXxf86vm |
| 307 | |
| 308 | configure.args-delete --disable-x11 \ |
| 309 | --disable-xss \ |
| 310 | --disable-xext \ |
| 311 | --disable-xinerama \ |
| 312 | --disable-xv \ |
| 313 | --disable-xf86vm |
| 314 | configure.args-append --enable-x11 \ |
| 315 | --enable-xss \ |
| 316 | --enable-xext \ |
| 317 | --enable-xv \ |
| 318 | --enable-xinerama \ |
| 319 | --enable-xf86vm |
| 320 | } |
| 321 | |
| 322 | variant opengl description {Enable glx output support. Both the CoreVideo and X11 outputs are supported} { |
| 323 | configure.args-replace --disable-gl-cocoa \ |
| 324 | --enable-gl-cocoa |
| 325 | |
| 326 | if {[variant_isset x11]} { |
| 327 | depends_lib-append port:mesa |
| 328 | configure.args-replace --disable-gl-x11 \ |
| 329 | --enable-gl-x11 |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | variant caca description {Enable animated ASCII art video output} { |
| 334 | depends_lib-append port:libcaca |
| 335 | configure.args-replace --disable-caca \ |
| 336 | --enable-caca |
| 337 | } |
| 338 | |
| 339 | variant osd description {Enable onscreen display and TrueType font support} { |
| 340 | depends_lib-append port:lua |
| 341 | configure.args-delete --disable-lua \ |
| 342 | --disable-libass-osd |
| 343 | configure.args-append --enable-lua \ |
| 344 | --lua=52 \ |
| 345 | --enable-libass-osd |
| 346 | } |
| 347 | |
| 348 | variant smb description {Enable Samba support} { |
| 349 | depends_lib-append path:lib/pkgconfig/smbclient.pc:samba3 |
| 350 | configure.args-replace --disable-libsmbclient \ |
| 351 | --enable-libsmbclient |
| 352 | } |
| 353 | |
| 354 | variant debug description {Compile with debugging symbols} { |
| 355 | configure.args-replace --disable-debug-build \ |
| 356 | --enable-debug-build |
| 357 | } |
| 358 | |
| 359 | variant printable_doc description {Generate printable documents (PDF help)} { |
| 360 | # py27-pdfrw and py27-Pillow are needed by rst2pdf. |
| 361 | depends_build-append port:rst2pdf \ |
| 362 | port:py27-pdfrw \ |
| 363 | port:py27-Pillow |
| 364 | configure.args-replace --disable-pdf-build \ |
| 365 | --enable-pdf-build |
| 366 | } |