Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtwebchannel/, dev-qt/qtwebchannel/files/
Date: Thu, 29 Oct 2015 16:41:16
Message-Id: 1446136858.beaed53e82472e6ad4283525798bd02286b1af22.kensington@gentoo
1 commit: beaed53e82472e6ad4283525798bd02286b1af22
2 Author: Michael Palimaka <kensington <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 29 16:40:35 2015 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 29 16:40:58 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=beaed53e
7
8 dev-qt/qtwebchannel: backport patch from upstream solving build failure with USE="-qml"
9
10 Gentoo-bug: 564412
11
12 Package-Manager: portage-2.2.20.1
13
14 ...qtwebchannel-5.5.1-optional-qtdeclarative.patch | 62 ++++++++++++++++++++++
15 dev-qt/qtwebchannel/qtwebchannel-5.5.1.ebuild | 2 +
16 2 files changed, 64 insertions(+)
17
18 diff --git a/dev-qt/qtwebchannel/files/qtwebchannel-5.5.1-optional-qtdeclarative.patch b/dev-qt/qtwebchannel/files/qtwebchannel-5.5.1-optional-qtdeclarative.patch
19 new file mode 100644
20 index 0000000..e7011ad
21 --- /dev/null
22 +++ b/dev-qt/qtwebchannel/files/qtwebchannel-5.5.1-optional-qtdeclarative.patch
23 @@ -0,0 +1,62 @@
24 +From 906d910415454d64ff0b021b06f0df422a8c82bd Mon Sep 17 00:00:00 2001
25 +From: Andy Shaw <andy.shaw@××××××××××××.com>
26 +Date: Wed, 23 Sep 2015 06:52:01 +0000
27 +Subject: [PATCH] Compile when QML is disabled
28 +
29 +Since QJSValue is part of the QML module then it should check if that is
30 +available before using it so we add a QT_NO_JSVALUE define to help with
31 +this.
32 +
33 +Task-number: QTBUG-46850
34 +Change-Id: I1974518a5c134dbb8508a46505b43c820a7a700a
35 +Reviewed-by: Liang Qi <liang.qi@××××××××××××.com>
36 +---
37 + src/webchannel/qmetaobjectpublisher.cpp | 4 ++++
38 + src/webchannel/webchannel.pro | 2 ++
39 + 2 files changed, 6 insertions(+)
40 +
41 +diff --git a/src/webchannel/qmetaobjectpublisher.cpp b/src/webchannel/qmetaobjectpublisher.cpp
42 +index 0cad569..22df02b 100644
43 +--- a/src/webchannel/qmetaobjectpublisher.cpp
44 ++++ b/src/webchannel/qmetaobjectpublisher.cpp
45 +@@ -41,7 +41,9 @@
46 + #include <QDebug>
47 + #include <QJsonObject>
48 + #include <QJsonArray>
49 ++#ifndef QT_NO_JSVALUE
50 + #include <QJSValue>
51 ++#endif
52 + #include <QUuid>
53 +
54 + QT_BEGIN_NAMESPACE
55 +@@ -486,12 +488,14 @@ QJsonValue QMetaObjectPublisher::wrapResult(const QVariant &result, QWebChannelA
56 + if (!classInfo.isEmpty())
57 + objectInfo[KEY_DATA] = classInfo;
58 + return objectInfo;
59 ++#ifndef QT_NO_JSVALUE
60 + } else if (result.canConvert<QJSValue>()) {
61 + // Workaround for keeping QJSValues from QVariant.
62 + // Calling QJSValue::toVariant() converts JS-objects/arrays to QVariantMap/List
63 + // instead of stashing a QJSValue itself into a variant.
64 + // TODO: Improve QJSValue-QJsonValue conversion in Qt.
65 + return wrapResult(result.value<QJSValue>().toVariant(), transport, parentObjectId);
66 ++#endif
67 + } else if (result.canConvert<QVariantList>()) {
68 + // recurse and potentially wrap contents of the array
69 + return wrapList(result.toList(), transport);
70 +diff --git a/src/webchannel/webchannel.pro b/src/webchannel/webchannel.pro
71 +index eba8123..931ee03 100644
72 +--- a/src/webchannel/webchannel.pro
73 ++++ b/src/webchannel/webchannel.pro
74 +@@ -39,6 +39,8 @@ qtHaveModule(qml) {
75 +
76 + PRIVATE_HEADERS += \
77 + qqmlwebchannelattached_p.h
78 ++} else {
79 ++ DEFINES += QT_NO_JSVALUE
80 + }
81 +
82 + HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
83 +--
84 +2.4.10
85 +
86
87 diff --git a/dev-qt/qtwebchannel/qtwebchannel-5.5.1.ebuild b/dev-qt/qtwebchannel/qtwebchannel-5.5.1.ebuild
88 index b3c9b85..ac67dce 100644
89 --- a/dev-qt/qtwebchannel/qtwebchannel-5.5.1.ebuild
90 +++ b/dev-qt/qtwebchannel/qtwebchannel-5.5.1.ebuild
91 @@ -19,6 +19,8 @@ DEPEND="
92 "
93 RDEPEND="${DEPEND}"
94
95 +PATCHES=( "${FILESDIR}/${P}-optional-qtdeclarative.patch" )
96 +
97 src_prepare() {
98 qt_use_disable_mod qml quick src/src.pro
99 qt_use_disable_mod qml qml src/webchannel/webchannel.pro