1 |
commit: 9e05aaacaa41045d2f7b08efe61899a0087e699b |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 7 19:16:04 2021 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 7 19:16:17 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e05aaac |
7 |
|
8 |
net-misc/nextcloud-client: make qtwebengine optional |
9 |
|
10 |
This large dependency is not needed for most current authentications |
11 |
|
12 |
Also updated many build options (doc, dolphin and nautilus integration) |
13 |
|
14 |
Closes: https://bugs.gentoo.org/800863 |
15 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
16 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
17 |
|
18 |
.../files/nextcloud-client-3.2.3-webengine.patch | 419 +++++++++++++++++++++ |
19 |
net-misc/nextcloud-client/metadata.xml | 1 + |
20 |
.../nextcloud-client-3.2.3-r1.ebuild | 94 +++++ |
21 |
3 files changed, 514 insertions(+) |
22 |
|
23 |
diff --git a/net-misc/nextcloud-client/files/nextcloud-client-3.2.3-webengine.patch b/net-misc/nextcloud-client/files/nextcloud-client-3.2.3-webengine.patch |
24 |
new file mode 100644 |
25 |
index 00000000000..8152528f30c |
26 |
--- /dev/null |
27 |
+++ b/net-misc/nextcloud-client/files/nextcloud-client-3.2.3-webengine.patch |
28 |
@@ -0,0 +1,419 @@ |
29 |
+diff -Naur desktop-3.2.3.orig/src/CMakeLists.txt desktop-3.2.3/src/CMakeLists.txt |
30 |
+--- desktop-3.2.3.orig/src/CMakeLists.txt 2021-06-24 12:04:33.000000000 +0200 |
31 |
++++ desktop-3.2.3/src/CMakeLists.txt 2021-07-07 20:26:40.620839467 +0200 |
32 |
+@@ -4,7 +4,13 @@ |
33 |
+ |
34 |
+ set(synclib_NAME ${APPLICATION_EXECUTABLE}sync) |
35 |
+ |
36 |
+-find_package(Qt5 5.12 COMPONENTS Core Network Xml Concurrent WebEngineWidgets WebEngine REQUIRED) |
37 |
++find_package(Qt5 5.12 COMPONENTS Core Network Xml Concurrent REQUIRED) |
38 |
++find_package(Qt5 5.12 COMPONENTS WebEngineWidgets WebEngine) |
39 |
++ |
40 |
++if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) |
41 |
++ add_compile_definitions(WITH_WEBENGINE=1) |
42 |
++endif() |
43 |
++ |
44 |
+ get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) |
45 |
+ message(STATUS "Using Qt ${Qt5Core_VERSION} (${QT_QMAKE_EXECUTABLE})") |
46 |
+ |
47 |
+diff -Naur desktop-3.2.3.orig/src/gui/CMakeLists.txt desktop-3.2.3/src/gui/CMakeLists.txt |
48 |
+--- desktop-3.2.3.orig/src/gui/CMakeLists.txt 2021-06-24 12:04:33.000000000 +0200 |
49 |
++++ desktop-3.2.3/src/gui/CMakeLists.txt 2021-07-07 20:26:40.620839467 +0200 |
50 |
+@@ -128,12 +128,17 @@ |
51 |
+ wizard/owncloudwizardcommon.cpp |
52 |
+ wizard/owncloudwizard.cpp |
53 |
+ wizard/owncloudwizardresultpage.cpp |
54 |
+- wizard/webviewpage.cpp |
55 |
+- wizard/webview.cpp |
56 |
+ wizard/slideshow.cpp |
57 |
+ wizard/welcomepage.cpp |
58 |
+ wizard/linklabel.cpp |
59 |
+-) |
60 |
++ ) |
61 |
++ |
62 |
++if (Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) |
63 |
++ list(APPEND client_SRCS |
64 |
++ wizard/webviewpage.cpp |
65 |
++ wizard/webview.cpp |
66 |
++ ) |
67 |
++endif() |
68 |
+ |
69 |
+ IF(BUILD_UPDATER) |
70 |
+ set(updater_SRCS |
71 |
+@@ -339,9 +344,12 @@ |
72 |
+ Qt5::Qml |
73 |
+ Qt5::Quick |
74 |
+ Qt5::QuickControls2 |
75 |
+- Qt5::WebEngineWidgets |
76 |
+ ${synclib_NAME} |
77 |
+-) |
78 |
++ ) |
79 |
++ |
80 |
++if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) |
81 |
++ target_link_libraries(nextcloudCore PUBLIC Qt5::WebEngineWidgets) |
82 |
++endif() |
83 |
+ |
84 |
+ set_target_properties(nextcloudCore |
85 |
+ PROPERTIES |
86 |
+diff -Naur desktop-3.2.3.orig/src/gui/creds/webflowcredentials.cpp desktop-3.2.3/src/gui/creds/webflowcredentials.cpp |
87 |
+--- desktop-3.2.3.orig/src/gui/creds/webflowcredentials.cpp 2021-06-24 12:04:33.000000000 +0200 |
88 |
++++ desktop-3.2.3/src/gui/creds/webflowcredentials.cpp 2021-07-07 20:26:40.618839464 +0200 |
89 |
+@@ -16,7 +16,9 @@ |
90 |
+ #include "account.h" |
91 |
+ #include "configfile.h" |
92 |
+ #include "theme.h" |
93 |
++#ifdef WITH_WEBENGINE |
94 |
+ #include "wizard/webview.h" |
95 |
++#endif // WITH_WEBENGINE |
96 |
+ #include "webflowcredentialsdialog.h" |
97 |
+ |
98 |
+ using namespace QKeychain; |
99 |
+@@ -144,8 +146,12 @@ |
100 |
+ // Do a DetermineAuthTypeJob to make sure that the server is still using Flow2 |
101 |
+ auto job = new DetermineAuthTypeJob(_account->sharedFromThis(), this); |
102 |
+ connect(job, &DetermineAuthTypeJob::authType, [this](DetermineAuthTypeJob::AuthType type) { |
103 |
+- // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic |
104 |
++ // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic |
105 |
++#ifdef WITH_WEBENGINE |
106 |
+ bool useFlow2 = (type != DetermineAuthTypeJob::WebViewFlow); |
107 |
++#else // WITH_WEBENGINE |
108 |
++ bool useFlow2 = true; |
109 |
++#endif // WITH_WEBENGINE |
110 |
+ |
111 |
+ _askDialog = new WebFlowCredentialsDialog(_account, useFlow2); |
112 |
+ |
113 |
+diff -Naur desktop-3.2.3.orig/src/gui/creds/webflowcredentialsdialog.cpp desktop-3.2.3/src/gui/creds/webflowcredentialsdialog.cpp |
114 |
+--- desktop-3.2.3.orig/src/gui/creds/webflowcredentialsdialog.cpp 2021-06-24 12:04:33.000000000 +0200 |
115 |
++++ desktop-3.2.3/src/gui/creds/webflowcredentialsdialog.cpp 2021-07-07 20:26:40.618839464 +0200 |
116 |
+@@ -8,16 +8,20 @@ |
117 |
+ #include "owncloudgui.h" |
118 |
+ #include "headerbanner.h" |
119 |
+ #include "wizard/owncloudwizardcommon.h" |
120 |
++#ifdef WITH_WEBENGINE |
121 |
+ #include "wizard/webview.h" |
122 |
++#endif // WITH_WEBENGINE |
123 |
+ #include "wizard/flow2authwidget.h" |
124 |
+ |
125 |
+ namespace OCC { |
126 |
+ |
127 |
+ WebFlowCredentialsDialog::WebFlowCredentialsDialog(Account *account, bool useFlow2, QWidget *parent) |
128 |
+- : QDialog(parent), |
129 |
+- _useFlow2(useFlow2), |
130 |
+- _flow2AuthWidget(nullptr), |
131 |
+- _webView(nullptr) |
132 |
++ : QDialog(parent) |
133 |
++ , _useFlow2(useFlow2) |
134 |
++ , _flow2AuthWidget(nullptr) |
135 |
++#ifdef WITH_WEBENGINE |
136 |
++ , _webView(nullptr) |
137 |
++#endif // WITH_WEBENGINE |
138 |
+ { |
139 |
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); |
140 |
+ |
141 |
+@@ -49,10 +53,12 @@ |
142 |
+ |
143 |
+ _flow2AuthWidget->startAuth(account); |
144 |
+ } else { |
145 |
++#ifdef WITH_WEBENGINE |
146 |
+ _webView = new WebView(); |
147 |
+ _containerLayout->addWidget(_webView); |
148 |
+ |
149 |
+ connect(_webView, &WebView::urlCatched, this, &WebFlowCredentialsDialog::urlCatched); |
150 |
++#endif // WITH_WEBENGINE |
151 |
+ } |
152 |
+ |
153 |
+ auto app = static_cast<Application *>(qApp); |
154 |
+@@ -73,12 +79,14 @@ |
155 |
+ void WebFlowCredentialsDialog::closeEvent(QCloseEvent* e) { |
156 |
+ Q_UNUSED(e) |
157 |
+ |
158 |
++#ifdef WITH_WEBENGINE |
159 |
+ if (_webView) { |
160 |
+ // Force calling WebView::~WebView() earlier so that _profile and _page are |
161 |
+ // deleted in the correct order. |
162 |
+ _webView->deleteLater(); |
163 |
+ _webView = nullptr; |
164 |
+ } |
165 |
++#endif // WITH_WEBENGINE |
166 |
+ |
167 |
+ if (_flow2AuthWidget) { |
168 |
+ _flow2AuthWidget->resetAuth(); |
169 |
+@@ -89,9 +97,14 @@ |
170 |
+ emit onClose(); |
171 |
+ } |
172 |
+ |
173 |
+-void WebFlowCredentialsDialog::setUrl(const QUrl &url) { |
174 |
++void WebFlowCredentialsDialog::setUrl(const QUrl &url) |
175 |
++{ |
176 |
++#ifdef WITH_WEBENGINE |
177 |
+ if (_webView) |
178 |
+ _webView->setUrl(url); |
179 |
++#else // WITH_WEBENGINE |
180 |
++ Q_UNUSED(url); |
181 |
++#endif // WITH_WEBENGINE |
182 |
+ } |
183 |
+ |
184 |
+ void WebFlowCredentialsDialog::setInfo(const QString &msg) { |
185 |
+diff -Naur desktop-3.2.3.orig/src/gui/creds/webflowcredentialsdialog.h desktop-3.2.3/src/gui/creds/webflowcredentialsdialog.h |
186 |
+--- desktop-3.2.3.orig/src/gui/creds/webflowcredentialsdialog.h 2021-06-24 12:04:33.000000000 +0200 |
187 |
++++ desktop-3.2.3/src/gui/creds/webflowcredentialsdialog.h 2021-07-07 20:26:40.618839464 +0200 |
188 |
+@@ -13,7 +13,9 @@ |
189 |
+ namespace OCC { |
190 |
+ |
191 |
+ class HeaderBanner; |
192 |
++#ifdef WITH_WEBENGINE |
193 |
+ class WebView; |
194 |
++#endif // WITH_WEBENGINE |
195 |
+ class Flow2AuthWidget; |
196 |
+ |
197 |
+ class WebFlowCredentialsDialog : public QDialog |
198 |
+@@ -50,7 +52,9 @@ |
199 |
+ bool _useFlow2; |
200 |
+ |
201 |
+ Flow2AuthWidget *_flow2AuthWidget; |
202 |
++#ifdef WITH_WEBENGINE |
203 |
+ WebView *_webView; |
204 |
++#endif // WITH_WEBENGINE |
205 |
+ |
206 |
+ QLabel *_errorLabel; |
207 |
+ QLabel *_infoLabel; |
208 |
+diff -Naur desktop-3.2.3.orig/src/gui/wizard/owncloudsetuppage.cpp desktop-3.2.3/src/gui/wizard/owncloudsetuppage.cpp |
209 |
+--- desktop-3.2.3.orig/src/gui/wizard/owncloudsetuppage.cpp 2021-06-24 12:04:33.000000000 +0200 |
210 |
++++ desktop-3.2.3/src/gui/wizard/owncloudsetuppage.cpp 2021-07-07 20:26:40.619839465 +0200 |
211 |
+@@ -119,21 +119,6 @@ |
212 |
+ _ui.leUrl->setPalette(leUrlPalette); |
213 |
+ } |
214 |
+ |
215 |
+-#ifdef WITH_PROVIDERS |
216 |
+-void OwncloudSetupPage::slotLogin() |
217 |
+-{ |
218 |
+- _ocWizard->setRegistration(false); |
219 |
+-} |
220 |
+-void OwncloudSetupPage::slotGotoProviderList() |
221 |
+-{ |
222 |
+- _ocWizard->setRegistration(true); |
223 |
+- _ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::WebViewFlow); |
224 |
+- _authTypeKnown = true; |
225 |
+- _checking = false; |
226 |
+- emit completeChanged(); |
227 |
+-} |
228 |
+-#endif |
229 |
+- |
230 |
+ // slot hit from textChanged of the url entry field. |
231 |
+ void OwncloudSetupPage::slotUrlChanged(const QString &url) |
232 |
+ { |
233 |
+@@ -228,8 +213,10 @@ |
234 |
+ return WizardCommon::Page_OAuthCreds; |
235 |
+ case DetermineAuthTypeJob::LoginFlowV2: |
236 |
+ return WizardCommon::Page_Flow2AuthCreds; |
237 |
++#ifdef WITH_WEBENGINE |
238 |
+ case DetermineAuthTypeJob::WebViewFlow: |
239 |
+ return WizardCommon::Page_WebView; |
240 |
++#endif // WITH_WEBENGINE |
241 |
+ } |
242 |
+ return WizardCommon::Page_HttpCreds; |
243 |
+ } |
244 |
+diff -Naur desktop-3.2.3.orig/src/gui/wizard/owncloudsetuppage.h desktop-3.2.3/src/gui/wizard/owncloudsetuppage.h |
245 |
+--- desktop-3.2.3.orig/src/gui/wizard/owncloudsetuppage.h 2021-06-24 12:04:33.000000000 +0200 |
246 |
++++ desktop-3.2.3/src/gui/wizard/owncloudsetuppage.h 2021-07-07 20:26:40.617839462 +0200 |
247 |
+@@ -67,10 +67,6 @@ |
248 |
+ protected slots: |
249 |
+ void slotUrlChanged(const QString &); |
250 |
+ void slotUrlEditFinished(); |
251 |
+-#ifdef WITH_PROVIDERS |
252 |
+- void slotLogin(); |
253 |
+- void slotGotoProviderList(); |
254 |
+-#endif |
255 |
+ |
256 |
+ void setupCustomization(); |
257 |
+ |
258 |
+diff -Naur desktop-3.2.3.orig/src/gui/wizard/owncloudwizardcommon.h desktop-3.2.3/src/gui/wizard/owncloudwizardcommon.h |
259 |
+--- desktop-3.2.3.orig/src/gui/wizard/owncloudwizardcommon.h 2021-06-24 12:04:33.000000000 +0200 |
260 |
++++ desktop-3.2.3/src/gui/wizard/owncloudwizardcommon.h 2021-07-07 20:26:40.619839465 +0200 |
261 |
+@@ -46,7 +46,9 @@ |
262 |
+ Page_HttpCreds, |
263 |
+ Page_OAuthCreds, |
264 |
+ Page_Flow2AuthCreds, |
265 |
++#ifdef WITH_WEBENGINE |
266 |
+ Page_WebView, |
267 |
++#endif // WITH_WEBENGINE |
268 |
+ Page_AdvancedSetup, |
269 |
+ Page_Result |
270 |
+ }; |
271 |
+diff -Naur desktop-3.2.3.orig/src/gui/wizard/owncloudwizard.cpp desktop-3.2.3/src/gui/wizard/owncloudwizard.cpp |
272 |
+--- desktop-3.2.3.orig/src/gui/wizard/owncloudwizard.cpp 2021-06-24 12:04:33.000000000 +0200 |
273 |
++++ desktop-3.2.3/src/gui/wizard/owncloudwizard.cpp 2021-07-07 20:26:40.619839465 +0200 |
274 |
+@@ -54,7 +54,11 @@ |
275 |
+ , _flow2CredsPage(new Flow2AuthCredsPage) |
276 |
+ , _advancedSetupPage(new OwncloudAdvancedSetupPage(this)) |
277 |
+ , _resultPage(new OwncloudWizardResultPage) |
278 |
++#ifdef WITH_WEBENGINE |
279 |
+ , _webViewPage(new WebViewPage(this)) |
280 |
++#else // WITH_WEBENGINE |
281 |
++ , _webViewPage(nullptr) |
282 |
++#endif // WITH_WEBENGINE |
283 |
+ { |
284 |
+ setObjectName("owncloudWizard"); |
285 |
+ |
286 |
+@@ -66,7 +70,9 @@ |
287 |
+ setPage(WizardCommon::Page_Flow2AuthCreds, _flow2CredsPage); |
288 |
+ setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage); |
289 |
+ setPage(WizardCommon::Page_Result, _resultPage); |
290 |
++#ifdef WITH_WEBENGINE |
291 |
+ setPage(WizardCommon::Page_WebView, _webViewPage); |
292 |
++#endif // WITH_WEBENGINE |
293 |
+ |
294 |
+ connect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished); |
295 |
+ |
296 |
+@@ -78,7 +84,9 @@ |
297 |
+ connect(_httpCredsPage, &OwncloudHttpCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); |
298 |
+ connect(_browserCredsPage, &OwncloudOAuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); |
299 |
+ connect(_flow2CredsPage, &Flow2AuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); |
300 |
++#ifdef WITH_WEBENGINE |
301 |
+ connect(_webViewPage, &WebViewPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl); |
302 |
++#endif // WITH_WEBENGINE |
303 |
+ connect(_advancedSetupPage, &OwncloudAdvancedSetupPage::createLocalAndRemoteFolders, |
304 |
+ this, &OwncloudWizard::createLocalAndRemoteFolders); |
305 |
+ connect(this, &QWizard::customButtonClicked, this, &OwncloudWizard::skipFolderConfiguration); |
306 |
+@@ -230,9 +238,11 @@ |
307 |
+ _flow2CredsPage->setConnected(); |
308 |
+ break; |
309 |
+ |
310 |
++#ifdef WITH_WEBENGINE |
311 |
+ case WizardCommon::Page_WebView: |
312 |
+ _webViewPage->setConnected(); |
313 |
+ break; |
314 |
++#endif // WITH_WEBENGINE |
315 |
+ |
316 |
+ case WizardCommon::Page_AdvancedSetup: |
317 |
+ _advancedSetupPage->directoriesCreated(); |
318 |
+@@ -256,8 +266,10 @@ |
319 |
+ _credentialsPage = _browserCredsPage; |
320 |
+ } else if (type == DetermineAuthTypeJob::LoginFlowV2) { |
321 |
+ _credentialsPage = _flow2CredsPage; |
322 |
++#ifdef WITH_WEBENGINE |
323 |
+ } else if (type == DetermineAuthTypeJob::WebViewFlow) { |
324 |
+ _credentialsPage = _webViewPage; |
325 |
++#endif // WITH_WEBENGINE |
326 |
+ } else { // try Basic auth even for "Unknown" |
327 |
+ _credentialsPage = _httpCredsPage; |
328 |
+ } |
329 |
+@@ -281,7 +293,11 @@ |
330 |
+ button(QWizard::NextButton)->setHidden(true); |
331 |
+ // Need to set it from here, otherwise it has no effect |
332 |
+ _welcomePage->setLoginButtonDefault(); |
333 |
+- } else if (id == WizardCommon::Page_WebView || id == WizardCommon::Page_Flow2AuthCreds) { |
334 |
++ } else if ( |
335 |
++#ifdef WITH_WEBENGINE |
336 |
++ id == WizardCommon::Page_WebView || |
337 |
++#endif // WITH_WEBENGINE |
338 |
++ id == WizardCommon::Page_Flow2AuthCreds) { |
339 |
+ setButtonLayout({ QWizard::Stretch, QWizard::BackButton }); |
340 |
+ } else if (id == WizardCommon::Page_AdvancedSetup) { |
341 |
+ setButtonLayout({ QWizard::Stretch, QWizard::CustomButton1, QWizard::BackButton, QWizard::NextButton }); |
342 |
+diff -Naur desktop-3.2.3.orig/src/gui/wizard/owncloudwizard.h desktop-3.2.3/src/gui/wizard/owncloudwizard.h |
343 |
+--- desktop-3.2.3.orig/src/gui/wizard/owncloudwizard.h 2021-06-24 12:04:33.000000000 +0200 |
344 |
++++ desktop-3.2.3/src/gui/wizard/owncloudwizard.h 2021-07-07 20:26:40.619839465 +0200 |
345 |
+@@ -128,7 +128,7 @@ |
346 |
+ OwncloudAdvancedSetupPage *_advancedSetupPage; |
347 |
+ OwncloudWizardResultPage *_resultPage; |
348 |
+ AbstractCredentialsWizardPage *_credentialsPage = nullptr; |
349 |
+- WebViewPage *_webViewPage; |
350 |
++ WebViewPage *_webViewPage = nullptr; |
351 |
+ |
352 |
+ QStringList _setupLog; |
353 |
+ |
354 |
+diff -Naur desktop-3.2.3.orig/src/gui/wizard/welcomepage.cpp desktop-3.2.3/src/gui/wizard/welcomepage.cpp |
355 |
+--- desktop-3.2.3.orig/src/gui/wizard/welcomepage.cpp 2021-06-24 12:04:33.000000000 +0200 |
356 |
++++ desktop-3.2.3/src/gui/wizard/welcomepage.cpp 2021-07-07 20:26:40.620839467 +0200 |
357 |
+@@ -13,6 +13,7 @@ |
358 |
+ */ |
359 |
+ |
360 |
+ #include "welcomepage.h" |
361 |
++#include "guiutility.h" |
362 |
+ #include "theme.h" |
363 |
+ #include "wizard/owncloudwizard.h" |
364 |
+ #include "wizard/slideshow.h" |
365 |
+@@ -94,11 +95,18 @@ |
366 |
+ |
367 |
+ void WelcomePage::setupCreateAccountButton() |
368 |
+ { |
369 |
++#ifdef WITH_WEBENGINE |
370 |
+ connect(_ui->createAccountButton, &QPushButton::clicked, this, [this](bool /*checked*/) { |
371 |
+ _ocWizard->setRegistration(true); |
372 |
+ _nextPage = WizardCommon::Page_WebView; |
373 |
+ _ocWizard->next(); |
374 |
+ }); |
375 |
++#else // WITH_WEBENGINE |
376 |
++ connect(_ui->createAccountButton, &QPushButton::clicked, this, [this](bool /*checked*/) { |
377 |
++ _ocWizard->setRegistration(true); |
378 |
++ Utility::openBrowser(QStringLiteral("https://nextcloud.com/register")); |
379 |
++ }); |
380 |
++#endif // WITH_WEBENGINE |
381 |
+ } |
382 |
+ |
383 |
+ void WelcomePage::setupHostYourOwnServerLabel() |
384 |
+diff -Naur desktop-3.2.3.orig/src/libsync/networkjobs.cpp desktop-3.2.3/src/libsync/networkjobs.cpp |
385 |
+--- desktop-3.2.3.orig/src/libsync/networkjobs.cpp 2021-06-24 12:04:33.000000000 +0200 |
386 |
++++ desktop-3.2.3/src/libsync/networkjobs.cpp 2021-07-07 20:26:40.619839465 +0200 |
387 |
+@@ -30,6 +30,7 @@ |
388 |
+ #include <QCoreApplication> |
389 |
+ #include <QJsonDocument> |
390 |
+ #include <QJsonObject> |
391 |
++#include <qloggingcategory.h> |
392 |
+ #ifndef TOKEN_AUTH_ONLY |
393 |
+ #include <QPainter> |
394 |
+ #include <QPainterPath> |
395 |
+@@ -958,7 +959,11 @@ |
396 |
+ auto flow = gs.toObject().value("desktoplogin"); |
397 |
+ if (flow != QJsonValue::Undefined) { |
398 |
+ if (flow.toInt() == 1) { |
399 |
++#ifdef WITH_WEBENGINE |
400 |
+ _resultOldFlow = WebViewFlow; |
401 |
++#else // WITH_WEBENGINE |
402 |
++ qCWarning(lcDetermineAuthTypeJob) << "Server does only support flow1, but this client was compiled without support for flow1"; |
403 |
++#endif // WITH_WEBENGINE |
404 |
+ } |
405 |
+ } |
406 |
+ } |
407 |
+@@ -985,20 +990,24 @@ |
408 |
+ |
409 |
+ auto result = _resultPropfind; |
410 |
+ |
411 |
++#ifdef WITH_WEBENGINE |
412 |
+ // WebViewFlow > OAuth > Basic |
413 |
+ if (_account->serverVersionInt() >= Account::makeServerVersion(12, 0, 0)) { |
414 |
+ result = WebViewFlow; |
415 |
+ } |
416 |
++#endif // WITH_WEBENGINE |
417 |
+ |
418 |
+ // LoginFlowV2 > WebViewFlow > OAuth > Basic |
419 |
+ if (_account->serverVersionInt() >= Account::makeServerVersion(16, 0, 0)) { |
420 |
+ result = LoginFlowV2; |
421 |
+ } |
422 |
+ |
423 |
++#ifdef WITH_WEBENGINE |
424 |
+ // If we determined that we need the webview flow (GS for example) then we switch to that |
425 |
+ if (_resultOldFlow == WebViewFlow) { |
426 |
+ result = WebViewFlow; |
427 |
+ } |
428 |
++#endif // WITH_WEBENGINE |
429 |
+ |
430 |
+ // If we determined that a simple get gave us an authentication required error |
431 |
+ // then the server enforces basic auth and we got no choice but to use this |
432 |
+diff -Naur desktop-3.2.3.orig/src/libsync/networkjobs.h desktop-3.2.3/src/libsync/networkjobs.h |
433 |
+--- desktop-3.2.3.orig/src/libsync/networkjobs.h 2021-06-24 12:04:33.000000000 +0200 |
434 |
++++ desktop-3.2.3/src/libsync/networkjobs.h 2021-07-07 20:26:40.619839465 +0200 |
435 |
+@@ -444,9 +444,11 @@ |
436 |
+ public: |
437 |
+ enum AuthType { |
438 |
+ NoAuthType, // used only before we got a chance to probe the server |
439 |
++#ifdef WITH_WEBENGINE |
440 |
++ WebViewFlow, |
441 |
++#endif // WITH_WEBENGINE |
442 |
+ Basic, // also the catch-all fallback for backwards compatibility reasons |
443 |
+ OAuth, |
444 |
+- WebViewFlow, |
445 |
+ LoginFlowV2 |
446 |
+ }; |
447 |
+ Q_ENUM(AuthType) |
448 |
|
449 |
diff --git a/net-misc/nextcloud-client/metadata.xml b/net-misc/nextcloud-client/metadata.xml |
450 |
index ea54627aff8..588dc46f7e6 100644 |
451 |
--- a/net-misc/nextcloud-client/metadata.xml |
452 |
+++ b/net-misc/nextcloud-client/metadata.xml |
453 |
@@ -8,6 +8,7 @@ |
454 |
<use> |
455 |
<flag name="dolphin">Install the <pkg>kde-apps/dolphin</pkg> extension</flag> |
456 |
<flag name="nautilus">Install the <pkg>gnome-base/nautilus</pkg> extension</flag> |
457 |
+ <flag name="webengine">Enable old Flow1 login using <pkg>dev-qt/qtwebengine</pkg></flag> |
458 |
</use> |
459 |
<upstream> |
460 |
<remote-id type="github">nextcloud/desktop</remote-id> |
461 |
|
462 |
diff --git a/net-misc/nextcloud-client/nextcloud-client-3.2.3-r1.ebuild b/net-misc/nextcloud-client/nextcloud-client-3.2.3-r1.ebuild |
463 |
new file mode 100644 |
464 |
index 00000000000..f5a364e114c |
465 |
--- /dev/null |
466 |
+++ b/net-misc/nextcloud-client/nextcloud-client-3.2.3-r1.ebuild |
467 |
@@ -0,0 +1,94 @@ |
468 |
+# Copyright 1999-2021 Gentoo Authors |
469 |
+# Distributed under the terms of the GNU General Public License v2 |
470 |
+ |
471 |
+EAPI=7 |
472 |
+ |
473 |
+inherit cmake xdg |
474 |
+ |
475 |
+DESCRIPTION="Desktop Syncing Client for Nextcloud" |
476 |
+HOMEPAGE="https://github.com/nextcloud/desktop" |
477 |
+SRC_URI="https://github.com/nextcloud/desktop/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz" |
478 |
+ |
479 |
+LICENSE="CC-BY-3.0 GPL-2" |
480 |
+SLOT="0" |
481 |
+KEYWORDS="~amd64 ~arm64 ~x86" |
482 |
+IUSE="doc dolphin nautilus test webengine" |
483 |
+RESTRICT="!test? ( test )" |
484 |
+ |
485 |
+COMMON_DEPEND=">=dev-db/sqlite-3.34:3 |
486 |
+ >=dev-libs/openssl-1.1.0:0= |
487 |
+ dev-libs/qtkeychain[qt5(+)] |
488 |
+ dev-qt/qtcore:5 |
489 |
+ dev-qt/qtdbus:5 |
490 |
+ dev-qt/qtdeclarative:5 |
491 |
+ dev-qt/qtgui:5 |
492 |
+ dev-qt/qtnetwork:5[ssl] |
493 |
+ dev-qt/qtquickcontrols2:5 |
494 |
+ dev-qt/qtsvg:5 |
495 |
+ dev-qt/qtwebsockets:5 |
496 |
+ dev-qt/qtwidgets:5 |
497 |
+ sys-libs/zlib |
498 |
+ dolphin? ( |
499 |
+ kde-frameworks/kcoreaddons:5 |
500 |
+ kde-frameworks/kio:5 |
501 |
+ ) |
502 |
+ nautilus? ( dev-python/nautilus-python ) |
503 |
+ webengine? ( dev-qt/qtwebengine:5[widgets] )" |
504 |
+ |
505 |
+DEPEND="${COMMON_DEPEND} |
506 |
+ dev-qt/linguist-tools:5 |
507 |
+ dev-qt/qtconcurrent:5 |
508 |
+ dev-qt/qtxml:5 |
509 |
+ doc? ( |
510 |
+ dev-python/sphinx |
511 |
+ dev-tex/latexmk |
512 |
+ dev-texlive/texlive-latexextra |
513 |
+ virtual/latex-base |
514 |
+ ) |
515 |
+ dolphin? ( kde-frameworks/extra-cmake-modules ) |
516 |
+ test? ( |
517 |
+ dev-util/cmocka |
518 |
+ dev-qt/qttest:5 |
519 |
+ )" |
520 |
+ |
521 |
+RDEPEND="${COMMON_DEPEND}" |
522 |
+ |
523 |
+PATCHES=( "${FILESDIR}"/${P}-inkscape.patch |
524 |
+ "${FILESDIR}"/${P}-webengine.patch |
525 |
+ ) |
526 |
+ |
527 |
+S="${WORKDIR}/desktop-${PV/_/-}" |
528 |
+ |
529 |
+src_prepare() { |
530 |
+ # Keep tests in ${T} |
531 |
+ sed -i -e "s#\"/tmp#\"${T}#g" test/test*.cpp || die |
532 |
+ |
533 |
+ cmake_src_prepare |
534 |
+} |
535 |
+ |
536 |
+src_configure() { |
537 |
+ local mycmakeargs=( |
538 |
+ -DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc |
539 |
+ -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF} |
540 |
+ -DBUILD_UPDATER=OFF |
541 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_Libcloudproviders=ON |
542 |
+ $(cmake_use_find_package doc Sphinx) |
543 |
+ $(cmake_use_find_package doc PdfLatex) |
544 |
+ $(cmake_use_find_package webengine Qt5WebEngine) |
545 |
+ $(cmake_use_find_package webengine Qt5WebEngineWidgets) |
546 |
+ -DBUILD_SHELL_INTEGRATION_DOLPHIN=$(usex dolphin) |
547 |
+ -DBUILD_SHELL_INTEGRATION_NAUTILUS=$(usex nautilus) |
548 |
+ -DUNIT_TESTING=$(usex test) |
549 |
+ ) |
550 |
+ |
551 |
+ cmake_src_configure |
552 |
+} |
553 |
+ |
554 |
+pkg_postinst() { |
555 |
+ xdg_pkg_postinst |
556 |
+ |
557 |
+ if ! use doc ; then |
558 |
+ elog "Documentation and man pages not installed" |
559 |
+ elog "Enable doc USE-flag to generate them" |
560 |
+ fi |
561 |
+} |