summaryrefslogtreecommitdiff
path: root/media-video/mpv
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-video/mpv
reinit the tree, so we can have metadata
Diffstat (limited to 'media-video/mpv')
-rw-r--r--media-video/mpv/Manifest24
-rw-r--r--media-video/mpv/files/0.18.0/mpv-0.18.0-fix-doc-build.patch23
-rw-r--r--media-video/mpv/files/0.18.0/mpv-0.18.0-fix-fbo-resize-memleak.patch27
-rw-r--r--media-video/mpv/files/0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch66
-rw-r--r--media-video/mpv/files/0.18.0/mpv-0.18.0-fix-initial-av-sync.patch42
-rw-r--r--media-video/mpv/files/0.27.0/mpv-0.27.0-fix-hwdec-autoprobing.patch50
-rw-r--r--media-video/mpv/files/0.27.0/mpv-0.27.0-fix-wrong-colors-with-hwdec.patch44
-rw-r--r--media-video/mpv/files/0.27.0/mpv-0.27.0-remove-duplicate-android-option.patch27
-rw-r--r--media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch28
-rw-r--r--media-video/mpv/files/mpv-0.23.0-make-libavdevice-check-accept-libav.patch20
-rw-r--r--media-video/mpv/metadata.xml44
-rw-r--r--media-video/mpv/mpv-0.18.0-r1.ebuild306
-rw-r--r--media-video/mpv/mpv-0.25.0-r2.ebuild382
-rw-r--r--media-video/mpv/mpv-0.26.0.ebuild373
-rw-r--r--media-video/mpv/mpv-0.27.0.ebuild370
-rw-r--r--media-video/mpv/mpv-9999.ebuild369
16 files changed, 2195 insertions, 0 deletions
diff --git a/media-video/mpv/Manifest b/media-video/mpv/Manifest
new file mode 100644
index 000000000000..58d7593e376e
--- /dev/null
+++ b/media-video/mpv/Manifest
@@ -0,0 +1,24 @@
+AUX 0.18.0/mpv-0.18.0-fix-doc-build.patch 831 SHA256 d8ff10b1acf5f37508c30d6fc62e122b7277f730c307dc36d9cd954219fa4b68 SHA512 6cc45a7cf6a46ab27d1d5e6385b6f63afe06e38d70711dbcb8fcc2bf84bbbda89b8da9d2385a3cbbf2f3520399a12c996246cda19d5bb06457b2fa5fda210f1e WHIRLPOOL 156f43137720b55d2ed8b3762267837698c059d8738a697e041e3dc1e47ac6bd53fdb7ca9343a92ceffb1e015337ff1e6130a9bab8327ba2e49929e29d914277
+AUX 0.18.0/mpv-0.18.0-fix-fbo-resize-memleak.patch 1210 SHA256 5e84f194abec69b14a69181df7b653c5fc2427891e9dc2aae5fd5e22830a4f3c SHA512 646cd1a2ba058d8103a912a62aea6f0c8f89ade398ea71c3a63bccfb7bf30d33e3833bf20e8d88b2fd47fd61a0839adeea0e8140d05093a67544522fd9882aaf WHIRLPOOL 5ba7c4a75d6f71a44e7d81c05841c94d182b84346103347f86ff5dda11dc39ca9c11659ddf40f09dafd756a37bd853559dd88f86749bc757d0872326f505c001
+AUX 0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch 2936 SHA256 3191e8f392ad47ec047cd87972709dc002747cc89bb13d0b445501f460b80a5f SHA512 7bdaf3a416100b488279095067d8b4f63c11655223586724cbe0a1462b9c29866ba049f46c74e70abfe9871881ffc41d5f0348363806f2b4df259700d610bb4f WHIRLPOOL b4be50bae3ae2d2f12a6b1211482b960d91e9c06bec2da77826944e9cf22db1383fde559b63402867d5f13f655c77275aa84d77dd7eabc4461f4c66717a7c2a3
+AUX 0.18.0/mpv-0.18.0-fix-initial-av-sync.patch 1590 SHA256 6fbd1eac75511b843a384b27cf2c036c6c52c89738276d6456bad12e1c7c9151 SHA512 7c083b34c70bafb04fa19cad0562c5de7c5181239907a7671b0a8ec905d711fa7982e0de2954fc664148c1db063e85318665cb550db162961d4ef117410e39f1 WHIRLPOOL 6806933d8702eab70117ce1de2226f6472b6cd68997bc78e74637f0b3b9c8ad76b10d77b4c96b3eb23530387c835decbf36006e44d61a370c320faa6d47bd4b5
+AUX 0.27.0/mpv-0.27.0-fix-hwdec-autoprobing.patch 1456 SHA256 7fe56f7b006b5054557a9a8df83b8317208591c5e7eb41f69fc400656e399f7e SHA512 42cb00778b84157eff45d5143c3e1a232f7c98377d33aa9dbbb30122e678458168fe651b959656f00916a86069b727e814a6b8a9a7d10cd58f45dace2db32ef7 WHIRLPOOL 1fb8bd28daa4dfc8b250304cbdbb077185d9898712c180c08e2787beff69db932ff80b2ad174eafcfa90ff22f294b46094bbaa701a1c3812394ac8a87f8ffcac
+AUX 0.27.0/mpv-0.27.0-fix-wrong-colors-with-hwdec.patch 2102 SHA256 8c940821a7d58f9050fd4657ed2696c66d8bdf0319d7101a555de72b24390f16 SHA512 b2bfcb9529e2b90f786b3277a54018dedc3d8f38db5bf1f45c2df365ea297f05fc93524d225a308078b353f7be3c830e4091070a30a6ca30d767b8d207cb01bd WHIRLPOOL 6fca579cb6fae3bafd7764e8580a64c753e990c8ace081cc9c98dc5de1a08bec2c968e638041c50f8ed3c56a2dd31ea0f99662ed0ff3acf65eea6b0d5ff8570b
+AUX 0.27.0/mpv-0.27.0-remove-duplicate-android-option.patch 996 SHA256 94d13e16e87a5356b14c5ce701abd5b1d16727ea9ac83e16e284ea80ee894197 SHA512 cb2e04515da4f4d1154f489327ec282b75e71c8257477ac2f2602bb21b7c2765b2b6ebc7e5c7e1f6a57f271a804e694a9bf8dd25aa71b34fa13ab7a0ee21283e WHIRLPOOL 78ee0f3c741c015a8a10887b34064d234a26aa8249f814aa504e1f4657b90020625cc1ba35c73179242b6b6e02bb14870619ff9bbb1e3c13b741cb0521aa3f97
+AUX mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch 1456 SHA256 7c5af9ef80d6abb6b168063e037bad80c395e12c5f64726275f284714b4fde10 SHA512 f4865f5ed364012f1cba98c7522f43050c158e36f0100350e87db18636913bdad0b668c62283362366aba10f58db13297d21b111596475200283471d7da058a6 WHIRLPOOL cdd1cf4f9f83cdac07c02452a8b321a87e2b9eb70eae67d2e1b4f02f0cd645c4485dea2b67e7eeababa31835c0a383ee24349a2deceda89a0dda0bcf9e723f52
+AUX mpv-0.23.0-make-libavdevice-check-accept-libav.patch 694 SHA256 9f2e843f2291adf931e11c47d4b78c006496bfaf4ce8f7e2aeafd5e9a868ebc7 SHA512 15861e0f27598c626a5f39319b473483d5d1cec26ca2aad928f6cc751568d7c6eab9bac479665677da92c5c962a3060a8b7cc02899390702e7fed370c28d9a6e WHIRLPOOL ac42dadd05a77e96fd0662a115bb286172e9caf7e4b44f60d939ad16201746d6528521fde712a76e958e4e2e2f25add6898a68b5c3a08e485dafe405b243683d
+DIST mpv-0.18.0.tar.gz 2758960 SHA256 b656638d4f6bce2621baaacb60d8be384aa492fcd86dfd43996aaa2c16fee02b SHA512 5a899ea680b4da6d668a6e77a254e623bafef16f376ee46639e40f151da5a000de84b382f2b07f3a1e87b60fc8e524132767fdf243e36474966af11a88277437 WHIRLPOOL c491e61cb2d7f453cfc23605120048e81c2b7621b8d9591cad6415d3b550f55db6a6c8c6f90d27c7ce214ff89f92a9861d202b457c2de25c5b7de11d8d1d40af
+DIST mpv-0.25.0-patches-r2.tar.xz 11036 SHA256 34440d419e95983f50dc97c323737c19891234478566bdf613ec9db81fb0e0e7 SHA512 fc8d2a23dff27131d2c18d3f91861ec6e6d5240e6531d1a04c06ebef8d5467250c4f131d9faee802842e1ea485dbf350b43a3eebcc13c230cd45ff875fc855e2 WHIRLPOOL 9e1540e8e4b2a2a8e70861dd9eb7f32281549b9c418ea716da697e5de39118b0806998f40958e84d868e00854a4bead929ef9958de0becc120fa5f525b34ccab
+DIST mpv-0.25.0.tar.gz 2874584 SHA256 07423ffad6921ec4da32f703cd7fbfb27012301dcb736ac8542ac8e6083b0bce SHA512 eefc574e2995ddf6bd15c9b62986a5ca277c30949b036d57a11bbfb796c11c1e6dd7c313abd91a909dd98ca0f2b0be29ec6b980d0287a5891b42b0ffba926cbf WHIRLPOOL 4c5225040ed8793de5daa00a4bb5cf2754fb877c73055dbe4bed92d9fa1bb3f5e67d341c698658e9f10e183084bbe691c8bbb90960e16358b9ffdaa58b11bf2b
+DIST mpv-0.26.0.tar.gz 2916212 SHA256 daf3ef358d5f260f2269f7caabce27f446c291457ec330077152127133b71b46 SHA512 fd772b4765317eb1ea3b54f12b86e0ac6c4d5e9d16895eb5bebe2e074a01f6b790981b9b34a87d9b23e4291149d3a7154b09fba4a259cec1949a6aa88d6ddec7 WHIRLPOOL b3648d3f67565c54923fda0c1989dfa94b02b844152a558d531d936c94563ab32654cc59576c39fef8614901fe51afafd2029f9465ec1a15696a093d1bdb563f
+DIST mpv-0.27.0.tar.gz 2956816 SHA256 341d8bf18b75c1f78d5b681480b5b7f5c8b87d97a0d4f53a5648ede9c219a49c SHA512 22738f907d84d362095773972f685e3b03ab4c8172a22ddede290fc221a83ab9135b96f8b18191dabe842b2963f68983929cf065097287fc1a054a7d5f1d0ae4 WHIRLPOOL 53ea0f8f1995b9517954860f4a0c2c1acb797bbd8bf9311c2f6a5998d45869a202e45aa1c3198e2b489b3efe210f58654e690a8a9ec15b4fd88f320ad48c8cb4
+DIST waf-1.8.12 97567 SHA256 01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b SHA512 8e47112abb134f965f15a27a600b4453cad3075afb5dadc17f2f6dac33d80ec68b679ac0ebc5f8a0245cbd07ae9fc7b899e69afc1bd021cce74e7af2ab457939 WHIRLPOOL c36d37c2d8c08e4048b4800f511611af5cf534304fcb58388ca491ff308bfcbcdd959d153edfd6ff8c118404e7293d8b786e43b07486139bf915a82aa75d792b
+DIST waf-1.9.8 100685 SHA256 167dc42bab6d5bd823b798af195420319cb5c9b571e00db7d83df2a0fe1f4dbf SHA512 e7493767f65deeb38aa162adef22adf60ebbd038410e9cdf4fe6f0de8c43395dbbba14962aa2c3855e1277136085fc22ad12ebfb8ac4e76f16358296039b8ea2 WHIRLPOOL 447b6936b8bd5904d85001a96bdcfd0d517f92ff0a859f8a63efd032a418c1b335578266d0f7ce0c5f71ffc7b81643d18e21c14981502153e2d586a9ce152c3a
+EBUILD mpv-0.18.0-r1.ebuild 8452 SHA256 1113b8fed411f5dd3d3c4a0826f227550653bc6cbde5c6159c234dd377100f18 SHA512 67506868d59230a1333fb89822e7c3d6e8652bc43c53c1c41afd980d5b6f76e01a64ee39a9f0debcb57cad000aa141b8f2dd5d909157072f1abc2ca00600725e WHIRLPOOL 7a11ea0d25382abd3bdbc0be597e24cf13969bbeeac6c6fb8291106155f0bb86cbdf3b0facf5a65cf9d8320b0a775f3eedef47aa1c653539752654be7d17fff5
+EBUILD mpv-0.25.0-r2.ebuild 10839 SHA256 b490c7b8c8e5eb1da76d61de699fe7ab317c955df8b7bd5bc08a0e795d615f29 SHA512 04dcdc8d8e53bcb765ac3a0526fb5832e9f18b8b2616dd92a1ffa06dd4471343a46a3e2faaf14e85c477828a0e4bf91fdeeec13b87cdc253fb5b88a9bdf28007 WHIRLPOOL d5f980a2870295f12bad3546fd25aeb042b5abab1baf8bd7d629f90092f20f3287d949488f2f3a19dd3c1367354cbdf47748e8fbd40770970ccaa31adc92f992
+EBUILD mpv-0.26.0.ebuild 10557 SHA256 f67bf34142f9d20a0107e7e16036e31d63f6c462e53dd2438e6dad10e27239b9 SHA512 ffda8bdf4691643e6619334fe1b401c367c8ce7a0a3bc61494a27ad888c8121d045d22111bb98c72551a15d5dbf6e3b34252681a8642be8fa92785cb2b40944e WHIRLPOOL e6e04843b78433e096e7a36525892c2603441730bdf457286b15746e051062031373342dd046b02033d08527d010761a46536b0ab64615ddb99c208ecda6ed79
+EBUILD mpv-0.27.0.ebuild 10540 SHA256 07953548001ba9013172cfe5abed1ff6df06c6281076bb37462ebdcc5f743be1 SHA512 6ce840488391688bcb034f1dfd5f8f481c2e910f4c3fdfecb83700d890a3d4776687162afb9bd60bf6562af663a440f3dc48946bffa6fe60ad62c0d4d048032e WHIRLPOOL e6a084ebd10f8f752b176b93391417b199aa21a1f30db89ccc62c94fd112c2c298e1ff9f0bd7b8225ee2cd876ccd3b2188070b3a6da13efe1cadb70549d7bd38
+EBUILD mpv-9999.ebuild 10512 SHA256 81bb3152e0e3fd608bbf222eaa2f2a8f5953ae2e9a3d05da113f34136e07cf31 SHA512 0e4464a132d8823c154b41da707a34899a8a09d2cab38e89bf96523129c95f850a0076b35288f5f268e3e82139d6b6e1b7d61b4202041baa36b7023a0c7926a5 WHIRLPOOL b2644a782625d7cbdabc2d157eb42992fdf2eae7fb548de87d96a91a5eddfeb84dab63da2d0370e69a4e078e1a81b7ba6a2c2c60706f8ec494f0cba005738aed
+MISC ChangeLog 48965 SHA256 d95e15045be3d79ef0ace6d692812334e9697ba7774baab2dcdc8a97f76dde97 SHA512 78581aa03d45585f41b6dc36507cdbfd7b8988e91e27d511c18e33b3805df7b090489bfa639e34c1126ce980ae008d4ae4d2a8c3e0983c1c74ac4ff22b613e5d WHIRLPOOL d83453527ea927072f94290201f5e551bf1e9a64ad8524db4ca1fcdd8445a83b90282a04208ce12ee6058dc4f02fa03ecc0f6ad3144f5379e864468e0eb33ae4
+MISC ChangeLog-2015 22373 SHA256 fdd3f85ec978ab48e4fa303b0c208cebe282154811e048b587dd5c3f59d3090d SHA512 19b4cff14ab6ffa124f150f9846a50ea83967a8c0c60818a95203cc28b8a24d681b4b51a5fb63b64b0360373f891a01f63fb5ff57e3544b596ff7122ab9c72a8 WHIRLPOOL 698e23043b869f81ce186e06f6ba684fdf6301b49bd964b76fd82819bd27de6b8ba38d02287bc39ded1832da94cecfda9560a14250831f48340fc033dadfbb59
+MISC metadata.xml 2605 SHA256 17337869e777215804da7bacd8f1ee765f44a73738dda112a9aa93ebc9dcb578 SHA512 44088b7e21ef2adb8b69cdb9b7bb3db9874f5c4cf5668d8adca219f0ae7e3b8ae6c0d329ad8489bbf3a95ec5333455d95209d897f239a9c015c6c97acb7f8826 WHIRLPOOL 047a07da6d66e79587865e990d633d9ca6f59faa7181cafce99cd72d9b662d1656a9ee02594c6bc943cebe5a30a6fce341755bc3ea9020523b26022db6ac71de
diff --git a/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-doc-build.patch b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-doc-build.patch
new file mode 100644
index 000000000000..26c8f72d4dae
--- /dev/null
+++ b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-doc-build.patch
@@ -0,0 +1,23 @@
+commit 4a4a9f330281ad11eb39a013bf7308063767bab8
+Author: Martin Herkt <lachs0r@srsfckn.biz>
+Date: Fri Jul 15 12:57:12 2016 +0200
+
+man: fix PDF build error
+
+ReportLab really doesn’t like breaking inline literals, so insert an
+explicit line break.
+
+Fixes #3338
+
+diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
+index 9a251ae..74d17a6 100644
+--- a/DOCS/man/options.rst
++++ b/DOCS/man/options.rst
+@@ -588,6 +588,7 @@ Video
+ :videotoolbox: requires ``--vo=opengl`` (OS X 10.8 and up only)
+ :videotoolbox-copy: copies video back into system RAM (OS X 10.8 and up only)
+ :dxva2: requires ``--vo=opengl:backend=angle`` or
++
+ ``--vo=opengl:backend=dxinterop`` (Windows only)
+ :dxva2-copy: copies video back to system RAM (Windows only)
+ :d3d11va: requires ``--vo=opengl:backend=angle`` (Windows only)
diff --git a/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-fbo-resize-memleak.patch b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-fbo-resize-memleak.patch
new file mode 100644
index 000000000000..9407f15283d5
--- /dev/null
+++ b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-fbo-resize-memleak.patch
@@ -0,0 +1,27 @@
+commit 3abf9c9204e2fcbc1910deb102efab4ab9d8c149
+Author: Niklas Haas <git@nand.wakku.to>
+Date: Wed Jun 8 17:32:40 2016 +0200
+
+vo_opengl: don't constantly resize the output FBO
+
+Commit 883d3114 seems to have (accidentally?) dropped the FBOTEX_FUZZY
+from the output_fbo resize, which means that current master will keep
+resizing and resizing the FBO as you change the window size, introducing
+severe memory leaking after a while. (Not sure why that would cause
+memory leaks, but I blame nvidia)
+
+Either way, it's bad for performance too, so it's worth fixing.
+
+diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
+index bd1eb89..6c7646b 100644
+--- a/video/out/opengl/video.c
++++ b/video/out/opengl/video.c
+@@ -2791,7 +2791,7 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
+ {
+ fbotex_change(&p->output_fbo, p->gl, p->log,
+ p->vp_w, abs(p->vp_h),
+- p->opts.fbo_format, 0);
++ p->opts.fbo_format, FBOTEX_FUZZY);
+ dest_fbo = p->output_fbo.fbo;
+ p->output_fbo_valid = true;
+ }
diff --git a/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch
new file mode 100644
index 000000000000..5033157251fb
--- /dev/null
+++ b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-height-alignment-on-xv.patch
@@ -0,0 +1,66 @@
+commit 22c76e85db88a772e3360892cd3a673a89c6fc7a
+Author: wm4 <wm4@nowhere>
+Date: Sat Jun 25 12:44:42 2016 +0200
+
+vo_xv: fix behavior with odd sizes
+
+The size check introduced in commit d941a57b did not consider that Xv
+can round up the image size to the next chroma boundary. Doing that
+makes sense, so it can't certainly be considered server misbehavior.
+
+Do 2 things against this: allow if the server returns a larger image (we
+just crop it then), and also allocate a properly aligned image in the
+first place.
+
+diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
+index 1e7ae7c..a5a4728 100644
+--- a/video/out/vo_xv.c
++++ b/video/out/vo_xv.c
+@@ -533,6 +533,8 @@ static bool allocate_xvimage(struct vo *vo, int foo)
+ struct vo_x11_state *x11 = vo->x11;
+ // align it for faster OSD rendering (draw_bmp.c swscale usage)
+ int aligned_w = FFALIGN(ctx->image_width, 32);
++ // round up the height to next chroma boundary too
++ int aligned_h = FFALIGN(ctx->image_height, 2);
+ #if HAVE_SHM && HAVE_XEXT
+ if (x11->display_is_local && XShmQueryExtension(x11->display)) {
+ ctx->Shmem_Flag = 1;
+@@ -546,7 +548,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
+ ctx->xvimage[foo] =
+ (XvImage *) XvShmCreateImage(x11->display, ctx->xv_port,
+ ctx->xv_format, NULL,
+- aligned_w, ctx->image_height,
++ aligned_w, aligned_h,
+ &ctx->Shminfo[foo]);
+ if (!ctx->xvimage[foo])
+ return false;
+@@ -569,7 +571,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
+ ctx->xvimage[foo] =
+ (XvImage *) XvCreateImage(x11->display, ctx->xv_port,
+ ctx->xv_format, NULL, aligned_w,
+- ctx->image_height);
++ aligned_h);
+ if (!ctx->xvimage[foo])
+ return false;
+ ctx->xvimage[foo]->data = av_malloc(ctx->xvimage[foo]->data_size);
+@@ -578,16 +580,16 @@ static bool allocate_xvimage(struct vo *vo, int foo)
+ XSync(x11->display, False);
+ }
+
+- if ((ctx->xvimage[foo]->width != aligned_w) ||
+- (ctx->xvimage[foo]->height != ctx->image_height)) {
+- MP_ERR(vo, "Got XvImage with incorrect size: %ux%u (expected %ux%u)\n",
++ if ((ctx->xvimage[foo]->width < aligned_w) ||
++ (ctx->xvimage[foo]->height < aligned_h)) {
++ MP_ERR(vo, "Got XvImage with too small size: %ux%u (expected %ux%u)\n",
+ ctx->xvimage[foo]->width, ctx->xvimage[foo]->height,
+ aligned_w, ctx->image_height);
+ return false;
+ }
+
+ struct mp_image img = get_xv_buffer(vo, foo);
+- img.w = aligned_w;
++ mp_image_set_size(&img, aligned_w, aligned_h);
+ mp_image_clear(&img, 0, 0, img.w, img.h);
+ return true;
+ }
diff --git a/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-initial-av-sync.patch b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-initial-av-sync.patch
new file mode 100644
index 000000000000..c2cacc3bff7a
--- /dev/null
+++ b/media-video/mpv/files/0.18.0/mpv-0.18.0-fix-initial-av-sync.patch
@@ -0,0 +1,42 @@
+commit 614efea3e67a435f3330820c3dc8b402535641e8
+Author: wm4 <wm4@nowhere>
+Date: Fri Jul 1 15:51:34 2016 +0200
+
+ad_lavc: work around braindead ffmpeg behavior
+
+The libavcodec wmapro decoder will skip some bytes at the start of the
+first packet and return each time. It will not return any audio data in
+this state.
+
+Our own code as well as libavcodec's new API handling
+(avcodec_send_packet() etc.) discard the PTS on the first return, which
+means the PTS is never known for the first packet. This results in a
+"Failed audio resync." message.
+
+Fixy it by remember the PTS in next_pts. This field is used only if the
+decoder outputs no PTS, and is updated after each frame - and thus
+should be safe to set.
+
+(Possibly this should be fixed in libavcodec new API handling by not
+setting the PTS to NOPTS as long as no real data has been output. It
+could even interpolate the PTS if the timebase is known.)
+
+Fixes the failure message seen in #3297.
+
+diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
+index f48993f..0316f6b 100644
+--- a/audio/decode/ad_lavc.c
++++ b/audio/decode/ad_lavc.c
+@@ -186,6 +186,12 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt,
+ struct priv *priv = da->priv;
+ AVCodecContext *avctx = priv->avctx;
+
++ // If the decoder discards the timestamp for some reason, we use the
++ // interpolated PTS. Initialize it so that it works for the initial
++ // packet as well.
++ if (mpkt && priv->next_pts == MP_NOPTS_VALUE)
++ priv->next_pts = mpkt->pts;
++
+ int in_len = mpkt ? mpkt->len : 0;
+
+ AVPacket pkt;
diff --git a/media-video/mpv/files/0.27.0/mpv-0.27.0-fix-hwdec-autoprobing.patch b/media-video/mpv/files/0.27.0/mpv-0.27.0-fix-hwdec-autoprobing.patch
new file mode 100644
index 000000000000..e83be2250e72
--- /dev/null
+++ b/media-video/mpv/files/0.27.0/mpv-0.27.0-fix-hwdec-autoprobing.patch
@@ -0,0 +1,50 @@
+commit b881881dbd38a1720a9f8401fd1baafdd0dfccc0
+Author: wm4 <wm4@nowhere>
+Date: Tue Sep 19 18:33:37 2017 +0200
+
+Revert "vd_lavc: change auto-probe order to prefer cuda over vdpau-copy"
+
+This reverts commit 96462040ec79b353457b64949f96fad30bd6e988.
+
+I guess the autoprobing is still too primitive to handle this well. What
+it really should be trying is initializing the wrapper decoder, and if
+that doesn't work, try another method. This is complicated by hwaccels
+initializing in a delayed way, so there is no easy solution yet.
+
+Probably fixes #4865.
+
+diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
+index 476beeb9e..e08246a29 100644
+--- a/video/decode/vd_lavc.c
++++ b/video/decode/vd_lavc.c
+@@ -261,11 +261,16 @@ static const struct vd_lavc_hwdec *const hwdec_list[] = {
+ #endif
+ #if HAVE_VDPAU_HWACCEL
+ &mp_vd_lavc_vdpau,
++ &mp_vd_lavc_vdpau_copy,
+ #endif
+ #if HAVE_VIDEOTOOLBOX_HWACCEL
+ &mp_vd_lavc_videotoolbox,
+ &mp_vd_lavc_videotoolbox_copy,
+ #endif
++#if HAVE_VAAPI_HWACCEL
++ &mp_vd_lavc_vaapi,
++ &mp_vd_lavc_vaapi_copy,
++#endif
+ #if HAVE_D3D_HWACCEL
+ &mp_vd_lavc_d3d11va,
+
+@@ -285,13 +290,6 @@ static const struct vd_lavc_hwdec *const hwdec_list[] = {
+ &mp_vd_lavc_cuda_old,
+ #endif
+ &mp_vd_lavc_cuda_copy,
+-#endif
+-#if HAVE_VDPAU_HWACCEL
+- &mp_vd_lavc_vdpau_copy,
+-#endif
+-#if HAVE_VAAPI_HWACCEL
+- &mp_vd_lavc_vaapi,
+- &mp_vd_lavc_vaapi_copy,
+ #endif
+ &mp_vd_lavc_crystalhd,
+ NULL
diff --git a/media-video/mpv/files/0.27.0/mpv-0.27.0-fix-wrong-colors-with-hwdec.patch b/media-video/mpv/files/0.27.0/mpv-0.27.0-fix-wrong-colors-with-hwdec.patch
new file mode 100644
index 000000000000..f7d3129d8559
--- /dev/null
+++ b/media-video/mpv/files/0.27.0/mpv-0.27.0-fix-wrong-colors-with-hwdec.patch
@@ -0,0 +1,44 @@
+commit 810990a7465f31ee5ff5e29ebea1fb783e5ed502
+Author: wm4 <wm4@nowhere>
+Date: Tue Sep 19 18:59:01 2017 +0200
+
+mp_image: always copy color attributes on hw download
+
+It was noticed that -copy hwdec modes typically dropped the
+chroma_location field. This happened because the attributes on hw
+download are copied with mp_image_copy_attributes(), which tries to copy
+these parameters only if src and dst were both YUV (in an attempt to
+copy parameters only if it makes sense).
+
+But hardware formats did not have the YUV flag set (anymore?), and code
+shouldn't attempt to check the flag in this way anyway. Drop the check,
+and always copy the whole color metadata struct. There is a call to
+mp_image_params_guess_csp() below, which tries to unset nonsense
+metadata if it was copied from a YUV format to RGB. This function would
+also do the right thing for hw formats (although for the cited bug only
+the software case matters).
+
+Fixes #4804.
+
+diff --git a/video/mp_image.c b/video/mp_image.c
+index 7180e2be5..5aa564775 100644
+--- a/video/mp_image.c
++++ b/video/mp_image.c
+@@ -525,15 +525,8 @@ void mp_image_copy_attributes(struct mp_image *dst, struct mp_image *src)
+ dst->params.p_w = src->params.p_w;
+ dst->params.p_h = src->params.p_h;
+ }
+- dst->params.color.primaries = src->params.color.primaries;
+- dst->params.color.gamma = src->params.color.gamma;
+- dst->params.color.sig_peak = src->params.color.sig_peak;
+- dst->params.color.light = src->params.color.light;
+- if ((dst->fmt.flags & MP_IMGFLAG_YUV) == (src->fmt.flags & MP_IMGFLAG_YUV)) {
+- dst->params.color.space = src->params.color.space;
+- dst->params.color.levels = src->params.color.levels;
+- dst->params.chroma_location = src->params.chroma_location;
+- }
++ dst->params.color = src->params.color;
++ dst->params.chroma_location = src->params.chroma_location;
+ dst->params.spherical = src->params.spherical;
+ mp_image_params_guess_csp(&dst->params); // ensure colorspace consistency
+ if ((dst->fmt.flags & MP_IMGFLAG_PAL) && (src->fmt.flags & MP_IMGFLAG_PAL)) {
diff --git a/media-video/mpv/files/0.27.0/mpv-0.27.0-remove-duplicate-android-option.patch b/media-video/mpv/files/0.27.0/mpv-0.27.0-remove-duplicate-android-option.patch
new file mode 100644
index 000000000000..3f2a5d1f56a3
--- /dev/null
+++ b/media-video/mpv/files/0.27.0/mpv-0.27.0-remove-duplicate-android-option.patch
@@ -0,0 +1,27 @@
+commit 8810c1fc050347e1bef0d3eb89edd30c8e840648
+Author: Ilya Tumaykin <itumaykin@gmail.com>
+Date: Sun Sep 17 21:54:37 2017 +0300
+
+build: remove duplicate android option after 72a8120da
+
+The first one (line 140) comes from 69650851f8 and is the correct one.
+The second one (line 731) comes from 72a8120daa and slipped in with the
+revert commit.
+
+Remove the second one.
+
+diff --git a/wscript b/wscript
+index 9d885884d..9fe5b0bc8 100644
+--- a/wscript
++++ b/wscript
+@@ -727,10 +727,6 @@ video_output_features = [
+ 'desc': 'Direct3D support',
+ 'deps': [ 'win32-desktop' ],
+ 'func': check_cc(header_name='d3d9.h'),
+- }, {
+- 'name': '--android',
+- 'desc': 'Android support',
+- 'func': check_statement('android/api-level.h', '(void)__ANDROID__'), # arbitrary android-specific header
+ }, {
+ # We need MMAL/bcm_host/dispmanx APIs. Also, most RPI distros require
+ # every project to hardcode the paths to the include directories. Also,
diff --git a/media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch b/media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch
new file mode 100644
index 000000000000..7c8d5b44c825
--- /dev/null
+++ b/media-video/mpv/files/mpv-0.19.0-make-ffmpeg-version-check-non-fatal.patch
@@ -0,0 +1,28 @@
+player: make ffmpeg/libav version check non-fatal
+
+We already enforce mpv rebuilds when ffmpeg/libav SONAME changes.
+
+diff --git a/player/main.c b/player/main.c
+index 67dde3449..696d2e716 100644
+--- a/player/main.c
++++ b/player/main.c
+@@ -419,13 +419,12 @@ int mp_initialize(struct MPContext *mpctx, char **options)
+ if (!print_libav_versions(mp_null_log, 0)) {
+ // Using mismatched libraries can be legitimate, but even then it's
+ // a bad idea. We don't acknowledge its usefulness and stability.
+- print_libav_versions(mpctx->log, MSGL_FATAL);
+- MP_FATAL(mpctx, "\nmpv was compiled against a different version of "
+- "FFmpeg/Libav than the shared\nlibrary it is linked against. "
+- "This is most likely a broken build and could\nresult in "
+- "misbehavior and crashes.\n\nmpv does not support this "
+- "configuration and will not run - rebuild mpv instead.\n");
+- return -1;
++ print_libav_versions(mpctx->log, MSGL_WARN);
++ MP_WARN(mpctx, "\nmpv was compiled against a different version of "
++ "FFmpeg/Libav than the shared\nlibrary it is linked against. "
++ "This could result in misbehavior and crashes.\n\n"
++ "Upstream does not support this configuration.\n"
++ "Please rebuild mpv in case of any problems.\n");
+ }
+
+ if (opts->dump_stats && opts->dump_stats[0]) {
diff --git a/media-video/mpv/files/mpv-0.23.0-make-libavdevice-check-accept-libav.patch b/media-video/mpv/files/mpv-0.23.0-make-libavdevice-check-accept-libav.patch
new file mode 100644
index 000000000000..de70a4f5cf78
--- /dev/null
+++ b/media-video/mpv/files/mpv-0.23.0-make-libavdevice-check-accept-libav.patch
@@ -0,0 +1,20 @@
+build: make libavdevice configure check accept libav-12
+
+libav-12 is supported, but configure script expects
+a higher libavdevice version than libav-12 provides.
+
+Gentoo-Bug: 603122
+
+diff --git a/wscript b/wscript
+index 94db7e296..7f61f54cc 100644
+--- a/wscript
++++ b/wscript
+@@ -444,7 +444,7 @@ FFmpeg/Libav libraries. You need at least {0}. Aborting.".format(libav_versions_
+ }, {
+ 'name': '--libavdevice',
+ 'desc': 'libavdevice',
+- 'func': check_pkg_config('libavdevice', '>= 57.0.0'),
++ 'func': check_pkg_config('libavdevice', '>= 56.1.0'),
+ }, {
+ 'name': 'avcodec-chroma-pos-api',
+ 'desc': 'libavcodec avcodec_enum_to_chroma_pos API',
diff --git a/media-video/mpv/metadata.xml b/media-video/mpv/metadata.xml
new file mode 100644
index 000000000000..d04429058905
--- /dev/null
+++ b/media-video/mpv/metadata.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>itumaykin+gentoo@gmail.com</email>
+ <name>Coacher</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>media-video@gentoo.org</email>
+ <name>Gentoo Video project</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="archive">Enable support for various archive formats via <pkg>app-arch/libarchive</pkg></flag>
+ <flag name="bluray">Enable playback of Blu-ray filesystems</flag>
+ <flag name="cli">Build mpv CLI player</flag>
+ <flag name="cplugins">Enable C plugins support</flag>
+ <flag name="cuda">Enable hardware video decoding via Nvidia CUDA</flag>
+ <flag name="drm">Enable Kernel Mode Setting / Direct Rendering Manager based video output</flag>
+ <flag name="egl">Enable support for various EGL-based video outputs / backends</flag>
+ <flag name="enca">Enable subtitles charset discovery via <pkg>app-i18n/enca</pkg></flag>
+ <flag name="gbm">Enable Graphics Buffer Manager based EGL video backend</flag>
+ <flag name="jpeg">Enable support for saving screenshots in JPEG format</flag>
+ <flag name="libass">Enable OSD (On Screen Display) and subtitles support via <pkg>media-libs/libass</pkg></flag>
+ <flag name="libguess">Enable subtitles charset discovery via <pkg>app-i18n/libguess</pkg></flag>
+ <flag name="libmpv">Build mpv shared library</flag>
+ <flag name="lua">Enable Lua scripting, OSC (On Screen Controller) GUI and <pkg>net-misc/youtube-dl</pkg> hook-script</flag>
+ <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of <pkg>dev-lang/lua</pkg></flag>
+ <flag name="opengl" restrict="&gt;=media-video/mpv-0.25.0">Enable the recommended 'opengl' video output</flag>
+ <flag name="raspberry-pi">Enable support for the Raspberry Pi</flag>
+ <flag name="rubberband">Enable high quality pitch correction via <pkg>media-libs/rubberband</pkg></flag>
+ <flag name="sdl">Enable <pkg>media-libs/libsdl2</pkg> based video and audio outputs
+ (Note: these outputs exist for compatibility reasons only, avoid if possible)</flag>
+ <flag name="tools">Install extra tools: mpv_identify.sh, mpv_idet.sh, and umpv</flag>
+ <flag name="uchardet">Enable subtitles charset discovery via <pkg>app-i18n/uchardet</pkg></flag>
+ <flag name="vf-dlopen">Install additional video filters to be used with -vf dlopen</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">mpv-player/mpv</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-video/mpv/mpv-0.18.0-r1.ebuild b/media-video/mpv/mpv-0.18.0-r1.ebuild
new file mode 100644
index 000000000000..b13860ffdf49
--- /dev/null
+++ b/media-video/mpv/mpv-0.18.0-r1.ebuild
@@ -0,0 +1,306 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+PYTHON_REQ_USE='threads(+)'
+
+WAF_PV=1.8.12
+
+inherit fdo-mime gnome2-utils pax-utils python-any-r1 toolchain-funcs waf-utils
+
+DESCRIPTION="Media player based on MPlayer and mplayer2"
+HOMEPAGE="https://mpv.io/"
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/mpv-player/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="alpha amd64 ~arm hppa ppc ppc64 x86 ~amd64-linux"
+ DOCS=( RELEASE_NOTES )
+else
+ EGIT_REPO_URI="https://github.com/mpv-player/${PN}.git"
+ inherit git-r3
+fi
+SRC_URI+=" https://waf.io/waf-${WAF_PV}"
+DOCS+=( README.md )
+
+# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC.
+LICENSE="GPL-2+ BSD ISC"
+SLOT="0"
+IUSE="+alsa aqua archive bluray cdda +cli coreaudio doc drm dvb dvd +egl +enca
+ encode gbm +iconv jack jpeg lcms +libass libav libcaca libguess libmpv lua
+ luajit openal +opengl oss pulseaudio raspberry-pi rubberband samba sdl
+ selinux test uchardet v4l vaapi vdpau vf-dlopen wayland +X xinerama
+ +xscreensaver +xv zsh-completion"
+
+REQUIRED_USE="
+ || ( cli libmpv )
+ aqua? ( opengl )
+ egl? ( || ( gbm X wayland ) )
+ enca? ( iconv )
+ gbm? ( drm egl )
+ lcms? ( || ( opengl egl ) )
+ libguess? ( iconv )
+ luajit? ( lua )
+ test? ( || ( opengl egl ) )
+ uchardet? ( iconv )
+ v4l? ( || ( alsa oss ) )
+ vaapi? ( || ( gbm X wayland ) )
+ vdpau? ( X )
+ wayland? ( egl )
+ xinerama? ( X )
+ xscreensaver? ( X )
+ xv? ( X )
+ zsh-completion? ( cli )
+"
+
+COMMON_DEPEND="
+ !libav? ( >=media-video/ffmpeg-2.4:0=[encode?,threads,vaapi?,vdpau?] )
+ libav? ( >=media-video/libav-11:0=[encode?,threads,vaapi?,vdpau?] )
+ sys-libs/zlib
+ alsa? ( >=media-libs/alsa-lib-1.0.18 )
+ archive? ( >=app-arch/libarchive-3.0.0:= )
+ bluray? ( >=media-libs/libbluray-0.3.0 )
+ cdda? ( dev-libs/libcdio-paranoia )
+ drm? ( x11-libs/libdrm )
+ dvb? ( virtual/linuxtv-dvb-headers )
+ dvd? (
+ >=media-libs/libdvdnav-4.2.0
+ >=media-libs/libdvdread-4.1.0
+ )
+ egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] )
+ iconv? (
+ virtual/libiconv
+ enca? ( app-i18n/enca )
+ libguess? ( >=app-i18n/libguess-1.0 )
+ uchardet? ( app-i18n/uchardet )
+ )
+ jack? ( virtual/jack )
+ jpeg? ( virtual/jpeg:0 )
+ lcms? ( >=media-libs/lcms-2.6:2 )
+ libass? (
+ >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz]
+ virtual/ttf-fonts
+ )
+ libcaca? ( >=media-libs/libcaca-0.99_beta18 )
+ lua? (
+ !luajit? ( <dev-lang/lua-5.3:= )
+ luajit? ( dev-lang/luajit:2 )
+ )
+ openal? ( >=media-libs/openal-1.13 )
+ opengl? ( !aqua? ( virtual/opengl ) )
+ pulseaudio? ( media-sound/pulseaudio )
+ raspberry-pi? (
+ >=media-libs/raspberrypi-userland-0_pre20160305-r1
+ media-libs/mesa[egl,gles2]
+ )
+ rubberband? ( >=media-libs/rubberband-1.8.0 )
+ samba? ( net-fs/samba[smbclient(+)] )
+ sdl? ( media-libs/libsdl2[sound,threads,video,X?,wayland?] )
+ v4l? ( media-libs/libv4l )
+ vaapi? ( >=x11-libs/libva-1.4.0[drm?,X?,wayland?] )
+ wayland? (
+ >=dev-libs/wayland-1.6.0
+ >=x11-libs/libxkbcommon-0.3.0
+ )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXext
+ >=x11-libs/libXrandr-1.2.0
+ opengl? ( x11-libs/libXdamage )
+ vdpau? ( >=x11-libs/libvdpau-0.2 )
+ xinerama? ( x11-libs/libXinerama )
+ xscreensaver? ( x11-libs/libXScrnSaver )
+ xv? ( x11-libs/libXv )
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ ${PYTHON_DEPS}
+ >=dev-lang/perl-5.8
+ dev-python/docutils
+ virtual/pkgconfig
+ doc? ( dev-python/rst2pdf )
+ test? ( >=dev-util/cmocka-1.0.0 )
+ v4l? ( virtual/os-headers )
+"
+RDEPEND="${COMMON_DEPEND}
+ selinux? ( sec-policy/selinux-mplayer )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PV}/${P}-fix-height-alignment-on-xv.patch"
+ "${FILESDIR}/${PV}/${P}-fix-initial-av-sync.patch"
+ "${FILESDIR}/${PV}/${P}-fix-fbo-resize-memleak.patch"
+ "${FILESDIR}/${PV}/${P}-fix-doc-build.patch"
+)
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != "binary" ]] && ! tc-has-tls && use vaapi && use egl; then
+ die "Your compiler lacks C++11 TLS support. Use GCC>=4.8.0 or Clang>=3.3."
+ fi
+}
+
+src_prepare() {
+ cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die
+ chmod +x "${S}"/waf || die
+ default_src_prepare
+}
+
+src_configure() {
+ local mywafargs=(
+ --confdir="${EPREFIX}/etc/${PN}"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+
+ $(usex cli '' '--disable-cplayer')
+ $(use_enable libmpv libmpv-shared)
+
+ # See deep down below for build-date.
+ --disable-libmpv-static
+ --disable-static-build
+ --disable-optimize # Don't add '-O2' to CFLAGS.
+ --disable-debug-build # Don't add '-g' to CFLAGS.
+
+ $(use_enable doc html-build)
+ $(use_enable doc pdf-build)
+ $(use_enable vf-dlopen vf-dlopen-filters)
+ $(use_enable zsh-completion zsh-comp)
+ $(use_enable test)
+
+ $(use_enable iconv)
+ $(use_enable samba libsmbclient)
+ $(use_enable lua)
+ $(usex luajit '--lua=luajit' '')
+ $(use_enable libass)
+ $(use_enable libass libass-osd)
+ $(use_enable encode encoding)
+ $(use_enable bluray libbluray)
+ $(use_enable dvd dvdread)
+ $(use_enable dvd dvdnav)
+ $(use_enable cdda)
+ $(use_enable enca)
+ $(use_enable libguess)
+ $(use_enable uchardet)
+ $(use_enable rubberband)
+ $(use_enable lcms lcms2)
+ --disable-vapoursynth # Only available in overlays.
+ --disable-vapoursynth-lazy
+ $(use_enable archive libarchive)
+
+ --enable-libavdevice
+
+ # Audio outputs:
+ $(use_enable sdl sdl2) # Listed under audio, but also includes video.
+ --disable-sdl1
+ $(use_enable oss oss-audio)
+ --disable-rsound # Only available in overlays.
+ $(use_enable pulseaudio pulse)
+ $(use_enable jack)
+ $(use_enable openal)
+ --disable-opensles
+ $(use_enable alsa)
+ $(use_enable coreaudio)
+
+ # Video outputs:
+ $(use_enable aqua cocoa)
+ $(use_enable drm)
+ $(use_enable gbm)
+ $(use_enable wayland)
+ $(use_enable X x11)
+ $(use_enable xscreensaver xss)
+ $(use_enable X xext)
+ $(use_enable xv)
+ $(use_enable xinerama)
+ $(use_enable X xrandr)
+ $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa')
+ $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11')
+ $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
+ $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm')
+ $(use_enable wayland gl-wayland)
+ $(use_enable vdpau)
+ $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
+ $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl.
+ $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11')
+ $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland')
+ $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
+ $(use_enable libcaca caca)
+ $(use_enable jpeg)
+ --disable-android
+ $(use_enable raspberry-pi rpi)
+ $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
+
+ # HWaccels:
+ # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
+ $(use_enable vaapi vaapi-hwaccel)
+ # Automagic VDPAU HW acceleration. See Gentoo bug 558870.
+
+ # TV features:
+ $(use_enable v4l tv)
+ $(use_enable v4l tv-v4l2)
+ $(use_enable v4l libv4l2)
+ $(use_enable v4l audio-input)
+ $(use_enable dvb dvbin)
+
+ # Miscellaneous features:
+ --disable-apple-remote # Needs testing first. See Gentoo bug 577332.
+ )
+
+ if use vaapi && use X; then
+ mywafargs+=(
+ $(use_enable opengl vaapi-glx)
+ $(use_enable egl vaapi-x-egl)
+ )
+ fi
+
+ if ! use egl && ! use opengl && ! use raspberry-pi; then
+ mywafargs+=(--disable-gl)
+ fi
+
+ # Create reproducible non-live builds.
+ [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date)
+
+ waf-utils_src_configure "${mywafargs[@]}"
+}
+
+src_install() {
+ waf-utils_src_install
+
+ if use cli && use luajit; then
+ pax-mark -m "${ED}"usr/bin/${PN}
+ fi
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+
+ # bash-completion < 2.3-r1 already installs (mostly broken) mpv completion.
+ if use cli && ! has_version '<app-shells/bash-completion-2.3-r1' && \
+ ! has_version 'app-shells/mpv-bash-completion'; then
+ elog "If you want to have command-line completion via bash-completion,"
+ elog "please install app-shells/mpv-bash-completion."
+ fi
+
+ if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \
+ has_version 'app-shells/mpv-bash-completion'; then
+ elog "If command-line completion doesn't work after mpv update,"
+ elog "please rebuild app-shells/mpv-bash-completion."
+ fi
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
+
+src_test() {
+ cd "${S}"/build/test || die
+ for test in *; do
+ if [[ -x ${test} ]]; then
+ ./"${test}" || die "Test suite failed"
+ fi
+ done
+}
diff --git a/media-video/mpv/mpv-0.25.0-r2.ebuild b/media-video/mpv/mpv-0.25.0-r2.ebuild
new file mode 100644
index 000000000000..0eccb745b95d
--- /dev/null
+++ b/media-video/mpv/mpv-0.25.0-r2.ebuild
@@ -0,0 +1,382 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+PYTHON_REQ_USE='threads(+)'
+
+WAF_PV=1.9.8
+
+inherit gnome2-utils pax-utils python-r1 toolchain-funcs versionator waf-utils xdg-utils
+
+DESCRIPTION="Media player based on MPlayer and mplayer2"
+HOMEPAGE="https://mpv.io/"
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="
+ https://github.com/mpv-player/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~kensington/distfiles/${P}-patches-${PR}.tar.xz
+ "
+ KEYWORDS="alpha amd64 ~arm ~hppa ppc ppc64 ~x86 ~amd64-linux"
+ DOCS=( RELEASE_NOTES )
+else
+ EGIT_REPO_URI="https://github.com/mpv-player/${PN}.git"
+ inherit git-r3
+fi
+SRC_URI+=" https://waf.io/waf-${WAF_PV}"
+DOCS+=( README.md DOCS/{client-api,interface}-changes.rst )
+
+# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC.
+LICENSE="LGPL-2.1+ GPL-2+ BSD ISC samba? ( GPL-3+ )"
+SLOT="0"
+IUSE="+alsa aqua archive bluray cdda +cli coreaudio cplugins cuda doc drm dvb
+ dvd +egl encode gbm +iconv jack jpeg lcms +libass libav libcaca libmpv +lua
+ luajit openal +opengl oss pulseaudio raspberry-pi rubberband samba sdl
+ selinux test tools +uchardet v4l vaapi vdpau vf-dlopen wayland +X +xv
+ zsh-completion"
+IUSE+=" cpu_flags_x86_sse4_1"
+
+REQUIRED_USE="
+ || ( cli libmpv )
+ aqua? ( opengl )
+ cuda? ( !libav opengl )
+ egl? ( || ( gbm X wayland ) )
+ gbm? ( drm egl opengl )
+ lcms? ( opengl )
+ luajit? ( lua )
+ opengl? ( || ( aqua egl X raspberry-pi !cli ) )
+ raspberry-pi? ( opengl )
+ test? ( opengl )
+ tools? ( cli )
+ uchardet? ( iconv )
+ v4l? ( || ( alsa oss ) )
+ vaapi? ( || ( gbm X wayland ) )
+ vdpau? ( X )
+ wayland? ( egl )
+ X? ( egl? ( opengl ) )
+ xv? ( X )
+ zsh-completion? ( cli )
+ ${PYTHON_REQUIRED_USE}
+"
+
+COMMON_DEPEND="
+ !libav? ( >=media-video/ffmpeg-3.2.2:0=[encode?,threads,vaapi?,vdpau?] )
+ libav? ( >=media-video/libav-12:0=[encode?,threads,vaapi?,vdpau?] )
+ sys-libs/zlib
+ alsa? ( >=media-libs/alsa-lib-1.0.18 )
+ archive? ( >=app-arch/libarchive-3.0.0:= )
+ bluray? ( >=media-libs/libbluray-0.3.0:= )
+ cdda? ( dev-libs/libcdio-paranoia )
+ cuda? ( >=media-video/ffmpeg-3.3:0 )
+ drm? ( x11-libs/libdrm )
+ dvd? (
+ >=media-libs/libdvdnav-4.2.0
+ >=media-libs/libdvdread-4.1.0
+ )
+ egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] )
+ iconv? (
+ virtual/libiconv
+ uchardet? ( app-i18n/uchardet )
+ )
+ jack? ( virtual/jack )
+ jpeg? ( virtual/jpeg:0 )
+ lcms? ( >=media-libs/lcms-2.6:2 )
+ libass? (
+ >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz]
+ virtual/ttf-fonts
+ )
+ libcaca? ( >=media-libs/libcaca-0.99_beta18 )
+ lua? (
+ !luajit? ( <dev-lang/lua-5.3:= )
+ luajit? ( dev-lang/luajit:2 )
+ )
+ openal? ( >=media-libs/openal-1.13 )
+ pulseaudio? ( media-sound/pulseaudio )
+ raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 )
+ rubberband? ( >=media-libs/rubberband-1.8.0 )
+ samba? ( net-fs/samba[smbclient(+)] )
+ sdl? ( media-libs/libsdl2[sound,threads,video] )
+ v4l? ( media-libs/libv4l )
+ vaapi? ( >=x11-libs/libva-1.4.0[drm?,X?,wayland?] )
+ vdpau? ( >=x11-libs/libvdpau-0.2 )
+ wayland? (
+ >=dev-libs/wayland-1.6.0
+ >=x11-libs/libxkbcommon-0.3.0
+ )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXScrnSaver
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ opengl? (
+ x11-libs/libXdamage
+ virtual/opengl
+ )
+ xv? ( x11-libs/libXv )
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ ${PYTHON_DEPS}
+ dev-python/docutils
+ virtual/pkgconfig
+ doc? ( dev-python/rst2pdf )
+ dvb? ( virtual/linuxtv-dvb-headers )
+ test? ( >=dev-util/cmocka-1.0.0 )
+ v4l? ( virtual/os-headers )
+ zsh-completion? ( dev-lang/perl )
+"
+RDEPEND="${COMMON_DEPEND}
+ cuda? ( x11-drivers/nvidia-drivers[X] )
+ selinux? ( sec-policy/selinux-mplayer )
+ tools? ( ${PYTHON_DEPS} )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch"
+ "${FILESDIR}/${PN}-0.23.0-make-libavdevice-check-accept-libav.patch"
+)
+
+mpv_check_compiler() {
+ if [[ ${MERGE_TYPE} != "binary" ]]; then
+ if ! tc-is-gcc && use vaapi && use cpu_flags_x86_sse4_1 && \
+ { has_version '<media-video/ffmpeg-3.3:0' || has_version '<media-video/libav-13:0'; }; then
+ die "${PN} requires GCC for SSE4.1 intrinsics."
+ fi
+ fi
+}
+
+pkg_pretend() {
+ mpv_check_compiler
+}
+
+pkg_setup() {
+ mpv_check_compiler
+ [[ ${MERGE_TYPE} != "binary" ]] && python_setup
+}
+
+src_prepare() {
+ cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die
+ chmod +x "${S}"/waf || die
+ default_src_prepare
+ eapply "${WORKDIR}/${PV}"
+}
+
+src_configure() {
+ tc-export CC PKG_CONFIG AR
+
+ if tc-is-cross-compiler && use raspberry-pi; then
+ export EXTRA_PKG_CONFIG_LIBDIR="${SYSROOT%/}${EPREFIX}/opt/vc/lib/pkgconfig"
+ # Drop next line when Gentoo bug 607344 is fixed or if you fixed it locally.
+ die "${PN} can't be cross built with raspberry-pi USE enabled. See Gentoo bug 607344."
+ fi
+
+ local mywafargs=(
+ --confdir="${EPREFIX}/etc/${PN}"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+
+ $(usex cli '' '--disable-cplayer')
+ $(use_enable libmpv libmpv-shared)
+
+ --disable-libmpv-static
+ --disable-static-build
+ # See deep down below for build-date.
+ --disable-optimize # Don't add '-O2' to CFLAGS.
+ --disable-debug-build # Don't add '-g' to CFLAGS.
+ --enable-html-build
+
+ $(use_enable doc pdf-build)
+ $(use_enable cplugins)
+ $(use_enable vf-dlopen vf-dlopen-filters)
+ $(use_enable zsh-completion zsh-comp)
+ $(use_enable test)
+
+ $(use_enable iconv)
+ $(use_enable samba libsmbclient)
+ $(use_enable lua)
+ $(usex luajit '--lua=luajit' '')
+ $(use_enable libass)
+ $(use_enable libass libass-osd)
+ $(use_enable encode encoding)
+ $(use_enable bluray libbluray)
+ $(use_enable dvd dvdread)
+ $(use_enable dvd dvdnav)
+ $(use_enable cdda)
+ $(use_enable uchardet)
+ $(use_enable rubberband)
+ $(use_enable lcms lcms2)
+ --disable-vapoursynth # Only available in overlays.
+ --disable-vapoursynth-lazy
+ $(use_enable archive libarchive)
+
+ --enable-libavdevice
+
+ # Audio outputs:
+ $(use_enable sdl sdl2) # Listed under audio, but also includes video.
+ --disable-sdl1
+ $(use_enable oss oss-audio)
+ --disable-rsound # Only available in overlays.
+ --disable-sndio # Only available in overlays.
+ $(use_enable pulseaudio pulse)
+ $(use_enable jack)
+ $(use_enable openal)
+ --disable-opensles
+ $(use_enable alsa)
+ $(use_enable coreaudio)
+
+ # Video outputs:
+ $(use_enable aqua cocoa)
+ $(use_enable drm)
+ $(use_enable gbm)
+ $(use_enable wayland)
+ $(use_enable X x11)
+ $(use_enable xv)
+ $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa')
+ $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11')
+ $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
+ $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm')
+ $(usex opengl "$(use_enable wayland gl-wayland)" '--disable-gl-wayland')
+ $(use_enable vdpau)
+ $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
+ $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl.
+ $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11')
+ $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland')
+ $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
+ $(use_enable libcaca caca)
+ $(use_enable jpeg)
+ --disable-android
+ $(use_enable raspberry-pi rpi)
+ $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
+ --disable-mali-fbdev # Only available in overlays.
+ $(usex opengl '' '--disable-gl')
+
+ # HWaccels:
+ # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
+ $(use_enable vaapi vaapi-hwaccel)
+ $(use_enable vdpau vdpau-hwaccel)
+ $(use_enable cuda cuda-hwaccel)
+
+ # TV features:
+ $(use_enable v4l tv)
+ $(use_enable v4l tv-v4l2)
+ $(use_enable v4l libv4l2)
+ $(use_enable v4l audio-input)
+ $(use_enable dvb dvbin)
+
+ # Miscellaneous features:
+ --disable-apple-remote # Needs testing first. See Gentoo bug 577332.
+ )
+
+ if use vaapi && use X; then
+ mywafargs+=(
+ $(use_enable opengl vaapi-glx)
+ $(use_enable egl vaapi-x-egl)
+ )
+ fi
+
+ # Create reproducible non-live builds.
+ [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date)
+
+ waf-utils_src_configure "${mywafargs[@]}"
+}
+
+src_install() {
+ waf-utils_src_install
+
+ if use lua; then
+ insinto /usr/share/${PN}
+ doins -r TOOLS/lua
+ fi
+
+ if use cli && use luajit; then
+ pax-mark -m "${ED}"usr/bin/${PN}
+ fi
+
+ if use tools; then
+ dobin TOOLS/{mpv_identify.sh,umpv}
+ newbin TOOLS/idet.sh mpv_idet.sh
+ python_replicate_script "${ED}"usr/bin/umpv
+ fi
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ local rv softvol_0_18_1=0 osc_0_21_0=0 txtsubs_0_24_0=0 opengl_0_25_0=0
+
+ for rv in ${REPLACING_VERSIONS}; do
+ version_compare ${rv} 0.18.1
+ [[ $? -eq 1 ]] && softvol_0_18_1=1
+ version_compare ${rv} 0.21.0
+ [[ $? -eq 1 ]] && osc_0_21_0=1
+ version_compare ${rv} 0.24.0
+ [[ $? -eq 1 ]] && txtsubs_0_24_0=1
+ version_compare ${rv} 0.25.0
+ [[ $? -eq 1 ]] && ! use opengl && opengl_0_25_0=1
+ done
+
+ if [[ ${softvol_0_18_1} -eq 1 ]]; then
+ elog "Since version 0.18.1 the software volume control is always enabled."
+ elog "This means that volume controls don't change the system volume,"
+ elog "e.g. per-application volume with PulseAudio."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Volume_in_0.18.1"
+ elog
+ fi
+
+ if [[ ${osc_0_21_0} -eq 1 ]]; then
+ elog "In version 0.21.0 the default OSC layout was changed."
+ elog "If you want to restore the previous layout, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#OSC_in_0.21.0"
+ elog
+ fi
+
+ if [[ ${txtsubs_0_24_0} -eq 1 ]]; then
+ elog "Since version 0.24.0 subtitles with .txt extension aren't autoloaded."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Subtitles_with_.txt_extension_in_0.24.0"
+ elog
+ fi
+
+ if [[ ${opengl_0_25_0} -eq 1 ]]; then
+ elog "Since version 0.25.0 the 'opengl' USE flag is mapped to"
+ elog "the 'opengl' video output and no longer explicitly requires"
+ elog "X11 or Mac OS Aqua. Consider enabling the 'opengl' USE flag."
+ fi
+
+ if use cli && ! has_version 'app-shells/mpv-bash-completion'; then
+ elog "If you want to have command-line completion via bash-completion,"
+ elog "please install app-shells/mpv-bash-completion."
+ fi
+
+ if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \
+ has_version 'app-shells/mpv-bash-completion'; then
+ elog "If command-line completion doesn't work after mpv update,"
+ elog "please rebuild app-shells/mpv-bash-completion."
+ fi
+
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+src_test() {
+ cd "${S}"/build/test || die
+ local test
+ for test in *; do
+ if [[ -x ${test} ]]; then
+ ./"${test}" || die "Test suite failed"
+ fi
+ done
+}
diff --git a/media-video/mpv/mpv-0.26.0.ebuild b/media-video/mpv/mpv-0.26.0.ebuild
new file mode 100644
index 000000000000..164672738f85
--- /dev/null
+++ b/media-video/mpv/mpv-0.26.0.ebuild
@@ -0,0 +1,373 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+PYTHON_REQ_USE='threads(+)'
+
+WAF_PV=1.9.8
+
+inherit gnome2-utils pax-utils python-r1 toolchain-funcs versionator waf-utils xdg-utils
+
+DESCRIPTION="Media player based on MPlayer and mplayer2"
+HOMEPAGE="https://mpv.io/"
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/mpv-player/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux"
+ DOCS=( RELEASE_NOTES )
+else
+ EGIT_REPO_URI="https://github.com/mpv-player/${PN}.git"
+ inherit git-r3
+fi
+SRC_URI+=" https://waf.io/waf-${WAF_PV}"
+DOCS+=( README.md DOCS/{client-api,interface}-changes.rst )
+
+# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC.
+LICENSE="LGPL-2.1+ GPL-2+ BSD ISC samba? ( GPL-3+ )"
+SLOT="0"
+IUSE="+alsa aqua archive bluray cdda +cli coreaudio cplugins cuda doc drm dvb
+ dvd +egl encode gbm +iconv jack javascript jpeg lcms +libass libav libcaca
+ libmpv +lua luajit openal +opengl oss pulseaudio raspberry-pi rubberband
+ samba sdl selinux test tools +uchardet v4l vaapi vdpau wayland +X +xv zlib
+ zsh-completion"
+
+REQUIRED_USE="
+ || ( cli libmpv )
+ aqua? ( opengl )
+ cuda? ( !libav opengl )
+ egl? ( || ( gbm X wayland ) )
+ gbm? ( drm egl opengl )
+ lcms? ( opengl )
+ luajit? ( lua )
+ opengl? ( || ( aqua egl X raspberry-pi !cli ) )
+ raspberry-pi? ( opengl )
+ test? ( opengl )
+ tools? ( cli )
+ uchardet? ( iconv )
+ v4l? ( || ( alsa oss ) )
+ vaapi? ( || ( gbm X wayland ) )
+ vdpau? ( X )
+ wayland? ( egl )
+ X? ( egl? ( opengl ) )
+ xv? ( X )
+ zsh-completion? ( cli )
+ ${PYTHON_REQUIRED_USE}
+"
+
+COMMON_DEPEND="
+ !libav? ( >=media-video/ffmpeg-3.2.2:0=[encode?,threads,vaapi?,vdpau?] )
+ libav? ( >=media-video/libav-12:0=[encode?,threads,vaapi?,vdpau?] )
+ alsa? ( >=media-libs/alsa-lib-1.0.18 )
+ archive? ( >=app-arch/libarchive-3.0.0:= )
+ bluray? ( >=media-libs/libbluray-0.3.0:= )
+ cdda? ( dev-libs/libcdio-paranoia )
+ cuda? ( >=media-video/ffmpeg-3.3:0 )
+ drm? ( x11-libs/libdrm )
+ dvd? (
+ >=media-libs/libdvdnav-4.2.0
+ >=media-libs/libdvdread-4.1.0
+ )
+ egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] )
+ iconv? (
+ virtual/libiconv
+ uchardet? ( app-i18n/uchardet )
+ )
+ jack? ( virtual/jack )
+ javascript? ( >=dev-lang/mujs-1.0.0 )
+ jpeg? ( virtual/jpeg:0 )
+ lcms? ( >=media-libs/lcms-2.6:2 )
+ libass? (
+ >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz]
+ virtual/ttf-fonts
+ )
+ libcaca? ( >=media-libs/libcaca-0.99_beta18 )
+ lua? (
+ !luajit? ( <dev-lang/lua-5.3:= )
+ luajit? ( dev-lang/luajit:2 )
+ )
+ openal? ( >=media-libs/openal-1.13 )
+ pulseaudio? ( media-sound/pulseaudio )
+ raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 )
+ rubberband? ( >=media-libs/rubberband-1.8.0 )
+ samba? ( net-fs/samba )
+ sdl? ( media-libs/libsdl2[sound,threads,video] )
+ v4l? ( media-libs/libv4l )
+ vaapi? (
+ !libav? ( >=media-video/ffmpeg-3.3:0 )
+ libav? ( >=media-video/libav-13:0 )
+ x11-libs/libva[drm?,X?,wayland?]
+ )
+ vdpau? (
+ !libav? ( >=media-video/ffmpeg-3.3:0 )
+ libav? ( >=media-video/libav-13:0 )
+ x11-libs/libvdpau
+ )
+ wayland? (
+ >=dev-libs/wayland-1.6.0
+ >=x11-libs/libxkbcommon-0.3.0
+ )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXScrnSaver
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ opengl? (
+ x11-libs/libXdamage
+ virtual/opengl
+ )
+ xv? ( x11-libs/libXv )
+ )
+ zlib? ( sys-libs/zlib )
+"
+DEPEND="${COMMON_DEPEND}
+ ${PYTHON_DEPS}
+ dev-python/docutils
+ virtual/pkgconfig
+ doc? ( dev-python/rst2pdf )
+ dvb? ( virtual/linuxtv-dvb-headers )
+ test? ( >=dev-util/cmocka-1.0.0 )
+ v4l? ( virtual/os-headers )
+ zsh-completion? ( dev-lang/perl )
+"
+RDEPEND="${COMMON_DEPEND}
+ cuda? ( x11-drivers/nvidia-drivers[X] )
+ selinux? ( sec-policy/selinux-mplayer )
+ tools? ( ${PYTHON_DEPS} )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch"
+ "${FILESDIR}/${PN}-0.23.0-make-libavdevice-check-accept-libav.patch"
+)
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != "binary" ]] && python_setup
+}
+
+src_prepare() {
+ cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die
+ chmod +x "${S}"/waf || die
+ default_src_prepare
+}
+
+src_configure() {
+ tc-export CC PKG_CONFIG AR
+
+ if tc-is-cross-compiler && use raspberry-pi; then
+ export EXTRA_PKG_CONFIG_LIBDIR="${SYSROOT%/}${EPREFIX}/opt/vc/lib/pkgconfig"
+ # Drop next line when Gentoo bug 607344 is fixed or if you fixed it locally.
+ die "${PN} can't be cross built with raspberry-pi USE enabled. See Gentoo bug 607344."
+ fi
+
+ local mywafargs=(
+ --confdir="${EPREFIX}/etc/${PN}"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+
+ $(usex cli '' '--disable-cplayer')
+ $(use_enable libmpv libmpv-shared)
+
+ --disable-libmpv-static
+ --disable-static-build
+ # See deep down below for build-date.
+ --disable-optimize # Don't add '-O2' to CFLAGS.
+ --disable-debug-build # Don't add '-g' to CFLAGS.
+ --enable-html-build
+
+ $(use_enable doc pdf-build)
+ $(use_enable cplugins)
+ $(use_enable zsh-completion zsh-comp)
+ $(use_enable test)
+
+ $(use_enable iconv)
+ $(use_enable samba libsmbclient)
+ $(use_enable lua)
+ $(usex luajit '--lua=luajit' '')
+ $(use_enable javascript)
+ $(use_enable libass)
+ $(use_enable libass libass-osd)
+ $(use_enable zlib)
+ $(use_enable encode encoding)
+ $(use_enable bluray libbluray)
+ $(use_enable dvd dvdread)
+ $(use_enable dvd dvdnav)
+ $(use_enable cdda)
+ $(use_enable uchardet)
+ $(use_enable rubberband)
+ $(use_enable lcms lcms2)
+ --disable-vapoursynth # Only available in overlays.
+ --disable-vapoursynth-lazy
+ $(use_enable archive libarchive)
+
+ --enable-libavdevice
+
+ # Audio outputs:
+ $(use_enable sdl sdl2) # Listed under audio, but also includes video.
+ --disable-sdl1
+ $(use_enable oss oss-audio)
+ --disable-rsound # Only available in overlays.
+ --disable-sndio # Only available in overlays.
+ $(use_enable pulseaudio pulse)
+ $(use_enable jack)
+ $(use_enable openal)
+ --disable-opensles
+ $(use_enable alsa)
+ $(use_enable coreaudio)
+
+ # Video outputs:
+ $(use_enable aqua cocoa)
+ $(use_enable drm)
+ $(use_enable gbm)
+ $(use_enable wayland)
+ $(use_enable X x11)
+ $(use_enable xv)
+ $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa')
+ $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11')
+ $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
+ $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm')
+ $(usex opengl "$(use_enable wayland gl-wayland)" '--disable-gl-wayland')
+ $(use_enable vdpau)
+ $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
+ $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl.
+ $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11')
+ $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland')
+ $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
+ $(use_enable libcaca caca)
+ $(use_enable jpeg)
+ --disable-android
+ $(use_enable raspberry-pi rpi)
+ $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
+ --disable-mali-fbdev # Only available in overlays.
+ $(usex opengl '' '--disable-gl')
+
+ # HWaccels:
+ # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
+ $(use_enable vaapi vaapi-hwaccel)
+ $(use_enable vdpau vdpau-hwaccel)
+ $(use_enable cuda cuda-hwaccel)
+
+ # TV features:
+ $(use_enable v4l tv)
+ $(use_enable v4l tv-v4l2)
+ $(use_enable v4l libv4l2)
+ $(use_enable v4l audio-input)
+ $(use_enable dvb dvbin)
+
+ # Miscellaneous features:
+ --disable-apple-remote # Needs testing first. See Gentoo bug 577332.
+ )
+
+ if use vaapi && use X; then
+ mywafargs+=(
+ $(use_enable opengl vaapi-glx)
+ $(use_enable egl vaapi-x-egl)
+ )
+ fi
+
+ # Create reproducible non-live builds.
+ [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date)
+
+ waf-utils_src_configure "${mywafargs[@]}"
+}
+
+src_install() {
+ waf-utils_src_install
+
+ if use lua; then
+ insinto /usr/share/${PN}
+ doins -r TOOLS/lua
+ fi
+
+ if use cli && use luajit; then
+ pax-mark -m "${ED}"usr/bin/${PN}
+ fi
+
+ if use tools; then
+ dobin TOOLS/{mpv_identify.sh,umpv}
+ newbin TOOLS/idet.sh mpv_idet.sh
+ python_replicate_script "${ED}"usr/bin/umpv
+ fi
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ local rv softvol_0_18_1=0 osc_0_21_0=0 txtsubs_0_24_0=0 opengl_0_25_0=0
+
+ for rv in ${REPLACING_VERSIONS}; do
+ version_compare ${rv} 0.18.1
+ [[ $? -eq 1 ]] && softvol_0_18_1=1
+ version_compare ${rv} 0.21.0
+ [[ $? -eq 1 ]] && osc_0_21_0=1
+ version_compare ${rv} 0.24.0
+ [[ $? -eq 1 ]] && txtsubs_0_24_0=1
+ version_compare ${rv} 0.25.0
+ [[ $? -eq 1 ]] && ! use opengl && opengl_0_25_0=1
+ done
+
+ if [[ ${softvol_0_18_1} -eq 1 ]]; then
+ elog "Since version 0.18.1 the software volume control is always enabled."
+ elog "This means that volume controls don't change the system volume,"
+ elog "e.g. per-application volume with PulseAudio."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Volume_in_0.18.1"
+ elog
+ fi
+
+ if [[ ${osc_0_21_0} -eq 1 ]]; then
+ elog "In version 0.21.0 the default OSC layout was changed."
+ elog "If you want to restore the previous layout, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#OSC_in_0.21.0"
+ elog
+ fi
+
+ if [[ ${txtsubs_0_24_0} -eq 1 ]]; then
+ elog "Since version 0.24.0 subtitles with .txt extension aren't autoloaded."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Subtitles_with_.txt_extension_in_0.24.0"
+ elog
+ fi
+
+ if [[ ${opengl_0_25_0} -eq 1 ]]; then
+ elog "Since version 0.25.0 the 'opengl' USE flag is mapped to"
+ elog "the 'opengl' video output and no longer explicitly requires"
+ elog "X11 or Mac OS Aqua. Consider enabling the 'opengl' USE flag."
+ fi
+
+ if use cli && ! has_version 'app-shells/mpv-bash-completion'; then
+ elog "If you want to have command-line completion via bash-completion,"
+ elog "please install app-shells/mpv-bash-completion."
+ fi
+
+ if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \
+ has_version 'app-shells/mpv-bash-completion'; then
+ elog "If command-line completion doesn't work after mpv update,"
+ elog "please rebuild app-shells/mpv-bash-completion."
+ fi
+
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+src_test() {
+ cd "${S}"/build/test || die
+ local test
+ for test in *; do
+ if [[ -x ${test} ]]; then
+ ./"${test}" || die "Test suite failed"
+ fi
+ done
+}
diff --git a/media-video/mpv/mpv-0.27.0.ebuild b/media-video/mpv/mpv-0.27.0.ebuild
new file mode 100644
index 000000000000..00e654a222a5
--- /dev/null
+++ b/media-video/mpv/mpv-0.27.0.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+PYTHON_REQ_USE='threads(+)'
+
+WAF_PV=1.9.8
+
+inherit gnome2-utils pax-utils python-r1 toolchain-funcs versionator waf-utils xdg-utils
+
+DESCRIPTION="Media player based on MPlayer and mplayer2"
+HOMEPAGE="https://mpv.io/"
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux"
+ DOCS=( RELEASE_NOTES )
+else
+ EGIT_REPO_URI="https://github.com/mpv-player/mpv.git"
+ inherit git-r3
+fi
+SRC_URI+=" https://waf.io/waf-${WAF_PV}"
+DOCS+=( README.md DOCS/{client-api,interface}-changes.rst )
+
+# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC.
+LICENSE="LGPL-2.1+ GPL-2+ BSD ISC samba? ( GPL-3+ )"
+SLOT="0"
+IUSE="+alsa aqua archive bluray cdda +cli coreaudio cplugins cuda doc drm dvb
+ dvd +egl encode gbm +iconv jack javascript jpeg lcms +libass libav libcaca
+ libmpv +lua luajit openal +opengl oss pulseaudio raspberry-pi rubberband
+ samba sdl selinux test tools +uchardet v4l vaapi vdpau wayland +X +xv zlib
+ zsh-completion"
+
+REQUIRED_USE="
+ || ( cli libmpv )
+ aqua? ( opengl )
+ cuda? ( !libav opengl )
+ egl? ( || ( gbm X wayland ) )
+ gbm? ( drm egl opengl )
+ lcms? ( opengl )
+ luajit? ( lua )
+ opengl? ( || ( aqua egl X raspberry-pi !cli ) )
+ raspberry-pi? ( opengl )
+ test? ( opengl )
+ tools? ( cli )
+ uchardet? ( iconv )
+ v4l? ( || ( alsa oss ) )
+ vaapi? ( || ( gbm X wayland ) )
+ vdpau? ( X )
+ wayland? ( egl )
+ X? ( egl? ( opengl ) )
+ xv? ( X )
+ zsh-completion? ( cli )
+ ${PYTHON_REQUIRED_USE}
+"
+
+COMMON_DEPEND="
+ !libav? ( >=media-video/ffmpeg-3.2.2:0=[encode?,threads,vaapi?,vdpau?] )
+ libav? ( >=media-video/libav-12:0=[encode?,threads,vaapi?,vdpau?] )
+ alsa? ( >=media-libs/alsa-lib-1.0.18 )
+ archive? ( >=app-arch/libarchive-3.0.0:= )
+ bluray? ( >=media-libs/libbluray-0.3.0:= )
+ cdda? ( dev-libs/libcdio-paranoia )
+ cuda? ( >=media-video/ffmpeg-3.3:0 )
+ drm? ( x11-libs/libdrm )
+ dvd? (
+ >=media-libs/libdvdnav-4.2.0
+ >=media-libs/libdvdread-4.1.0
+ )
+ egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] )
+ iconv? (
+ virtual/libiconv
+ uchardet? ( app-i18n/uchardet )
+ )
+ jack? ( virtual/jack )
+ javascript? ( >=dev-lang/mujs-1.0.0 )
+ jpeg? ( virtual/jpeg:0 )
+ lcms? ( >=media-libs/lcms-2.6:2 )
+ libass? (
+ >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz]
+ virtual/ttf-fonts
+ )
+ libcaca? ( >=media-libs/libcaca-0.99_beta18 )
+ lua? (
+ !luajit? ( <dev-lang/lua-5.3:= )
+ luajit? ( dev-lang/luajit:2 )
+ )
+ openal? ( >=media-libs/openal-1.13 )
+ pulseaudio? ( media-sound/pulseaudio )
+ raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 )
+ rubberband? ( >=media-libs/rubberband-1.8.0 )
+ samba? ( net-fs/samba )
+ sdl? ( media-libs/libsdl2[sound,threads,video] )
+ v4l? ( media-libs/libv4l )
+ vaapi? (
+ !libav? ( >=media-video/ffmpeg-3.3:0 )
+ libav? ( >=media-video/libav-13:0 )
+ x11-libs/libva[drm?,X?,wayland?]
+ )
+ vdpau? (
+ !libav? ( >=media-video/ffmpeg-3.3:0 )
+ libav? ( >=media-video/libav-13:0 )
+ x11-libs/libvdpau
+ )
+ wayland? (
+ >=dev-libs/wayland-1.6.0
+ >=x11-libs/libxkbcommon-0.3.0
+ )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXScrnSaver
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ opengl? (
+ x11-libs/libXdamage
+ virtual/opengl
+ )
+ xv? ( x11-libs/libXv )
+ )
+ zlib? ( sys-libs/zlib )
+"
+DEPEND="${COMMON_DEPEND}
+ ${PYTHON_DEPS}
+ dev-python/docutils
+ virtual/pkgconfig
+ doc? ( dev-python/rst2pdf )
+ dvb? ( virtual/linuxtv-dvb-headers )
+ test? ( >=dev-util/cmocka-1.0.0 )
+ v4l? ( virtual/os-headers )
+ zsh-completion? ( dev-lang/perl )
+"
+RDEPEND="${COMMON_DEPEND}
+ cuda? ( x11-drivers/nvidia-drivers[X] )
+ selinux? ( sec-policy/selinux-mplayer )
+ tools? ( ${PYTHON_DEPS} )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch"
+ "${FILESDIR}/${PN}-0.23.0-make-libavdevice-check-accept-libav.patch"
+)
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != "binary" ]] && python_setup
+}
+
+src_prepare() {
+ cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die
+ chmod +x "${S}"/waf || die
+ eapply "${FILESDIR}/${PV}"
+ default_src_prepare
+}
+
+src_configure() {
+ tc-export CC PKG_CONFIG AR
+
+ if tc-is-cross-compiler && use raspberry-pi; then
+ export EXTRA_PKG_CONFIG_LIBDIR="${SYSROOT%/}${EPREFIX}/opt/vc/lib/pkgconfig"
+ # Drop next line when Gentoo bug 607344 is fixed or if you fixed it locally.
+ die "${PN} can't be cross built with raspberry-pi USE enabled. See Gentoo bug 607344."
+ fi
+
+ local mywafargs=(
+ --confdir="${EPREFIX}/etc/${PN}"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+
+ $(usex cli '' '--disable-cplayer')
+ $(use_enable libmpv libmpv-shared)
+
+ --disable-libmpv-static
+ --disable-static-build
+ # See deep down below for build-date.
+ --disable-optimize # Don't add '-O2' to CFLAGS.
+ --disable-debug-build # Don't add '-g' to CFLAGS.
+ --enable-html-build
+
+ $(use_enable doc pdf-build)
+ $(use_enable cplugins)
+ $(use_enable zsh-completion zsh-comp)
+ $(use_enable test)
+
+ --disable-android
+ $(use_enable iconv)
+ $(use_enable samba libsmbclient)
+ $(use_enable lua)
+ $(usex luajit '--lua=luajit' '')
+ $(use_enable javascript)
+ $(use_enable libass)
+ $(use_enable libass libass-osd)
+ $(use_enable zlib)
+ $(use_enable encode encoding)
+ $(use_enable bluray libbluray)
+ $(use_enable dvd dvdread)
+ $(use_enable dvd dvdnav)
+ $(use_enable cdda)
+ $(use_enable uchardet)
+ $(use_enable rubberband)
+ $(use_enable lcms lcms2)
+ --disable-vapoursynth # Only available in overlays.
+ --disable-vapoursynth-lazy
+ $(use_enable archive libarchive)
+
+ --enable-libavdevice
+
+ # Audio outputs:
+ $(use_enable sdl sdl2) # Listed under audio, but also includes video.
+ --disable-sdl1
+ $(use_enable oss oss-audio)
+ --disable-rsound # Only available in overlays.
+ --disable-sndio # Only available in overlays.
+ $(use_enable pulseaudio pulse)
+ $(use_enable jack)
+ $(use_enable openal)
+ --disable-opensles
+ $(use_enable alsa)
+ $(use_enable coreaudio)
+
+ # Video outputs:
+ $(use_enable aqua cocoa)
+ $(use_enable drm)
+ $(use_enable gbm)
+ $(use_enable wayland)
+ $(use_enable X x11)
+ $(use_enable xv)
+ $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa')
+ $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11')
+ $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
+ $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm')
+ $(usex opengl "$(use_enable wayland gl-wayland)" '--disable-gl-wayland')
+ $(use_enable vdpau)
+ $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
+ $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl.
+ $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11')
+ $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland')
+ $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
+ $(use_enable libcaca caca)
+ $(use_enable jpeg)
+ $(use_enable raspberry-pi rpi)
+ $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
+ --disable-mali-fbdev # Only available in overlays.
+ $(usex opengl '' '--disable-gl')
+
+ # HWaccels:
+ # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
+ $(use_enable vaapi vaapi-hwaccel)
+ $(use_enable vdpau vdpau-hwaccel)
+ $(use_enable cuda cuda-hwaccel)
+
+ # TV features:
+ $(use_enable v4l tv)
+ $(use_enable v4l tv-v4l2)
+ $(use_enable v4l libv4l2)
+ $(use_enable v4l audio-input)
+ $(use_enable dvb dvbin)
+
+ # Miscellaneous features:
+ --disable-apple-remote # Needs testing first. See Gentoo bug 577332.
+ )
+
+ if use vaapi && use X; then
+ mywafargs+=(
+ $(use_enable opengl vaapi-glx)
+ $(use_enable egl vaapi-x-egl)
+ )
+ fi
+
+ # Create reproducible non-live builds.
+ [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date)
+
+ waf-utils_src_configure "${mywafargs[@]}"
+}
+
+src_install() {
+ waf-utils_src_install
+
+ if use lua; then
+ insinto /usr/share/${PN}
+ doins -r TOOLS/lua
+ fi
+
+ if use cli && use luajit; then
+ pax-mark -m "${ED}"usr/bin/${PN}
+ fi
+
+ if use tools; then
+ dobin TOOLS/{mpv_identify.sh,umpv}
+ newbin TOOLS/idet.sh mpv_idet.sh
+ python_replicate_script "${ED}"usr/bin/umpv
+ fi
+}
+
+pkg_postinst() {
+ local rv softvol_0_18_1=0 osc_0_21_0=0 txtsubs_0_24_0=0 opengl_0_25_0=0
+
+ for rv in ${REPLACING_VERSIONS}; do
+ version_compare ${rv} 0.18.1
+ [[ $? -eq 1 ]] && softvol_0_18_1=1
+ version_compare ${rv} 0.21.0
+ [[ $? -eq 1 ]] && osc_0_21_0=1
+ version_compare ${rv} 0.24.0
+ [[ $? -eq 1 ]] && txtsubs_0_24_0=1
+ version_compare ${rv} 0.25.0
+ [[ $? -eq 1 ]] && ! use opengl && opengl_0_25_0=1
+ done
+
+ if [[ ${softvol_0_18_1} -eq 1 ]]; then
+ elog "Since version 0.18.1 the software volume control is always enabled."
+ elog "This means that volume controls don't change the system volume,"
+ elog "e.g. per-application volume with PulseAudio."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Volume_in_0.18.1"
+ elog
+ fi
+
+ if [[ ${osc_0_21_0} -eq 1 ]]; then
+ elog "In version 0.21.0 the default OSC layout was changed."
+ elog "If you want to restore the previous layout, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#OSC_in_0.21.0"
+ elog
+ fi
+
+ if [[ ${txtsubs_0_24_0} -eq 1 ]]; then
+ elog "Since version 0.24.0 subtitles with .txt extension aren't autoloaded."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Subtitles_with_.txt_extension_in_0.24.0"
+ elog
+ fi
+
+ if [[ ${opengl_0_25_0} -eq 1 ]]; then
+ elog "Since version 0.25.0 the 'opengl' USE flag is mapped to"
+ elog "the 'opengl' video output and no longer explicitly requires"
+ elog "X11 or Mac OS Aqua. Consider enabling the 'opengl' USE flag."
+ fi
+
+ if use cli && ! has_version 'app-shells/mpv-bash-completion'; then
+ elog "If you want to have command-line completion via bash-completion,"
+ elog "please install app-shells/mpv-bash-completion."
+ fi
+
+ if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \
+ has_version 'app-shells/mpv-bash-completion'; then
+ elog "If command-line completion doesn't work after mpv update,"
+ elog "please rebuild app-shells/mpv-bash-completion."
+ fi
+
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+src_test() {
+ cd "${S}"/build/test || die
+ local test
+ for test in *; do
+ if [[ -x ${test} ]]; then
+ ./"${test}" || die "Test suite failed"
+ fi
+ done
+}
diff --git a/media-video/mpv/mpv-9999.ebuild b/media-video/mpv/mpv-9999.ebuild
new file mode 100644
index 000000000000..0323a501e934
--- /dev/null
+++ b/media-video/mpv/mpv-9999.ebuild
@@ -0,0 +1,369 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+PYTHON_REQ_USE='threads(+)'
+
+WAF_PV=1.9.8
+
+inherit gnome2-utils pax-utils python-r1 toolchain-funcs versionator waf-utils xdg-utils
+
+DESCRIPTION="Media player based on MPlayer and mplayer2"
+HOMEPAGE="https://mpv.io/"
+
+if [[ ${PV} != *9999* ]]; then
+ SRC_URI="https://github.com/mpv-player/mpv/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux"
+ DOCS=( RELEASE_NOTES )
+else
+ EGIT_REPO_URI="https://github.com/mpv-player/mpv.git"
+ inherit git-r3
+fi
+SRC_URI+=" https://waf.io/waf-${WAF_PV}"
+DOCS+=( README.md DOCS/{client-api,interface}-changes.rst )
+
+# See Copyright in sources and Gentoo bug 506946. Waf is BSD, libmpv is ISC.
+LICENSE="LGPL-2.1+ GPL-2+ BSD ISC samba? ( GPL-3+ )"
+SLOT="0"
+IUSE="+alsa aqua archive bluray cdda +cli coreaudio cplugins cuda doc drm dvb
+ dvd +egl encode gbm +iconv jack javascript jpeg lcms +libass libav libcaca
+ libmpv +lua luajit openal +opengl oss pulseaudio raspberry-pi rubberband
+ samba sdl selinux test tools +uchardet v4l vaapi vdpau wayland +X +xv zlib
+ zsh-completion"
+
+REQUIRED_USE="
+ || ( cli libmpv )
+ aqua? ( opengl )
+ cuda? ( !libav opengl )
+ egl? ( || ( gbm X wayland ) )
+ gbm? ( drm egl opengl )
+ lcms? ( opengl )
+ luajit? ( lua )
+ opengl? ( || ( aqua egl X raspberry-pi !cli ) )
+ raspberry-pi? ( opengl )
+ test? ( opengl )
+ tools? ( cli )
+ uchardet? ( iconv )
+ v4l? ( || ( alsa oss ) )
+ vaapi? ( || ( gbm X wayland ) )
+ vdpau? ( X )
+ wayland? ( egl )
+ X? ( egl? ( opengl ) )
+ xv? ( X )
+ zsh-completion? ( cli )
+ ${PYTHON_REQUIRED_USE}
+"
+
+COMMON_DEPEND="
+ !libav? ( >=media-video/ffmpeg-3.2.2:0=[encode?,threads,vaapi?,vdpau?] )
+ libav? ( >=media-video/libav-12:0=[encode?,threads,vaapi?,vdpau?] )
+ alsa? ( >=media-libs/alsa-lib-1.0.18 )
+ archive? ( >=app-arch/libarchive-3.0.0:= )
+ bluray? ( >=media-libs/libbluray-0.3.0:= )
+ cdda? ( dev-libs/libcdio-paranoia )
+ cuda? ( >=media-video/ffmpeg-3.3:0 )
+ drm? ( x11-libs/libdrm )
+ dvd? (
+ >=media-libs/libdvdnav-4.2.0
+ >=media-libs/libdvdread-4.1.0
+ )
+ egl? ( media-libs/mesa[egl,gbm(-)?,wayland(-)?] )
+ iconv? (
+ virtual/libiconv
+ uchardet? ( app-i18n/uchardet )
+ )
+ jack? ( virtual/jack )
+ javascript? ( >=dev-lang/mujs-1.0.0 )
+ jpeg? ( virtual/jpeg:0 )
+ lcms? ( >=media-libs/lcms-2.6:2 )
+ libass? (
+ >=media-libs/libass-0.12.1:=[fontconfig,harfbuzz]
+ virtual/ttf-fonts
+ )
+ libcaca? ( >=media-libs/libcaca-0.99_beta18 )
+ lua? (
+ !luajit? ( <dev-lang/lua-5.3:= )
+ luajit? ( dev-lang/luajit:2 )
+ )
+ openal? ( >=media-libs/openal-1.13 )
+ pulseaudio? ( media-sound/pulseaudio )
+ raspberry-pi? ( >=media-libs/raspberrypi-userland-0_pre20160305-r1 )
+ rubberband? ( >=media-libs/rubberband-1.8.0 )
+ samba? ( net-fs/samba )
+ sdl? ( media-libs/libsdl2[sound,threads,video] )
+ v4l? ( media-libs/libv4l )
+ vaapi? (
+ !libav? ( >=media-video/ffmpeg-3.3:0 )
+ libav? ( >=media-video/libav-13:0 )
+ x11-libs/libva[drm?,X?,wayland?]
+ )
+ vdpau? (
+ !libav? ( >=media-video/ffmpeg-3.3:0 )
+ libav? ( >=media-video/libav-13:0 )
+ x11-libs/libvdpau
+ )
+ wayland? (
+ >=dev-libs/wayland-1.6.0
+ >=x11-libs/libxkbcommon-0.3.0
+ )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXScrnSaver
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ opengl? (
+ x11-libs/libXdamage
+ virtual/opengl
+ )
+ xv? ( x11-libs/libXv )
+ )
+ zlib? ( sys-libs/zlib )
+"
+DEPEND="${COMMON_DEPEND}
+ ${PYTHON_DEPS}
+ dev-python/docutils
+ virtual/pkgconfig
+ doc? ( dev-python/rst2pdf )
+ dvb? ( virtual/linuxtv-dvb-headers )
+ test? ( >=dev-util/cmocka-1.0.0 )
+ v4l? ( virtual/os-headers )
+ zsh-completion? ( dev-lang/perl )
+"
+RDEPEND="${COMMON_DEPEND}
+ cuda? ( x11-drivers/nvidia-drivers[X] )
+ selinux? ( sec-policy/selinux-mplayer )
+ tools? ( ${PYTHON_DEPS} )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.19.0-make-ffmpeg-version-check-non-fatal.patch"
+ "${FILESDIR}/${PN}-0.23.0-make-libavdevice-check-accept-libav.patch"
+)
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != "binary" ]] && python_setup
+}
+
+src_prepare() {
+ cp "${DISTDIR}/waf-${WAF_PV}" "${S}"/waf || die
+ chmod +x "${S}"/waf || die
+ default_src_prepare
+}
+
+src_configure() {
+ tc-export CC PKG_CONFIG AR
+
+ if tc-is-cross-compiler && use raspberry-pi; then
+ export EXTRA_PKG_CONFIG_LIBDIR="${SYSROOT%/}${EPREFIX}/opt/vc/lib/pkgconfig"
+ # Drop next line when Gentoo bug 607344 is fixed or if you fixed it locally.
+ die "${PN} can't be cross built with raspberry-pi USE enabled. See Gentoo bug 607344."
+ fi
+
+ local mywafargs=(
+ --confdir="${EPREFIX}/etc/${PN}"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+
+ $(usex cli '' '--disable-cplayer')
+ $(use_enable libmpv libmpv-shared)
+
+ --disable-libmpv-static
+ --disable-static-build
+ # See deep down below for build-date.
+ --disable-optimize # Don't add '-O2' to CFLAGS.
+ --disable-debug-build # Don't add '-g' to CFLAGS.
+ --enable-html-build
+
+ $(use_enable doc pdf-build)
+ $(use_enable cplugins)
+ $(use_enable zsh-completion zsh-comp)
+ $(use_enable test)
+
+ --disable-android
+ $(use_enable iconv)
+ $(use_enable samba libsmbclient)
+ $(use_enable lua)
+ $(usex luajit '--lua=luajit' '')
+ $(use_enable javascript)
+ $(use_enable libass)
+ $(use_enable libass libass-osd)
+ $(use_enable zlib)
+ $(use_enable encode encoding)
+ $(use_enable bluray libbluray)
+ $(use_enable dvd dvdread)
+ $(use_enable dvd dvdnav)
+ $(use_enable cdda)
+ $(use_enable uchardet)
+ $(use_enable rubberband)
+ $(use_enable lcms lcms2)
+ --disable-vapoursynth # Only available in overlays.
+ --disable-vapoursynth-lazy
+ $(use_enable archive libarchive)
+
+ --enable-libavdevice
+
+ # Audio outputs:
+ $(use_enable sdl sdl2) # Listed under audio, but also includes video.
+ --disable-sdl1
+ $(use_enable oss oss-audio)
+ --disable-rsound # Only available in overlays.
+ --disable-sndio # Only available in overlays.
+ $(use_enable pulseaudio pulse)
+ $(use_enable jack)
+ $(use_enable openal)
+ --disable-opensles
+ $(use_enable alsa)
+ $(use_enable coreaudio)
+
+ # Video outputs:
+ $(use_enable aqua cocoa)
+ $(use_enable drm)
+ $(use_enable gbm)
+ $(use_enable wayland)
+ $(use_enable X x11)
+ $(use_enable xv)
+ $(usex opengl "$(use_enable aqua gl-cocoa)" '--disable-gl-cocoa')
+ $(usex opengl "$(use_enable X gl-x11)" '--disable-gl-x11')
+ $(usex egl "$(use_enable X egl-x11)" '--disable-egl-x11')
+ $(usex egl "$(use_enable gbm egl-drm)" '--disable-egl-drm')
+ $(usex opengl "$(use_enable wayland gl-wayland)" '--disable-gl-wayland')
+ $(use_enable vdpau)
+ $(usex vdpau "$(use_enable opengl vdpau-gl-x11)" '--disable-vdpau-gl-x11')
+ $(use_enable vaapi) # See below for vaapi-glx, vaapi-x-egl.
+ $(usex vaapi "$(use_enable X vaapi-x11)" '--disable-vaapi-x11')
+ $(usex vaapi "$(use_enable wayland vaapi-wayland)" '--disable-vaapi-wayland')
+ $(usex vaapi "$(use_enable gbm vaapi-drm)" '--disable-vaapi-drm')
+ $(use_enable libcaca caca)
+ $(use_enable jpeg)
+ $(use_enable raspberry-pi rpi)
+ $(usex libmpv "$(use_enable opengl plain-gl)" '--disable-plain-gl')
+ --disable-mali-fbdev # Only available in overlays.
+ $(usex opengl '' '--disable-gl')
+
+ # HWaccels:
+ # Automagic Video Toolbox HW acceleration. See Gentoo bug 577332.
+ $(use_enable vaapi vaapi-hwaccel)
+ $(use_enable vdpau vdpau-hwaccel)
+ $(use_enable cuda cuda-hwaccel)
+
+ # TV features:
+ $(use_enable v4l tv)
+ $(use_enable v4l tv-v4l2)
+ $(use_enable v4l libv4l2)
+ $(use_enable v4l audio-input)
+ $(use_enable dvb dvbin)
+
+ # Miscellaneous features:
+ --disable-apple-remote # Needs testing first. See Gentoo bug 577332.
+ )
+
+ if use vaapi && use X; then
+ mywafargs+=(
+ $(use_enable opengl vaapi-glx)
+ $(use_enable egl vaapi-x-egl)
+ )
+ fi
+
+ # Create reproducible non-live builds.
+ [[ ${PV} != *9999* ]] && mywafargs+=(--disable-build-date)
+
+ waf-utils_src_configure "${mywafargs[@]}"
+}
+
+src_install() {
+ waf-utils_src_install
+
+ if use lua; then
+ insinto /usr/share/${PN}
+ doins -r TOOLS/lua
+ fi
+
+ if use cli && use luajit; then
+ pax-mark -m "${ED}"usr/bin/${PN}
+ fi
+
+ if use tools; then
+ dobin TOOLS/{mpv_identify.sh,umpv}
+ newbin TOOLS/idet.sh mpv_idet.sh
+ python_replicate_script "${ED}"usr/bin/umpv
+ fi
+}
+
+pkg_postinst() {
+ local rv softvol_0_18_1=0 osc_0_21_0=0 txtsubs_0_24_0=0 opengl_0_25_0=0
+
+ for rv in ${REPLACING_VERSIONS}; do
+ version_compare ${rv} 0.18.1
+ [[ $? -eq 1 ]] && softvol_0_18_1=1
+ version_compare ${rv} 0.21.0
+ [[ $? -eq 1 ]] && osc_0_21_0=1
+ version_compare ${rv} 0.24.0
+ [[ $? -eq 1 ]] && txtsubs_0_24_0=1
+ version_compare ${rv} 0.25.0
+ [[ $? -eq 1 ]] && ! use opengl && opengl_0_25_0=1
+ done
+
+ if [[ ${softvol_0_18_1} -eq 1 ]]; then
+ elog "Since version 0.18.1 the software volume control is always enabled."
+ elog "This means that volume controls don't change the system volume,"
+ elog "e.g. per-application volume with PulseAudio."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Volume_in_0.18.1"
+ elog
+ fi
+
+ if [[ ${osc_0_21_0} -eq 1 ]]; then
+ elog "In version 0.21.0 the default OSC layout was changed."
+ elog "If you want to restore the previous layout, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#OSC_in_0.21.0"
+ elog
+ fi
+
+ if [[ ${txtsubs_0_24_0} -eq 1 ]]; then
+ elog "Since version 0.24.0 subtitles with .txt extension aren't autoloaded."
+ elog "If you want to restore the previous behaviour, please refer to"
+ elog
+ elog "https://wiki.gentoo.org/wiki/Mpv#Subtitles_with_.txt_extension_in_0.24.0"
+ elog
+ fi
+
+ if [[ ${opengl_0_25_0} -eq 1 ]]; then
+ elog "Since version 0.25.0 the 'opengl' USE flag is mapped to"
+ elog "the 'opengl' video output and no longer explicitly requires"
+ elog "X11 or Mac OS Aqua. Consider enabling the 'opengl' USE flag."
+ fi
+
+ if use cli && ! has_version 'app-shells/mpv-bash-completion'; then
+ elog "If you want to have command-line completion via bash-completion,"
+ elog "please install app-shells/mpv-bash-completion."
+ fi
+
+ if use cli && [[ -n ${REPLACING_VERSIONS} ]] && \
+ has_version 'app-shells/mpv-bash-completion'; then
+ elog "If command-line completion doesn't work after mpv update,"
+ elog "please rebuild app-shells/mpv-bash-completion."
+ fi
+
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ xdg_desktop_database_update
+}
+
+src_test() {
+ cd "${S}"/build/test || die
+ local test
+ for test in *; do
+ if [[ -x ${test} ]]; then
+ ./"${test}" || die "Test suite failed"
+ fi
+ done
+}