1 |
commit: 2942cf2265fdc3ff187eaad18afb7d19d0a469fa |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 17 17:48:16 2019 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 17 17:48:31 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2942cf22 |
7 |
|
8 |
media-video/orion: 1.6.6 bump |
9 |
|
10 |
This actually requires both qtquickcontrols 1 and 2 |
11 |
Backport some master changes to work with mpv and chromium |
12 |
|
13 |
Package-Manager: Portage-2.3.77, Repoman-2.3.17 |
14 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
15 |
|
16 |
media-video/orion/Manifest | 1 + |
17 |
.../orion/files/orion-1.6.6-fix_login.patch | 32 +++++ |
18 |
.../orion/files/orion-1.6.6-mpv_backwards.patch | 147 +++++++++++++++++++++ |
19 |
.../orion/files/orion-1.6.6-mpv_compilation.patch | 39 ++++++ |
20 |
media-video/orion/orion-1.6.6.ebuild | 60 +++++++++ |
21 |
5 files changed, 279 insertions(+) |
22 |
|
23 |
diff --git a/media-video/orion/Manifest b/media-video/orion/Manifest |
24 |
index bd0019233ae..1552d86e0cb 100644 |
25 |
--- a/media-video/orion/Manifest |
26 |
+++ b/media-video/orion/Manifest |
27 |
@@ -1,2 +1,3 @@ |
28 |
DIST orion-1.6.1.tar.gz 614216 BLAKE2B 8fc0909c1dd433e72d4ed41046d38a861ec48cbe6e93e1a9cc48f31cb3ef381e1b5b998c501d20756883431464eef798859b9ba4d086b89575281dbc17afca69 SHA512 3db0b59a89d2364f2d0586c3f318fc793f73a17d767adb0f44b89830e397be6f24c2ab662b7c84e7d857bc42b952fdf7fa280090313f5e39e37205eb8fb6dc9e |
29 |
DIST orion-1.6.5.tar.gz 624005 BLAKE2B ca2c40a299ab3f1abc7f383f2a5f39ebbe1e6ce6737efc3da0acd8cbbc04753dab865f417bd8e39d7e42dd7db8de703dd3b251296b8820a9027ca3ad2cd5de1d SHA512 6add27b81bf2520354e1a8854c2be4caf81d1c7c161003cb86bb4911852965cff938381c0ea481c64dc91c36d45f5af44cfb6e9a6d1c379f8b3b3011bbe47c6f |
30 |
+DIST orion-1.6.6.tar.gz 629917 BLAKE2B 303af947533aeb26561fb3fc57d4ffbbd6d168e1e51ffe196a0de82fca3406599cfb84c1ae361c9b7b84c9c01b47bb6147b98f62cc5b1dec3d08d0588cbc7327 SHA512 88c7efe1796d1135f18bd53c83a25747df1bbf35163b27c625711ab5027e988425e3ba13ff6e3349d30cdc99d24cae0642d1d058e401a24b240d73c6b47a2aaf |
31 |
|
32 |
diff --git a/media-video/orion/files/orion-1.6.6-fix_login.patch b/media-video/orion/files/orion-1.6.6-fix_login.patch |
33 |
new file mode 100644 |
34 |
index 00000000000..c6aced452ca |
35 |
--- /dev/null |
36 |
+++ b/media-video/orion/files/orion-1.6.6-fix_login.patch |
37 |
@@ -0,0 +1,32 @@ |
38 |
+From 69c58ba5af5f83903be70629b02f348fc3ad8757 Mon Sep 17 00:00:00 2001 |
39 |
+From: Andrew Tonner <rakslice@×××××.com> |
40 |
+Date: Tue, 26 Mar 2019 14:58:40 -0700 |
41 |
+Subject: [PATCH] Fix HTTP request socket output |
42 |
+ |
43 |
+--- |
44 |
+ src/network/httpserver.cpp | 5 +---- |
45 |
+ 1 file changed, 1 insertion(+), 4 deletions(-) |
46 |
+ |
47 |
+diff --git a/src/network/httpserver.cpp b/src/network/httpserver.cpp |
48 |
+index 235e073..b0368eb 100644 |
49 |
+--- a/src/network/httpserver.cpp |
50 |
++++ b/src/network/httpserver.cpp |
51 |
+@@ -89,7 +89,6 @@ void HttpServer::onRead() { |
52 |
+ |
53 |
+ // Respond with 200 |
54 |
+ QByteArray block; |
55 |
+- QDataStream out(&block, QIODevice::WriteOnly); |
56 |
+ |
57 |
+ // http payload message body |
58 |
+ QByteArray content; |
59 |
+@@ -111,9 +110,7 @@ void HttpServer::onRead() { |
60 |
+ response += "Content-Length: " + QString::number(content.length()) + "\n"; |
61 |
+ response += "\n" + content; |
62 |
+ |
63 |
+- out << response.toUtf8(); |
64 |
+- |
65 |
+- socket->write(block); |
66 |
++ socket->write(response.toUtf8()); |
67 |
+ socket->waitForBytesWritten(); |
68 |
+ socket->disconnectFromHost(); |
69 |
+ |
70 |
|
71 |
diff --git a/media-video/orion/files/orion-1.6.6-mpv_backwards.patch b/media-video/orion/files/orion-1.6.6-mpv_backwards.patch |
72 |
new file mode 100644 |
73 |
index 00000000000..4cd302cb3d1 |
74 |
--- /dev/null |
75 |
+++ b/media-video/orion/files/orion-1.6.6-mpv_backwards.patch |
76 |
@@ -0,0 +1,147 @@ |
77 |
+From 755fae82a31105808ec978855803f52affa01f87 Mon Sep 17 00:00:00 2001 |
78 |
+From: mrgreywater <mr.greywater@××××××××××.com> |
79 |
+Date: Fri, 19 Oct 2018 22:21:07 +0200 |
80 |
+Subject: [PATCH] opengl-cb backward compatibility |
81 |
+ |
82 |
+--- |
83 |
+ src/player/mpvobject.cpp | 43 ++++++++++++++++++++++++++++++++++------ |
84 |
+ src/player/mpvobject.h | 15 +++++++++++++- |
85 |
+ 2 files changed, 51 insertions(+), 7 deletions(-) |
86 |
+ |
87 |
+diff --git a/src/player/mpvobject.cpp b/src/player/mpvobject.cpp |
88 |
+index 2955063..31cdf73 100644 |
89 |
+--- a/src/player/mpvobject.cpp |
90 |
++++ b/src/player/mpvobject.cpp |
91 |
+@@ -48,16 +48,25 @@ class MpvRenderer : public QQuickFramebufferObject::Renderer |
92 |
+ MpvRenderer(MpvObject *new_obj) |
93 |
+ : obj{new_obj} |
94 |
+ { |
95 |
+- |
96 |
++#ifdef USE_OPENGL_CB |
97 |
++ int r = mpv_opengl_cb_init_gl(obj->mpv_gl, nullptr, &get_proc_address_mpv, nullptr); |
98 |
++ if (r < 0) |
99 |
++ throw std::runtime_error("could not initialize OpenGL"); |
100 |
++#endif |
101 |
+ } |
102 |
+ |
103 |
+ virtual ~MpvRenderer() |
104 |
+- {} |
105 |
++ { |
106 |
++#ifdef USE_OPENGL_CB |
107 |
++ mpv_opengl_cb_uninit_gl(obj->mpv_gl); |
108 |
++#endif |
109 |
++ } |
110 |
+ |
111 |
+ // This function is called when a new FBO is needed. |
112 |
+ // This happens on the initial frame. |
113 |
+ QOpenGLFramebufferObject * createFramebufferObject(const QSize &size) |
114 |
+ { |
115 |
++#ifndef USE_OPENGL_CB |
116 |
+ // init mpv_gl: |
117 |
+ if (!obj->mpv_gl) |
118 |
+ { |
119 |
+@@ -72,15 +81,17 @@ class MpvRenderer : public QQuickFramebufferObject::Renderer |
120 |
+ throw std::runtime_error("failed to initialize mpv GL context"); |
121 |
+ mpv_render_context_set_update_callback(obj->mpv_gl, on_mpv_redraw, obj); |
122 |
+ } |
123 |
+- |
124 |
++#endif |
125 |
+ return QQuickFramebufferObject::Renderer::createFramebufferObject(size); |
126 |
+ } |
127 |
+ |
128 |
+ void render() |
129 |
+ { |
130 |
+ obj->window()->resetOpenGLState(); |
131 |
+- |
132 |
+ QOpenGLFramebufferObject *fbo = framebufferObject(); |
133 |
++#ifdef USE_OPENGL_CB |
134 |
++ mpv_opengl_cb_draw(obj->mpv_gl, fbo->handle(), fbo->width(), fbo->height()); |
135 |
++#else |
136 |
+ mpv_opengl_fbo mpfbo{static_cast<int>(fbo->handle()), fbo->width(), fbo->height(), 0}; |
137 |
+ int flip_y{0}; |
138 |
+ |
139 |
+@@ -97,7 +108,7 @@ class MpvRenderer : public QQuickFramebufferObject::Renderer |
140 |
+ // See render_gl.h on what OpenGL environment mpv expects, and |
141 |
+ // other API details. |
142 |
+ mpv_render_context_render(obj->mpv_gl, params); |
143 |
+- |
144 |
++#endif |
145 |
+ obj->window()->resetOpenGLState(); |
146 |
+ } |
147 |
+ }; |
148 |
+@@ -115,11 +126,27 @@ MpvObject::MpvObject(QQuickItem * parent) |
149 |
+ mpv_set_option_string(mpv, "msg-level", "all=v"); |
150 |
+ #endif |
151 |
+ |
152 |
++#ifdef USE_OPENGL_CB |
153 |
++ mpv_set_option_string(mpv, "vo", "opengl-cb"); |
154 |
++#endif |
155 |
++ |
156 |
+ if (mpv_initialize(mpv) < 0) |
157 |
+ throw std::runtime_error("could not initialize mpv context"); |
158 |
+ |
159 |
+ // Request hw decoding, just for testing. |
160 |
+- mpv::qt::set_option_variant(mpv, "hwdec", "auto"); |
161 |
++ mpv_set_option_string(mpv, "hwdec", "auto"); |
162 |
++ |
163 |
++#ifdef USE_OPENGL_CB |
164 |
++ // Setup the callback that will make QtQuick update and redraw if there |
165 |
++ // is a new video frame. Use a queued connection: this makes sure the |
166 |
++ // doUpdate() function is run on the GUI thread. |
167 |
++ mpv_gl = (mpv_opengl_cb_context *)mpv_get_sub_api(mpv, MPV_SUB_API_OPENGL_CB); |
168 |
++ |
169 |
++ if (!mpv_gl) |
170 |
++ throw std::runtime_error("OpenGL not compiled in"); |
171 |
++ |
172 |
++ mpv_opengl_cb_set_update_callback(mpv_gl, MpvObject::on_update, (void *)this); |
173 |
++#endif |
174 |
+ |
175 |
+ mpv_set_wakeup_callback(mpv, wakeup, this); |
176 |
+ |
177 |
+@@ -130,7 +157,11 @@ MpvObject::~MpvObject() |
178 |
+ { |
179 |
+ if (mpv_gl) // only initialized if something got drawn |
180 |
+ { |
181 |
++#ifdef USE_OPENGL_CB |
182 |
++ mpv_opengl_cb_set_update_callback(mpv_gl, nullptr, nullptr); |
183 |
++#else |
184 |
+ mpv_render_context_free(mpv_gl); |
185 |
++#endif |
186 |
+ } |
187 |
+ |
188 |
+ mpv_terminate_destroy(mpv); |
189 |
+diff --git a/src/player/mpvobject.h b/src/player/mpvobject.h |
190 |
+index 0ec0b7a..eeaa250 100644 |
191 |
+--- a/src/player/mpvobject.h |
192 |
++++ b/src/player/mpvobject.h |
193 |
+@@ -6,8 +6,21 @@ |
194 |
+ |
195 |
+ #include <QtQuick/QQuickFramebufferObject> |
196 |
+ |
197 |
++ |
198 |
+ #include <mpv/client.h> |
199 |
++ |
200 |
++#if MPV_CLIENT_API_VERSION < MPV_MAKE_VERSION(1, 28) |
201 |
++#define USE_OPENGL_CB |
202 |
++#endif |
203 |
++ |
204 |
++#ifdef USE_OPENGL_CB |
205 |
++#include <mpv/opengl_cb.h> |
206 |
++typedef mpv_opengl_cb_context mpv_context; |
207 |
++#else |
208 |
+ #include <mpv/render_gl.h> |
209 |
++typedef mpv_render_context mpv_context; |
210 |
++#endif |
211 |
++ |
212 |
+ #include <mpv/qthelper.hpp> |
213 |
+ |
214 |
+ class MpvRenderer; |
215 |
+@@ -17,7 +30,7 @@ class MpvObject : public QQuickFramebufferObject |
216 |
+ Q_OBJECT |
217 |
+ |
218 |
+ mpv_handle *mpv; |
219 |
+- mpv_render_context *mpv_gl; |
220 |
++ mpv_context *mpv_gl; |
221 |
+ std::vector<std::unique_ptr<QJSValue>> callbacks; |
222 |
+ |
223 |
+ friend class MpvRenderer; |
224 |
|
225 |
diff --git a/media-video/orion/files/orion-1.6.6-mpv_compilation.patch b/media-video/orion/files/orion-1.6.6-mpv_compilation.patch |
226 |
new file mode 100644 |
227 |
index 00000000000..c9163d3376c |
228 |
--- /dev/null |
229 |
+++ b/media-video/orion/files/orion-1.6.6-mpv_compilation.patch |
230 |
@@ -0,0 +1,39 @@ |
231 |
+index def79f5..7fd9d93 100644 |
232 |
+--- a/orion.pro |
233 |
++++ b/orion.pro |
234 |
+@@ -8,7 +8,7 @@ QT += gui qml network widgets quickcontrols2 |
235 |
+ |
236 |
+ QMAKE_CXXFLAGS += -Wall -O2 |
237 |
+ |
238 |
+-CONFIG += c++11 |
239 |
++CONFIG += c++14 |
240 |
+ #CONFIG += console |
241 |
+ |
242 |
+ TARGET = orion |
243 |
+@@ -86,8 +86,8 @@ android: { |
244 |
+ android/src/com/orion/MainActivity.java |
245 |
+ |
246 |
+ ANDROID_EXTRA_LIBS = \ |
247 |
+- $$PWD/../openssl-1.0.2l/libcrypto.so \ |
248 |
+- $$PWD/../openssl-1.0.2l/libssl.so |
249 |
++ $$PWD/libs/libcrypto.so \ |
250 |
++ $$PWD/libs/libssl.so |
251 |
+ } |
252 |
+ |
253 |
+ #Backend for player, uses mpv as default |
254 |
+diff --git a/src/player/mpvobject.cpp b/src/player/mpvobject.cpp |
255 |
+index 2c30462..2955063 100644 |
256 |
+--- a/src/player/mpvobject.cpp |
257 |
++++ b/src/player/mpvobject.cpp |
258 |
+@@ -103,8 +103,10 @@ class MpvRenderer : public QQuickFramebufferObject::Renderer |
259 |
+ }; |
260 |
+ |
261 |
+ MpvObject::MpvObject(QQuickItem * parent) |
262 |
+- : QQuickFramebufferObject(parent), mpv{mpv_create()}, mpv_gl(nullptr) |
263 |
++ : QQuickFramebufferObject(parent), mpv_gl(nullptr) |
264 |
+ { |
265 |
++ std::setlocale(LC_NUMERIC, "C"); |
266 |
++ mpv = mpv_create(); |
267 |
+ if (!mpv) |
268 |
+ throw std::runtime_error("could not create mpv context"); |
269 |
+ |
270 |
|
271 |
diff --git a/media-video/orion/orion-1.6.6.ebuild b/media-video/orion/orion-1.6.6.ebuild |
272 |
new file mode 100644 |
273 |
index 00000000000..7fe4e32bd5c |
274 |
--- /dev/null |
275 |
+++ b/media-video/orion/orion-1.6.6.ebuild |
276 |
@@ -0,0 +1,60 @@ |
277 |
+# Copyright 1999-2019 Gentoo Authors |
278 |
+# Distributed under the terms of the GNU General Public License v2 |
279 |
+ |
280 |
+EAPI=7 |
281 |
+inherit desktop qmake-utils xdg-utils |
282 |
+ |
283 |
+DESCRIPTION="Cross-platform Twitch client" |
284 |
+HOMEPAGE="https://alamminsalo.github.io/orion/" |
285 |
+SRC_URI="https://github.com/alamminsalo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
286 |
+ |
287 |
+LICENSE="GPL-3" |
288 |
+SLOT="0" |
289 |
+KEYWORDS="~amd64 ~x86" |
290 |
+IUSE="+mpv qtav qtmedia" |
291 |
+ |
292 |
+DEPEND=">=dev-qt/qtquickcontrols-5.8:5 |
293 |
+ >=dev-qt/qtquickcontrols2-5.8:5 |
294 |
+ >=dev-qt/qtsvg-5.8:5 |
295 |
+ >=dev-qt/qtwebengine-5.8:5 |
296 |
+ mpv? ( media-video/mpv[libmpv] ) |
297 |
+ qtav? ( media-libs/qtav ) |
298 |
+ qtmedia? ( >=dev-qt/qtmultimedia-5.8:5 )" |
299 |
+RDEPEND="${DEPEND} |
300 |
+ !mpv? ( media-plugins/gst-plugins-hls )" |
301 |
+ |
302 |
+REQUIRED_USE="^^ ( mpv qtav qtmedia )" |
303 |
+ |
304 |
+PATCHES=( |
305 |
+ "${FILESDIR}"/${P}-fix_login.patch |
306 |
+ "${FILESDIR}"/${P}-mpv_compilation.patch |
307 |
+ "${FILESDIR}"/${P}-mpv_backwards.patch |
308 |
+) |
309 |
+ |
310 |
+src_configure() { |
311 |
+ local PLAYER |
312 |
+ if use mpv; then |
313 |
+ PLAYER=mpv |
314 |
+ elif use qtav; then |
315 |
+ PLAYER=qtav |
316 |
+ else |
317 |
+ PLAYER=multimedia |
318 |
+ fi |
319 |
+ eqmake5 ${PN}.pro CONFIG+=${PLAYER} |
320 |
+} |
321 |
+ |
322 |
+src_install() { |
323 |
+ dobin ${PN} |
324 |
+ domenu distfiles/*.desktop |
325 |
+ |
326 |
+ insinto /usr/share/icons/hicolor/scalable/apps |
327 |
+ doins distfiles/${PN}.svg |
328 |
+} |
329 |
+ |
330 |
+pkg_postinst() { |
331 |
+ xdg_icon_cache_update |
332 |
+} |
333 |
+ |
334 |
+pkg_postrm() { |
335 |
+ xdg_icon_cache_update |
336 |
+} |