app-mobilephone/qtadb: Switch to Qt5
authorAndreas Sturmlechner <asturm@gentoo.org>
Sat, 17 Mar 2018 21:30:29 +0000 (22:30 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sat, 17 Mar 2018 23:10:33 +0000 (00:10 +0100)
Thanks-to: Phil Stracchino (Unix Ronin) <phils@caerllewys.net>
Bug: https://bugs.gentoo.org/645428
Package-Manager: Portage-2.3.24, Repoman-2.3.6

app-mobilephone/qtadb/Manifest
app-mobilephone/qtadb/files/qtadb-0.8.1-qt5.patch [new file with mode: 0644]
app-mobilephone/qtadb/qtadb-0.8.1-r1.ebuild [new file with mode: 0644]

index 43718c9c9c9770ffb2acddc16a630bd5cad03667..967eb7fa2ca2740836c9e2c5c415bcd01787fb4a 100644 (file)
@@ -1 +1,2 @@
 DIST QtADB_0.8.1_src.zip 1084159 BLAKE2B 8d97024fcccc909d6958168933e5f832fb8ce14aa0ed95b20a2e3c6bb44f9f36451f3c6271991c1a791be56dc5352267d3ffcde60c36795963a4a3e5eac9bc6c SHA512 4bcf28a9442873c3d94c33f5b629c1528efb10a34a6825eb8e596ea6fbb23144a56b64bccc258eaf579ca7d86bd7520f6274d611243290ae6f3bee72021346fa
+DIST qtadb-0.8.1.zip 1104845 BLAKE2B f6f7c08b07c2e59d79e9807850f3ccdedbbc1aff2b94556de748aadc7c26ff8f8bc41275e44e4b4f8249bc1806803c5fea27426d5f895959d546610c0ae07245 SHA512 b407198edd6267ef70e5e2e3b8a094c7b9d9a0bc49dce7e60787e76a1da6e752dd92d7ddbf62a133c44b79118365820b0e710c862c15c9b79f2d7ddf3bc13fd7
diff --git a/app-mobilephone/qtadb/files/qtadb-0.8.1-qt5.patch b/app-mobilephone/qtadb/files/qtadb-0.8.1-qt5.patch
new file mode 100644 (file)
index 0000000..a9d182a
--- /dev/null
@@ -0,0 +1,100 @@
+--- a/QtADB.pro        2018-03-17 12:44:50.933918102 -0400
++++ b/QtADB.pro        2018-03-17 12:46:04.896502772 -0400
+@@ -14,11 +14,13 @@
+ #   limitations under the License.\r
+ #\r
+ #   @author Jakub Motyczko\r
+ # -------------------------------------------------\r
+ QT += network\r
+-QT += declarative\r
++QT += widgets\r
++QT += qml\r
++QT += quick\r
+ TARGET = QtADB\r
\r
+ TEMPLATE = app\r
+ SOURCES += main.cpp \\r
+     ./dialogs/mainwindow.cpp \\r
+--- a/widgets/messagewidget.h  2018-03-17 12:48:28.691864775 -0400
++++ b/widgets/messagewidget.h  2018-03-17 12:49:55.190870634 -0400
+@@ -21,12 +21,13 @@
+ #ifndef MESSAGEWIDGET_H\r
+ #define MESSAGEWIDGET_H\r
\r
+ #include <QtGui>\r
+ #include <QtNetwork>\r
++#include <QtWidgets>\r
++#include <QQmlContext>\r
++#include <QQuickView>\r
+-#include <QDeclarativeView>\r
+-#include <QDeclarativeContext>\r
\r
+ #include "../classes/models/messagethreadmodel.h"\r
+ #include "../classes/models/contactmodel.h"\r
\r
\r
+@@ -46,12 +49,12 @@
+ protected:\r
+     void changeEvent(QEvent *e);\r
\r
+ private:\r
+     Ui::MessageWidget *ui;\r
+-    QDeclarativeView *qmlView;\r
+-    QDeclarativeContext *qmlViewCtx;\r
++    QQuickView *qmlView;\r
++    QQmlContext *qmlViewCtx;\r
\r
+     MessageModel messageModel;\r
+     MessageThreadModel messageThreadModel;\r
+     ContactModel contactModel;\r
+     QSortFilterProxyModel sortModel;\r
+--- a/widgets/appwidget.h      2018-03-17 12:58:56.731870593 -0400
++++ b/widgets/appwidget.h      2018-03-17 13:03:39.366822784 -0400
+@@ -20,10 +20,11 @@
\r
+ #ifndef APPWIDGET_H\r
+ #define APPWIDGET_H\r
\r
+ #include <QtGui>\r
++#include <QtWidgets>\r
\r
+ #include "../classes/phone.h"\r
+ #include "../classes/computer.h"\r
+ #include "../dialogs/appinfo.h"\r
+ #include "../dialogs/appdialog.h"\r
+--- a/widgets/messagewidget.cpp        2018-03-17 16:34:54.003310530 -0400
++++ b/widgets/messagewidget.cpp        2018-03-17 16:34:14.545124690 -0400
+@@ -51,11 +51,11 @@
+     this->sortContactModel.setSortRole(ContactModel::NameRole);\r
+     this->sortContactModel.sort(0, Qt::AscendingOrder);\r
\r
+     this->messageCount=0;\r
\r
+-    this->qmlView =  new QDeclarativeView;\r
++    this->qmlView =  new QQuickView;\r
+     this->qmlViewCtx = this->qmlView->rootContext();\r
+     if (QFile::exists("qml/messageView.qml"))\r
+         this->qmlView->setSource(QUrl::fromLocalFile("qml/messageView.qml"));\r
+     else\r
+         //this->qmlView->setSource(QUrl::fromLocalFile("../messages/qml/messageView.qml"));\r
+@@ -63,15 +63,17 @@
+     this->qmlViewCtx->setContextProperty("threadModel", &sortThreadModel);\r
+     this->qmlViewCtx->setContextProperty("contactModel", &sortContactModel);\r
+     this->qmlViewCtx->setContextProperty("messageModel", &sortModel);\r
+     this->qmlViewCtx->setContextProperty("myNickname", "Me");\r
+     this->qmlViewCtx->setContextProperty("contactDefault", "qrc:/icons/contactDefault.png");\r
+-    qmlView->setResizeMode(QDeclarativeView::SizeRootObjectToView);\r
+-\r
++    qmlView->setResizeMode(QQuickView::SizeRootObjectToView);\r
++    \r
+     this->qmlViewCtx->setContextProperty("messageWidget", this);\r
++    QWidget *container = QWidget::createWindowContainer(qmlView, this);\r
++    container->setFocusPolicy(Qt::TabFocus);\r
\r
+-    ui->layoutMessages->addWidget(this->qmlView,1,1);\r
++    ui->layoutMessages->addWidget(container);\r
\r
+     //QSettings settings;\r
+     //this->sdk = settings.value("sdkPath").toString();\r
+     this->tcpServer.listen(QHostAddress::Any,4445);\r
\r
diff --git a/app-mobilephone/qtadb/qtadb-0.8.1-r1.ebuild b/app-mobilephone/qtadb/qtadb-0.8.1-r1.ebuild
new file mode 100644 (file)
index 0000000..9aeb80e
--- /dev/null
@@ -0,0 +1,63 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+COMMIT=ccbb0c86c9eb
+inherit desktop qmake-utils readme.gentoo-r1
+
+DESCRIPTION="Android phone manager via ADB"
+HOMEPAGE="https://qtadb.wordpress.com"
+SRC_URI="https://bitbucket.org/michalmotyczko/${PN}/get/${COMMIT}.zip -> ${P}.zip"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+       dev-qt/qtcore:5
+       dev-qt/qtdeclarative:5
+       dev-qt/qtgui:5
+       dev-qt/qtnetwork:5
+       dev-qt/qtwidgets:5
+"
+DEPEND="${RDEPEND}
+       app-arch/unzip
+"
+
+PATCHES=( "${FILESDIR}"/${P}-qt5.patch )
+
+S="${WORKDIR}/michalmotyczko-${PN}-${COMMIT}"
+
+src_configure() {
+       eqmake5
+}
+
+src_install() {
+       newicon images/android.png ${PN}.png
+       make_desktop_entry QtADB QtADB ${PN} \
+               "Qt;PDA;Utility;" || ewarn "Desktop entry creation failed"
+       dobin QtADB
+
+       local DOC_CONTENTS="
+You will need a working Android SDK installation (adb and aapt executables)
+You can install Android SDK a) through portage (emerge android-sdk-update-manager
+and run android to download the actual sdk), b) manually from
+http://developer.android.com/sdk/index.html or c) just grab the adb, aapt linux
+binaries from http://qtadb.wordpress.com/download/
+adb and aapt executables are in the platform-tools subdir of Android SDK.  You
+must run QtADB from this directory as a user able to write a log file in this
+directory.
+
+Also you will need to have ROOT access to your phone along with busybox
+The latter can be found in the Android market
+
+Last, if you want to use the SMS manager of QtADB, you have to install
+QtADB.apk to your device, available here: http://qtadb.wordpress.com/download/
+
+If you have trouble getting your phone connected through usb (driver problem),
+try adbWireless from Android market to get connected through WiFi
+"
+       readme.gentoo_create_doc
+}