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-sound/qtscrobbler/files/, media-sound/qtscrobbler/
Date: Sun, 08 Apr 2018 19:26:38
Message-Id: 1523215580.7c4215924fc8369d0321cbca1203d2f08d54933a.asturm@gentoo
1 commit: 7c4215924fc8369d0321cbca1203d2f08d54933a
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 8 19:15:29 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 8 19:26:20 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c421592
7
8 media-sound/qtscrobbler: Switch to Qt5
9
10 Patch kindly borrowed from Debian.
11
12 Bug: https://bugs.gentoo.org/641922
13 Package-Manager: Portage-2.3.28, Repoman-2.3.9
14
15 media-sound/qtscrobbler/Manifest | 1 +
16 .../files/qtscrobbler-0.11_pre20130123-qt5.patch | 194 +++++++++++++++++++++
17 .../qtscrobbler-0.11_pre20130123.ebuild | 56 ++++++
18 3 files changed, 251 insertions(+)
19
20 diff --git a/media-sound/qtscrobbler/Manifest b/media-sound/qtscrobbler/Manifest
21 index 936f50aaf1d..6dcf57b924a 100644
22 --- a/media-sound/qtscrobbler/Manifest
23 +++ b/media-sound/qtscrobbler/Manifest
24 @@ -1 +1,2 @@
25 DIST qtscrob-0.10.tar.bz2 132507 BLAKE2B 168bc3747bb48e7c5fedbaeb66cf12c4d7230fb240fb9b034b576f739ef55c497cdb6d8383bace8a00ad54890882134598777acc826d8ced195488b932123e92 SHA512 d743976ef26c4f61402187930ac2cfba71bc4d7079e1166bdb34115196c99d3e0093a4df06d4b0eda24ab4f0f6fcce840812fd2d1dff847dc905adc9a74127c5
26 +DIST qtscrobbler-0.11_pre20130123.zip 298519 BLAKE2B 36d3c3fdf59aa7fd9127c0200b03a6427f6fa27cb40e144f10041a25ba977e40fc5f63547596cf93f797d94e741a4a159c5e1aa48f8742d7738d1c113b22aae8 SHA512 24de4a45d4b31fb3c544b963b97b8716b8472a0dfde1bd2fd6bf101785f22ef07ff34fcd9ce7028fe231b215538bb8e4c3248c234feb870a3adeb4c0b259d646
27
28 diff --git a/media-sound/qtscrobbler/files/qtscrobbler-0.11_pre20130123-qt5.patch b/media-sound/qtscrobbler/files/qtscrobbler-0.11_pre20130123-qt5.patch
29 new file mode 100644
30 index 00000000000..910471aca6c
31 --- /dev/null
32 +++ b/media-sound/qtscrobbler/files/qtscrobbler-0.11_pre20130123-qt5.patch
33 @@ -0,0 +1,194 @@
34 +Origin: other, https://sourceforge.net/p/qtscrob/patches/15/
35 +Bug: https://sourceforge.net/p/qtscrob/patches/15/
36 +Bug-Debian: https://bugs.debian.org/875156
37 +Description: Port to Qt5
38 +
39 +--- a/src/lib/gettrackinfo.cpp
40 ++++ b/src/lib/gettrackinfo.cpp
41 +@@ -58,7 +58,7 @@
42 + data += "&track=" + QUrl::toPercentEncoding(track_info.title);
43 + data += "&autocorrect=1";
44 + time.restart();
45 +- manager->post(request, QByteArray(data.toAscii()));
46 ++ manager->post(request, QByteArray(data.toLatin1()));
47 + }
48 +
49 + void GetTrackInfo::run()
50 +--- a/src/lib/lib.pro
51 ++++ b/src/lib/lib.pro
52 +@@ -13,7 +13,8 @@
53 + QT += core \
54 + network \
55 + xml \
56 +- sql
57 ++ sql \
58 ++ widgets
59 +
60 + QT -= gui
61 + LANGUAGE = C++
62 +--- a/src/lib/parse-log.cpp
63 ++++ b/src/lib/parse-log.cpp
64 +@@ -153,9 +153,9 @@
65 + //right number of tabs in the line
66 + scrob_entry temp_entry;
67 +
68 +- temp_entry.artist = QString::fromUtf8(log_entry[0].toAscii());
69 +- temp_entry.album = QString::fromUtf8(log_entry[1].toAscii());
70 +- temp_entry.title = QString::fromUtf8(log_entry[2].toAscii());
71 ++ temp_entry.artist = QString::fromUtf8(log_entry[0].toLatin1());
72 ++ temp_entry.album = QString::fromUtf8(log_entry[1].toLatin1());
73 ++ temp_entry.title = QString::fromUtf8(log_entry[2].toLatin1());
74 + temp_entry.tracknum = log_entry[3].toInt();
75 + temp_entry.length = log_entry[4].toInt();
76 + temp_entry.played = log_entry[5][0];
77 +--- a/src/lib/submit.cpp
78 ++++ b/src/lib/submit.cpp
79 +@@ -151,7 +151,7 @@
80 + submit_handshake.setHeader(QNetworkRequest::ContentTypeHeader,
81 + "application/x-www-form-urlencoded");
82 +
83 +- QByteArray submit_data = QByteArray(data.toAscii());
84 ++ QByteArray submit_data = QByteArray(data.toLatin1());
85 + nr_submit = nam_submit->post(submit_handshake, submit_data);
86 + }
87 +
88 +@@ -251,7 +251,7 @@
89 + QString time_str = QString::number(QDateTime::currentDateTime().toTime_t());
90 +
91 + QCryptographicHash auth_hash(QCryptographicHash::Md5);
92 +- auth_hash.addData(QString(context.password_hash + time_str).toAscii());
93 ++ auth_hash.addData(QString(context.password_hash + time_str).toLatin1());
94 + QString auth = QString(auth_hash.result().toHex());
95 +
96 + QUrl url_handshake = QString( "http://%1/?hs=true&p=%2&c=%3&v=%4&u=%5&t=%6&a=%7" )
97 +--- a/src/lib/submit.h
98 ++++ b/src/lib/submit.h
99 +@@ -20,7 +20,6 @@
100 + #define SUBMIT_H
101 +
102 + #include <QtCore>
103 +-#include <QHttp>
104 + #include <QNetworkAccessManager>
105 + #include <QNetworkProxy>
106 + #include <QNetworkReply>
107 +--- a/src/qt/qt.pro
108 ++++ b/src/qt/qt.pro
109 +@@ -34,6 +34,7 @@
110 + TEMPLATE = app
111 + TARGET = qtscrob
112 + QT += gui
113 ++QT += widgets
114 + LANGUAGE = C++
115 + INCLUDEPATH += . \
116 + src \
117 +--- a/src/qt/src/about.h
118 ++++ b/src/qt/src/about.h
119 +@@ -22,6 +22,7 @@
120 + #include "ui_aboutWin.h"
121 + #include <QApplication>
122 + #include <QtGui>
123 ++#include <QLabel>
124 +
125 + class QTScrob;
126 +
127 +--- a/src/qt/src/console.h
128 ++++ b/src/qt/src/console.h
129 +@@ -22,6 +22,11 @@
130 + #include <QTimer>
131 + #include <QApplication>
132 + #include <QtGui>
133 ++#include <QLabel>
134 ++#include <QTextEdit>
135 ++#include <QDialog>
136 ++#include <QComboBox>
137 ++#include <QPushButton>
138 +
139 + class QTScrob;
140 + class QTimer;
141 +--- a/src/qt/src/help.h
142 ++++ b/src/qt/src/help.h
143 +@@ -21,6 +21,9 @@
144 +
145 + #include <QApplication>
146 + #include <QtGui>
147 ++#include <QLabel>
148 ++#include <QDialog>
149 ++#include <QTextEdit>
150 +
151 + class QTScrob;
152 +
153 +--- a/src/qt/src/progress.h
154 ++++ b/src/qt/src/progress.h
155 +@@ -21,6 +21,13 @@
156 +
157 + #include <QApplication>
158 + #include <QtGui>
159 ++#include <QLabel>
160 ++#include <QWidget>
161 ++#include <QProgressBar>
162 ++#include <QDialog>
163 ++#include <QFormLayout>
164 ++#include <QVBoxLayout>
165 ++#include <QPushButton>
166 +
167 + class QTScrob;
168 +
169 +--- a/src/qt/src/qtscrob.cpp
170 ++++ b/src/qt/src/qtscrob.cpp
171 +@@ -41,7 +41,7 @@
172 + logTable->setHorizontalHeaderLabels(tableLabels);
173 + logTable->setAlternatingRowColors(true);
174 + logTable->setSelectionBehavior(QAbstractItemView::SelectRows);
175 +- logTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
176 ++ logTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
177 + logTable->installEventFilter(this);
178 +
179 + recalc_timestamp = scrob->get_gmt();
180 +@@ -600,7 +600,7 @@
181 + case 5:
182 + if (!logTable->item(r, c)->text().isEmpty())
183 + {
184 +- char rating = logTable->item(r, c)->text().toAscii().data()[0];
185 ++ char rating = logTable->item(r, c)->text().toLatin1().data()[0];
186 + if ('L' == rating || 'S' == rating)
187 + tmp.played = rating;
188 + }
189 +--- a/src/qt/src/qtscrob.h
190 ++++ b/src/qt/src/qtscrob.h
191 +@@ -23,12 +23,20 @@
192 + #include <QtGui>
193 + #include <QApplication>
194 + #include <QMainWindow>
195 ++#include <QTableWidget>
196 ++#include <QMenu>
197 ++#include <QMenuBar>
198 ++#include <QStatusBar>
199 ++#include <QFile>
200 ++#include <QFileDialog>
201 ++#include <QTextEdit>
202 + #include <QMessageBox>
203 + #include <QByteArray>
204 + #include <QtDebug>
205 + #include <QSettings>
206 + #include <QDateTimeEdit>
207 + #include <QLabel>
208 ++#include <QWidget>
209 + #include "libscrobble.h"
210 + #include "common.h"
211 + #include "missingtimeprogress.h"
212 +--- a/src/qtscrob.pro
213 ++++ b/src/qtscrob.pro
214 +@@ -1,4 +1,4 @@
215 +-VER = $$find(QT_VERSION, ^4\\.[6-9]+.*)
216 ++VER = $$find(QT_VERSION, ^4\\.[6-9]+.*|^5)
217 + isEmpty(VER) {
218 + message("Qt >= 4.6 required!")
219 + !isEmpty(QT_VERSION) error("Qt found:" $$[QT_VERSION])
220 +@@ -17,6 +17,7 @@
221 + system($$QMAKE_LUPDATE -silent language/language.pro)
222 + system($$QMAKE_LRELEASE -silent language/language.pro)
223 +
224 ++QT += widgets
225 + TEMPLATE=subdirs
226 + SUBDIRS=lib qt cli
227 + CONFIG += ordered
228
229 diff --git a/media-sound/qtscrobbler/qtscrobbler-0.11_pre20130123.ebuild b/media-sound/qtscrobbler/qtscrobbler-0.11_pre20130123.ebuild
230 new file mode 100644
231 index 00000000000..6a3e9163a25
232 --- /dev/null
233 +++ b/media-sound/qtscrobbler/qtscrobbler-0.11_pre20130123.ebuild
234 @@ -0,0 +1,56 @@
235 +# Copyright 1999-2018 Gentoo Foundation
236 +# Distributed under the terms of the GNU General Public License v2
237 +
238 +EAPI=6
239 +
240 +COMMIT=33ed278b9b543554fd6a556fd391eb4c78faab07
241 +MY_PN=qtscrob
242 +MY_P=${MY_PN}-${PV}
243 +inherit desktop gnome2-utils qmake-utils toolchain-funcs
244 +
245 +DESCRIPTION="Updates last.fm profiles using information from supported portable music players"
246 +HOMEPAGE="http://qtscrob.sourceforge.net/"
247 +SRC_URI="https://sourceforge.net/code-snapshots/git/q/qt/${MY_PN}/code.git/${MY_PN}-code-${COMMIT}.zip -> ${P}.zip"
248 +
249 +LICENSE="GPL-2"
250 +SLOT="0"
251 +KEYWORDS="~amd64 ~x86"
252 +IUSE=""
253 +
254 +RDEPEND="
255 + dev-qt/qtcore:5
256 + dev-qt/qtgui:5
257 + dev-qt/qtnetwork:5
258 + dev-qt/qtsql:5
259 + dev-qt/qtwidgets:5
260 + media-libs/libmtp:=
261 + net-misc/curl"
262 +DEPEND="${RDEPEND}
263 + virtual/pkgconfig"
264 +
265 +S="${WORKDIR}/${MY_PN}-code-${COMMIT}"
266 +
267 +PATCHES=( "${FILESDIR}"/${P}-qt5.patch )
268 +
269 +src_configure() {
270 + pushd src >/dev/null
271 + eqmake5 ${MY_PN}.pro
272 + popd >/dev/null
273 +}
274 +
275 +src_compile() {
276 + emake -C src
277 +}
278 +
279 +src_install() {
280 + newbin src/cli/scrobbler qtscrobbler-cli
281 +
282 + newbin src/qt/qtscrob qtscrobbler
283 + newicon src/qt/resources/icons/256x256/qtscrob.png qtscrobbler.png
284 + make_desktop_entry qtscrobbler QtScrobbler
285 +
286 + einstalldocs
287 +}
288 +
289 +pkg_postinst() { gnome2_icon_cache_update; }
290 +pkg_postrm() { gnome2_icon_cache_update; }