Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/kmplayer/, media-video/kmplayer/files/
Date: Sat, 25 Nov 2017 16:09:47
Message-Id: 1511626162.8fd49ffe76fa579aa86de0fb62fef54d2b27e4e0.asturm@gentoo
1 commit: 8fd49ffe76fa579aa86de0fb62fef54d2b27e4e0
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 25 15:59:28 2017 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 25 16:09:22 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fd49ffe
7
8 media-video/kmplayer: Fix desktop file, cmake warnings
9
10 Reported-by: <kavol <AT> email.cz>
11 Closes: https://bugs.gentoo.org/638798
12 Package-Manager: Portage-2.3.16, Repoman-2.3.6
13
14 media-video/kmplayer/Manifest | 2 +-
15 .../kmplayer/files/kmplayer-0.12.0b-cmake.patch | 50 ++++++++++++
16 .../kmplayer/files/kmplayer-0.12.0b-desktop.patch | 47 +++++++++++
17 .../files/kmplayer-0.12.0b-devpixelratio.patch | 36 ++++++++
18 .../kmplayer/files/kmplayer-0.12.0b-qfile.patch | 33 ++++++++
19 .../files/kmplayer-0.12.0b-schedulerepaint.patch | 61 ++++++++++++++
20 media-video/kmplayer/kmplayer-0.12.0b-r1.ebuild | 95 ++++++++++++++++++++++
21 7 files changed, 323 insertions(+), 1 deletion(-)
22
23 diff --git a/media-video/kmplayer/Manifest b/media-video/kmplayer/Manifest
24 index bbaf660c05e..e5889b7e636 100644
25 --- a/media-video/kmplayer/Manifest
26 +++ b/media-video/kmplayer/Manifest
27 @@ -1 +1 @@
28 -DIST kmplayer-0.12.0b.tar.bz2 599496 SHA256 5e98cea9bd958860d90003d37037172a95ed8b699133e8f1e6033147aaefed73 SHA512 d34c496d0c24c6d5c1bb675b83fac60da5c9672e4076aed72bac2e9b333e88d031076e7e386ec7b61ae8ece88870f6187c61f483f425aa78edd1e443c7f2e882 WHIRLPOOL 4ce75858bd6f385572f1c39e1aef47ad9526986b8c99de228d9e77168e804b2aeeca2933bb95c8be0f3a2200154473fd99a02af2d449a3861c845715f772570c
29 +DIST kmplayer-0.12.0b.tar.bz2 599496 BLAKE2B c27b54cf05c52ffbb78c8f623b7cab066901f647c14364da1de2fcedd96329439521ad329fc15be58491b570de17fd151c95f266738e049501a5a22ba8dd9c93 SHA512 d34c496d0c24c6d5c1bb675b83fac60da5c9672e4076aed72bac2e9b333e88d031076e7e386ec7b61ae8ece88870f6187c61f483f425aa78edd1e443c7f2e882
30
31 diff --git a/media-video/kmplayer/files/kmplayer-0.12.0b-cmake.patch b/media-video/kmplayer/files/kmplayer-0.12.0b-cmake.patch
32 new file mode 100644
33 index 00000000000..a99b1149f8c
34 --- /dev/null
35 +++ b/media-video/kmplayer/files/kmplayer-0.12.0b-cmake.patch
36 @@ -0,0 +1,50 @@
37 +From 2a5df7b875a8c5acb99be05baf84e5c9800d52a3 Mon Sep 17 00:00:00 2001
38 +From: Pino Toscano <pino@×××.org>
39 +Date: Sat, 13 May 2017 18:57:15 +0200
40 +Subject: cmake: fix endif syntax
41 +
42 +it does not match the if condition, so just remove it (also to ease
43 +reading it)
44 +---
45 + CMakeLists.txt | 2 +-
46 + 1 file changed, 1 insertion(+), 1 deletion(-)
47 +
48 +diff --git a/CMakeLists.txt b/CMakeLists.txt
49 +index 057fcc4..14a55d2 100644
50 +--- a/CMakeLists.txt
51 ++++ b/CMakeLists.txt
52 +@@ -81,7 +81,7 @@ add_subdirectory(src)
53 + add_subdirectory(icons)
54 + if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc" AND KF5DocTools_VERSION)
55 + add_subdirectory(doc)
56 +-endif(KF5DocTools_VERSION)
57 ++endif()
58 + add_subdirectory(data)
59 +
60 + if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
61 +
62 +From 41a284a0f5f728556280b9f942961631566ad7ff Mon Sep 17 00:00:00 2001
63 +From: Pino Toscano <pino@×××.org>
64 +Date: Sat, 13 May 2017 19:04:47 +0200
65 +Subject: cmake: use NO_POLICY_SCOPE for KDECompilerSettings
66 +
67 +just like done for all the other projects
68 +---
69 + CMakeLists.txt | 2 +-
70 + 1 file changed, 1 insertion(+), 1 deletion(-)
71 +
72 +diff --git a/CMakeLists.txt b/CMakeLists.txt
73 +index 14a55d2..5a58a35 100644
74 +--- a/CMakeLists.txt
75 ++++ b/CMakeLists.txt
76 +@@ -15,7 +15,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_D
77 +
78 + include(KDEInstallDirs)
79 + include(KDECMakeSettings)
80 +-include(KDECompilerSettings)
81 ++include(KDECompilerSettings NO_POLICY_SCOPE)
82 + include(ECMInstallIcons)
83 + #include(ECMSetupVersion)
84 + include(FeatureSummary)
85 +--
86 +cgit v0.11.2
87
88 diff --git a/media-video/kmplayer/files/kmplayer-0.12.0b-desktop.patch b/media-video/kmplayer/files/kmplayer-0.12.0b-desktop.patch
89 new file mode 100644
90 index 00000000000..c84944effc2
91 --- /dev/null
92 +++ b/media-video/kmplayer/files/kmplayer-0.12.0b-desktop.patch
93 @@ -0,0 +1,47 @@
94 +From 2126d76b8f16381e576de779b94b5b4555e562c2 Mon Sep 17 00:00:00 2001
95 +From: Luigi Toscano <luigi.toscano@×××××××.it>
96 +Date: Sat, 13 May 2017 21:13:43 +0200
97 +Subject: Fix .desktop: Qt5 apps accept qwindowtitle, not caption
98 +
99 +---
100 + src/org.kde.kmplayer.desktop | 2 +-
101 + 1 file changed, 1 insertion(+), 1 deletion(-)
102 +
103 +diff --git a/src/org.kde.kmplayer.desktop b/src/org.kde.kmplayer.desktop
104 +index fcc5255..2b5435c 100644
105 +--- a/src/org.kde.kmplayer.desktop
106 ++++ b/src/org.kde.kmplayer.desktop
107 +@@ -1,6 +1,6 @@
108 + [Desktop Entry]
109 + Type=Application
110 +-Exec=kmplayer -caption %c %i %U
111 ++Exec=kmplayer -qwindowtitle %c %i %U
112 + Icon=kmplayer
113 + X-DocPath=kmplayer/index.html
114 + Comment=KDE interface for MPlayer
115 +
116 +From 6b7757397c6181664d58d0a9e09cc329f279cc72 Mon Sep 17 00:00:00 2001
117 +From: Luigi Toscano <luigi.toscano@×××××××.it>
118 +Date: Sat, 13 May 2017 21:13:36 +0200
119 +Subject: Add org namespace to the desktop file
120 +
121 +Required by the Desktop Entry Specification for desktop file
122 +with Type=Application.
123 +---
124 + src/CMakeLists.txt | 2 +-
125 + src/kmplayer_part.desktop | 2 +-
126 + 2 files changed, 2 insertions(+), 2 deletions(-)
127 +
128 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
129 +index 7a05382..f675d9a 100644
130 +--- a/src/CMakeLists.txt
131 ++++ b/src/CMakeLists.txt
132 +@@ -122,7 +122,7 @@ install(TARGETS kdeinit_kmplayer ${INSTALL_TARGETS_DEFAULT_ARGS} )
133 +
134 + install(TARGETS kmplayer ${INSTALL_TARGETS_DEFAULT_ARGS})
135 +
136 +-install(FILES kmplayer.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
137 ++install(FILES org.kde.kmplayer.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
138 +
139 + #qt5_add_dbus_interface(kmplayer_SRCS org.kde.Konqueror.Main.xml kmplayer_interface)
140 +
141
142 diff --git a/media-video/kmplayer/files/kmplayer-0.12.0b-devpixelratio.patch b/media-video/kmplayer/files/kmplayer-0.12.0b-devpixelratio.patch
143 new file mode 100644
144 index 00000000000..0dea98084e3
145 --- /dev/null
146 +++ b/media-video/kmplayer/files/kmplayer-0.12.0b-devpixelratio.patch
147 @@ -0,0 +1,36 @@
148 +From 93fa2c2587fa8b2f1b0da4ab7f7f2978f105fac2 Mon Sep 17 00:00:00 2001
149 +From: Koos Vriezen <koos.vriezen@×××××.com>
150 +Date: Sun, 30 Oct 2016 12:58:05 +0100
151 +Subject: Update pixel_device_ratio before painting instead on app startup
152 +
153 +Only used for adding a few pixels to text bounds. So if dragging the app
154 +from a low res to a hires display, that could cause text being tuncated.
155 +---
156 + src/viewarea.cpp | 4 +---
157 + 1 file changed, 1 insertion(+), 3 deletions(-)
158 +
159 +diff --git a/src/viewarea.cpp b/src/viewarea.cpp
160 +index e407c95..77a260f 100644
161 +--- a/src/viewarea.cpp
162 ++++ b/src/viewarea.cpp
163 +@@ -1892,9 +1892,6 @@ KDE_NO_CDTOR_EXPORT ViewArea::ViewArea (QWidget *, View * view, bool paint_bg)
164 + m_minimal (false),
165 + m_updaters_enabled (true),
166 + m_paint_background (paint_bg) {
167 +-#if QT_VERSION >= 0x050600
168 +- pixel_device_ratio = devicePixelRatioF();
169 +-#endif
170 + if (!paint_bg)
171 + setAttribute (Qt::WA_NoSystemBackground, true);
172 + QPalette palette;
173 +@@ -2030,6 +2027,7 @@ KDE_NO_EXPORT void ViewArea::mouseMoveEvent (QMouseEvent * e) {
174 +
175 + KDE_NO_EXPORT void ViewArea::syncVisual () {
176 + #if QT_VERSION >= 0x050600
177 ++ pixel_device_ratio = devicePixelRatioF();
178 + int w = (int)(width() * devicePixelRatioF());
179 + int h = (int)(height() * devicePixelRatioF());
180 + #else
181 +--
182 +cgit v0.11.2
183 +
184
185 diff --git a/media-video/kmplayer/files/kmplayer-0.12.0b-qfile.patch b/media-video/kmplayer/files/kmplayer-0.12.0b-qfile.patch
186 new file mode 100644
187 index 00000000000..32b645cd0a0
188 --- /dev/null
189 +++ b/media-video/kmplayer/files/kmplayer-0.12.0b-qfile.patch
190 @@ -0,0 +1,33 @@
191 +From 7dce8e00c8e48cc08d3cc39909681643aa36ed62 Mon Sep 17 00:00:00 2001
192 +From: Luigi Toscano <luigi.toscano@×××××××.it>
193 +Date: Mon, 8 May 2017 18:07:40 +0200
194 +Subject: Use QFile to copy a file instead of /bin/cp
195 +
196 +The code has been there probably way before QFile gained the copy
197 +functionality.
198 +---
199 + src/kmplayerpartbase.cpp | 8 ++------
200 + 1 file changed, 2 insertions(+), 6 deletions(-)
201 +
202 +diff --git a/src/kmplayerpartbase.cpp b/src/kmplayerpartbase.cpp
203 +index fd7b363..f718496 100644
204 +--- a/src/kmplayerpartbase.cpp
205 ++++ b/src/kmplayerpartbase.cpp
206 +@@ -124,12 +124,8 @@ PartBase::PartBase (QWidget * wparent, QObject * parent, KSharedConfigPtr config
207 + QString bmfile = KStandardDirs::locate ("data", "kmplayer/bookmarks.xml");
208 + QString localbmfile = KStandardDirs::locateLocal ("data", "kmplayer/bookmarks.xml");
209 + if (localbmfile != bmfile) {
210 +- QProcess p;
211 +- QStringList args;
212 +- args << QFile::encodeName (bmfile) << QFile::encodeName (localbmfile);
213 +- p.start ("/bin/cp", args);
214 +- kDebug () << "cp " << args.join (" ");
215 +- p.waitForFinished ();
216 ++ bool bmfileCopied = QFile(bmfile).copy(localbmfile);
217 ++ kDebug() << "bookmarks.xml copied successfully?" << bmfileCopied;
218 + }
219 + m_bookmark_manager = KBookmarkManager::managerForFile (localbmfile, "kmplayer");
220 + m_bookmark_owner = new BookmarkOwner (this);
221 +--
222 +cgit v0.11.2
223 +
224
225 diff --git a/media-video/kmplayer/files/kmplayer-0.12.0b-schedulerepaint.patch b/media-video/kmplayer/files/kmplayer-0.12.0b-schedulerepaint.patch
226 new file mode 100644
227 index 00000000000..02bf9f38b56
228 --- /dev/null
229 +++ b/media-video/kmplayer/files/kmplayer-0.12.0b-schedulerepaint.patch
230 @@ -0,0 +1,61 @@
231 +From 5517262a2a328518dd42a8aa0e37a34152a06282 Mon Sep 17 00:00:00 2001
232 +From: Koos Vriezen <koos.vriezen@×××××.com>
233 +Date: Sun, 30 Oct 2016 12:50:03 +0100
234 +Subject: scheduleRepaint should be called with pixel coordinates
235 +
236 +---
237 + src/viewarea.cpp | 31 ++++++++++++++++++++++++++-----
238 + 1 file changed, 26 insertions(+), 5 deletions(-)
239 +
240 +diff --git a/src/viewarea.cpp b/src/viewarea.cpp
241 +index 24f68cf..e4df941 100644
242 +--- a/src/viewarea.cpp
243 ++++ b/src/viewarea.cpp
244 +@@ -2117,9 +2117,20 @@ KDE_NO_EXPORT void ViewArea::syncVisual () {
245 +
246 + KDE_NO_EXPORT void ViewArea::paintEvent (QPaintEvent * pe) {
247 + #ifdef KMPLAYER_WITH_CAIRO
248 +- if (surface->node)
249 +- scheduleRepaint (IRect (pe->rect ().x (), pe->rect ().y (), pe->rect ().width (), pe->rect ().height ()));
250 +- else
251 ++ if (surface->node) {
252 ++#if QT_VERSION >= 0x050600
253 ++ int x = (int)(pe->rect().x() * devicePixelRatioF());
254 ++ int y = (int)(pe->rect().y() * devicePixelRatioF());
255 ++ int w = (int)(pe->rect().width() * devicePixelRatioF());
256 ++ int h = (int)(pe->rect().height() * devicePixelRatioF());
257 ++#else
258 ++ int x = pe->rect().x();
259 ++ int y = pe->rect().y();
260 ++ int w = pe->rect().width();
261 ++ int h = pe->rect().height();
262 ++#endif
263 ++ scheduleRepaint(IRect(x, y, w, h));
264 ++ } else
265 + #endif
266 + if (m_fullscreen || m_paint_background)
267 + {
268 +@@ -2647,8 +2658,18 @@ void VideoOutput::setGeometry (const IRect &rect) {
269 + void VideoOutput::setAspect (float a) {
270 + m_aspect = a;
271 + QRect r = geometry ();
272 +- m_view->viewArea ()->scheduleRepaint (
273 +- IRect (r.x (), r.y (), r.width (), r.height ()));
274 ++#if QT_VERSION >= 0x050600
275 ++ int x = (int)(r.x() * devicePixelRatioF());
276 ++ int y = (int)(r.y() * devicePixelRatioF());
277 ++ int w = (int)(r.width() * devicePixelRatioF());
278 ++ int h = (int)(r.height() * devicePixelRatioF());
279 ++#else
280 ++ int x = r.x();
281 ++ int y = r.y();
282 ++ int w = r.width();
283 ++ int h = r.height();
284 ++#endif
285 ++ m_view->viewArea()->scheduleRepaint(IRect(x, y, w, h));
286 + }
287 +
288 + KDE_NO_EXPORT void VideoOutput::map () {
289 +--
290 +cgit v0.11.2
291 +
292
293 diff --git a/media-video/kmplayer/kmplayer-0.12.0b-r1.ebuild b/media-video/kmplayer/kmplayer-0.12.0b-r1.ebuild
294 new file mode 100644
295 index 00000000000..43183239639
296 --- /dev/null
297 +++ b/media-video/kmplayer/kmplayer-0.12.0b-r1.ebuild
298 @@ -0,0 +1,95 @@
299 +# Copyright 1999-2017 Gentoo Foundation
300 +# Distributed under the terms of the GNU General Public License v2
301 +
302 +EAPI=6
303 +
304 +KDE_HANDBOOK="true"
305 +inherit kde5
306 +
307 +DESCRIPTION="Video player plugin for Konqueror and basic MPlayer frontend"
308 +HOMEPAGE="https://kmplayer.kde.org"
309 +SRC_URI="mirror://kde/stable/${PN}/${EGIT_BRANCH}/${P}.tar.bz2"
310 +
311 +LICENSE="GPL-2 FDL-1.2 LGPL-2.1"
312 +KEYWORDS="~amd64 ~x86"
313 +IUSE="cairo npp"
314 +
315 +CDEPEND="
316 + $(add_frameworks_dep kbookmarks)
317 + $(add_frameworks_dep kcompletion)
318 + $(add_frameworks_dep kconfig)
319 + $(add_frameworks_dep kconfigwidgets)
320 + $(add_frameworks_dep kcoreaddons)
321 + $(add_frameworks_dep kdelibs4support)
322 + $(add_frameworks_dep ki18n)
323 + $(add_frameworks_dep kiconthemes)
324 + $(add_frameworks_dep kio)
325 + $(add_frameworks_dep kmediaplayer)
326 + $(add_frameworks_dep kparts)
327 + $(add_frameworks_dep ktextwidgets)
328 + $(add_frameworks_dep kwidgetsaddons)
329 + $(add_frameworks_dep kxmlgui)
330 + $(add_qt_dep qtdbus)
331 + $(add_qt_dep qtgui)
332 + $(add_qt_dep qtsvg)
333 + $(add_qt_dep qtwidgets)
334 + $(add_qt_dep qtx11extras)
335 + $(add_qt_dep qtxml)
336 + media-libs/phonon[qt5(+)]
337 + x11-libs/libX11
338 + x11-libs/libxcb
339 + cairo? ( x11-libs/cairo[xcb] )
340 + npp? (
341 + dev-libs/dbus-glib
342 + dev-libs/glib:2
343 + www-plugins/adobe-flash:*
344 + >=x11-libs/gtk+-2.10.14:2
345 + )
346 +"
347 +DEPEND="${CDEPEND}
348 + sys-devel/gettext
349 +"
350 +RDEPEND="${CDEPEND}
351 + media-video/mplayer
352 + !media-video/kmplayer:4
353 +"
354 +
355 +PATCHES=(
356 + "${FILESDIR}"/${P}-schedulerepaint.patch
357 + "${FILESDIR}"/${P}-devpixelratio.patch
358 + "${FILESDIR}"/${P}-qfile.patch
359 + "${FILESDIR}"/${P}-cmake.patch
360 + "${FILESDIR}"/${P}-desktop.patch
361 + "${FILESDIR}"/${P}-qt-5.9.patch
362 +)
363 +
364 +src_prepare() {
365 + # Prerequisite for ${P}-desktop.patch:
366 + mv src/kmplayer.desktop src/org.kde.kmplayer.desktop || die
367 + kde5_src_prepare
368 +
369 + if use npp; then
370 + sed -i src/kmplayer_part.desktop \
371 + -e ":^MimeType: s:=:=application/x-shockwave-flash;:" || die
372 + fi
373 +}
374 +
375 +src_configure() {
376 + # 0.12: expat build broken, check in later releases
377 + local mycmakeargs=(
378 + -DKMPLAYER_BUILT_WITH_EXPAT=OFF
379 + -DKMPLAYER_BUILT_WITH_CAIRO=$(usex cairo)
380 + -DKMPLAYER_BUILT_WITH_NPP=$(usex npp)
381 + )
382 +
383 + kde5_src_configure
384 +}
385 +
386 +src_install() {
387 + kde5_src_install
388 +
389 + if use npp; then
390 + kwriteconfig5 --file "${ED}/usr/share/config/kmplayerrc" --group "application/x-shockwave-flash" --key player npp
391 + kwriteconfig5 --file "${ED}/usr/share/config/kmplayerrc" --group "application/x-shockwave-flash" --key plugin /usr/lib/nsbrowser/plugins/libflashplayer.so
392 + fi
393 +}