]> git.sthu.org Git - shuber-gentoo-overlay.git/commitdiff
Add nextcloud-client-3.1.1-r100 with webflow
authorStefan Huber <shuber@sthu.org>
Tue, 2 Feb 2021 09:22:22 +0000 (10:22 +0100)
committerStefan Huber <shuber@sthu.org>
Tue, 2 Feb 2021 09:38:55 +0000 (10:38 +0100)
net-misc/nextcloud-client/Manifest [new file with mode: 0644]
net-misc/nextcloud-client/files/v3.1.1-nowebengine.patch [new file with mode: 0644]
net-misc/nextcloud-client/nextcloud-client-3.1.1-r100.ebuild [new file with mode: 0644]

diff --git a/net-misc/nextcloud-client/Manifest b/net-misc/nextcloud-client/Manifest
new file mode 100644 (file)
index 0000000..78dea4f
--- /dev/null
@@ -0,0 +1,3 @@
+AUX v3.1.1-nowebengine.patch 12609 BLAKE2B 664286d25b3e20c0ab48782ee1a223f31317ac7d467a79c9ba0b659ce109aedca9f5eaa69ed5b29bd4f715e641988482321ca33e92c2a6c4663bf6b9b910fca4 SHA512 991ad479e96dafd3ec2df3309e36e9865a80478897c362f922d23b814dc2a818edd96411cee0af8699c00a7d325312c566ddb3ddcdc11a16edd18dc0d0e39c0f
+DIST nextcloud-client-3.1.1.tar.gz 19440799 BLAKE2B ae6ef7fbff4b7b5c9a5728a30558000cd781348dd07aba068af5b123ec629e1661b52cd63b50bf45c593411866bc607dfcc3112713fa2aea3eabfda7ce969614 SHA512 1f60266ff6d413a614261ae8b6c75ba6bc5cdb534f1906039b47cb7d593d12d72013d277dc12c0bfc5c5919322438543736a7cdff056949d80e093538fd04209
+EBUILD nextcloud-client-3.1.1-r100.ebuild 2173 BLAKE2B a9a3202fcb4d5a9b97a4cd95894ec4d27d3ae336afcc8e6acfe02e384db22d75a4238f31d7586fd15eececd2e7dcd51159bc3acee452ea4607409f378064a4f1 SHA512 fd68dd877086883741fbbd8af3aad8d6f551fe48f1de49804beeec9fb013d2b9168701b9434f64c5fab49ac1463add6620569eb9a419611875f29ff6e3743059
diff --git a/net-misc/nextcloud-client/files/v3.1.1-nowebengine.patch b/net-misc/nextcloud-client/files/v3.1.1-nowebengine.patch
new file mode 100644 (file)
index 0000000..31c9599
--- /dev/null
@@ -0,0 +1,342 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5df238838..4a333dbdd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -176,6 +176,13 @@ if(NO_SHIBBOLETH)
+    add_definitions(-DNO_SHIBBOLETH=1)
+ endif()
++# Disable webengine-based components
++option(NO_WEBENGINE "Build without webflow / flow2 support so QtWebEngine isn't required" OFF)
++if(NO_WEBENGINE)
++   message("Compiling without webengine")
++   add_definitions(-DNO_WEBENGINE=1)
++endif()
++
+ if(APPLE)
+   set( SOCKETAPI_TEAM_IDENTIFIER_PREFIX "" CACHE STRING "SocketApi prefix (including a following dot) that must match the codesign key's TeamIdentifier/Organizational Unit" )
+ endif()
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index a79edfcfb..c8ef114a4 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -4,7 +4,11 @@ endif()
+ set(synclib_NAME ${APPLICATION_EXECUTABLE}sync)
+-find_package(Qt5 5.12 COMPONENTS Core Network Xml Concurrent WebEngineWidgets WebEngine REQUIRED)
++find_package(Qt5 5.12 COMPONENTS Core Network Xml Concurrent REQUIRED)
++
++if(NOT NO_WEBENGINE)
++    find_package(Qt5 5.12 COMPONENTS WebEngineWidgets WebEngine REQUIRED)
++endif()
+ if(NOT TOKEN_AUTH_ONLY)
+     find_package(Qt5Keychain REQUIRED)
+diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
+index b6a666924..cd01e020c 100644
+--- a/src/gui/CMakeLists.txt
++++ b/src/gui/CMakeLists.txt
+@@ -119,23 +119,16 @@ set(client_SRCS
+     creds/credentialsfactory.cpp
+     creds/httpcredentialsgui.cpp
+     creds/oauth.cpp
+-    creds/flow2auth.cpp
+-    creds/webflowcredentials.cpp
+-    creds/webflowcredentialsdialog.cpp
+     wizard/postfixlineedit.cpp
+     wizard/abstractcredswizardpage.cpp
+     wizard/owncloudadvancedsetuppage.cpp
+     wizard/owncloudconnectionmethoddialog.cpp
+     wizard/owncloudhttpcredspage.cpp
+     wizard/owncloudoauthcredspage.cpp
+-    wizard/flow2authcredspage.cpp
+-    wizard/flow2authwidget.cpp
+     wizard/owncloudsetuppage.cpp
+     wizard/owncloudwizardcommon.cpp
+     wizard/owncloudwizard.cpp
+     wizard/owncloudwizardresultpage.cpp
+-    wizard/webviewpage.cpp
+-    wizard/webview.cpp
+     wizard/slideshow.cpp
+ )
+@@ -156,6 +149,18 @@ IF(BUILD_UPDATER)
+     )
+ endif()
++IF(NOT NO_WEBENGINE)
++    list(APPEND client_SRCS
++        creds/flow2auth.cpp
++        creds/webflowcredentials.cpp
++        creds/webflowcredentialsdialog.cpp
++        wizard/flow2authcredspage.cpp
++        wizard/flow2authwidget.cpp
++        wizard/webviewpage.cpp
++        wizard/webview.cpp
++    )
++endif()
++
+ IF( APPLE )
+     list(APPEND client_SRCS cocoainitializer_mac.mm)
+     list(APPEND client_SRCS socketapisocket_mac.mm)
+@@ -328,8 +333,11 @@ set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
+ set_target_properties( ${APPLICATION_EXECUTABLE} PROPERTIES
+         INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/${APPLICATION_EXECUTABLE};${CMAKE_INSTALL_RPATH}" )
+-target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::GuiPrivate Qt5::Svg Qt5::Network Qt5::Xml Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::WebEngineWidgets)
++target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::Widgets Qt5::GuiPrivate Qt5::Svg Qt5::Network Qt5::Xml Qt5::Qml Qt5::Quick Qt5::QuickControls2)
+ target_link_libraries( ${APPLICATION_EXECUTABLE} ${synclib_NAME} )
++IF(NOT NO_WEBENGINE)
++    target_link_libraries( ${APPLICATION_EXECUTABLE} Qt5::WebEngineWidgets )
++endif()
+ IF(BUILD_UPDATER)
+     target_link_libraries( ${APPLICATION_EXECUTABLE} updater )
+ endif()
+diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp
+index fa9da6237..83388ea57 100644
+--- a/src/gui/accountmanager.cpp
++++ b/src/gui/accountmanager.cpp
+@@ -253,6 +253,7 @@ AccountPtr AccountManager::loadAccountHelper(QSettings &settings)
+         acc->setUrl(urlConfig.toUrl());
+     }
++#ifndef NO_WEBENGINE
+     // Migrate to webflow
+     if (authType == QLatin1String("http")) {
+         authType = "webflow";
+@@ -266,6 +267,7 @@ AccountPtr AccountManager::loadAccountHelper(QSettings &settings)
+             settings.remove(key);
+         }
+     }
++#endif
+     qCInfo(lcAccountManager) << "Account for" << acc->url() << "using auth type" << authType;
+diff --git a/src/gui/creds/credentialsfactory.cpp b/src/gui/creds/credentialsfactory.cpp
+index 6062f70eb..723196d08 100644
+--- a/src/gui/creds/credentialsfactory.cpp
++++ b/src/gui/creds/credentialsfactory.cpp
+@@ -21,7 +21,9 @@
+ #ifndef NO_SHIBBOLETH
+ #include "creds/shibbolethcredentials.h"
+ #endif
++#ifndef NO_WEBENGINE
+ #include "creds/webflowcredentials.h"
++#endif
+ namespace OCC {
+@@ -40,8 +42,10 @@ namespace CredentialsFactory {
+         } else if (type == "shibboleth") {
+             return new ShibbolethCredentials;
+ #endif
++#ifndef NO_WEBENGINE
+         } else if (type == "webflow") {
+             return new WebFlowCredentials;
++#endif
+         } else {
+             qCWarning(lcGuiCredentials, "Unknown credentials type: %s", qPrintable(type));
+             return new DummyCredentials;
+diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp
+index 8f03fa124..56bbe8866 100644
+--- a/src/gui/wizard/owncloudsetuppage.cpp
++++ b/src/gui/wizard/owncloudsetuppage.cpp
+@@ -148,7 +148,11 @@ void OwncloudSetupPage::slotLogin()
+ void OwncloudSetupPage::slotGotoProviderList()
+ {
+     _ocWizard->setRegistration(true);
++#ifndef NO_WEBENGINE
+     _ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::WebViewFlow);
++#else
++    _ocWizard->setAuthType(DetermineAuthTypeJob::AuthType::Basic);
++#endif
+     _authTypeKnown = true;
+     _checking = false;
+     emit completeChanged();
+diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp
+index 912222dca..463c19d48 100644
+--- a/src/gui/wizard/owncloudwizard.cpp
++++ b/src/gui/wizard/owncloudwizard.cpp
+@@ -27,8 +27,10 @@
+ #endif
+ #include "wizard/owncloudadvancedsetuppage.h"
+ #include "wizard/owncloudwizardresultpage.h"
++#ifndef NO_WEBENGINE
+ #include "wizard/webviewpage.h"
+ #include "wizard/flow2authcredspage.h"
++#endif
+ #include "QProgressIndicator.h"
+@@ -50,22 +52,30 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
+ #ifndef NO_SHIBBOLETH
+     , _shibbolethCredsPage(new OwncloudShibbolethCredsPage)
+ #endif
++#ifndef NO_WEBENGINE
+     , _flow2CredsPage(new Flow2AuthCredsPage)
++#endif
+     , _advancedSetupPage(new OwncloudAdvancedSetupPage)
+     , _resultPage(new OwncloudWizardResultPage)
++#ifndef NO_WEBENGINE
+     , _webViewPage(new WebViewPage(this))
++#endif
+ {
+     setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+     setPage(WizardCommon::Page_ServerSetup, _setupPage);
+     setPage(WizardCommon::Page_HttpCreds, _httpCredsPage);
+     setPage(WizardCommon::Page_OAuthCreds, _browserCredsPage);
++#ifndef NO_WEBENGINE
+     setPage(WizardCommon::Page_Flow2AuthCreds, _flow2CredsPage);
++#endif
+ #ifndef NO_SHIBBOLETH
+     setPage(WizardCommon::Page_ShibbolethCreds, _shibbolethCredsPage);
+ #endif
+     setPage(WizardCommon::Page_AdvancedSetup, _advancedSetupPage);
+     setPage(WizardCommon::Page_Result, _resultPage);
++#ifndef NO_WEBENGINE
+     setPage(WizardCommon::Page_WebView, _webViewPage);
++#endif
+     connect(this, &QDialog::finished, this, &OwncloudWizard::basicSetupFinished);
+@@ -77,11 +87,15 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
+     connect(_setupPage, &OwncloudSetupPage::determineAuthType, this, &OwncloudWizard::determineAuthType);
+     connect(_httpCredsPage, &OwncloudHttpCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
+     connect(_browserCredsPage, &OwncloudOAuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
++#ifndef NO_WEBENGINE
+     connect(_flow2CredsPage, &Flow2AuthCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
++#endif
+ #ifndef NO_SHIBBOLETH
+     connect(_shibbolethCredsPage, &OwncloudShibbolethCredsPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
+ #endif
++#ifndef NO_WEBENGINE
+     connect(_webViewPage, &WebViewPage::connectToOCUrl, this, &OwncloudWizard::connectToOCUrl);
++#endif
+     connect(_advancedSetupPage, &OwncloudAdvancedSetupPage::createLocalAndRemoteFolders,
+         this, &OwncloudWizard::createLocalAndRemoteFolders);
+     connect(this, &QWizard::customButtonClicked, this, &OwncloudWizard::skipFolderConfiguration);
+@@ -103,12 +117,16 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)
+     // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching)
+     connect(this, &OwncloudWizard::styleChanged, _setupPage, &OwncloudSetupPage::slotStyleChanged);
+     connect(this, &OwncloudWizard::styleChanged, _advancedSetupPage, &OwncloudAdvancedSetupPage::slotStyleChanged);
++#ifndef NO_WEBENGINE
+     connect(this, &OwncloudWizard::styleChanged, _flow2CredsPage, &Flow2AuthCredsPage::slotStyleChanged);
++#endif
+     customizeStyle();
++#ifndef NO_WEBENGINE
+     // allow Flow2 page to poll on window activation
+     connect(this, &OwncloudWizard::onActivate, _flow2CredsPage, &Flow2AuthCredsPage::slotPollNow);
++#endif
+ }
+ void OwncloudWizard::setAccount(AccountPtr account)
+@@ -177,9 +195,11 @@ void OwncloudWizard::successfulStep()
+         _browserCredsPage->setConnected();
+         break;
++#ifndef NO_WEBENGINE
+     case WizardCommon::Page_Flow2AuthCreds:
+         _flow2CredsPage->setConnected();
+         break;
++#endif
+ #ifndef NO_SHIBBOLETH
+     case WizardCommon::Page_ShibbolethCreds:
+@@ -187,9 +207,11 @@ void OwncloudWizard::successfulStep()
+         break;
+ #endif
++#ifndef NO_WEBENGINE
+     case WizardCommon::Page_WebView:
+         _webViewPage->setConnected();
+         break;
++#endif
+     case WizardCommon::Page_AdvancedSetup:
+         _advancedSetupPage->directoriesCreated();
+@@ -214,10 +236,12 @@ void OwncloudWizard::setAuthType(DetermineAuthTypeJob::AuthType type)
+ #endif
+         if (type == DetermineAuthTypeJob::OAuth) {
+         _credentialsPage = _browserCredsPage;
++#ifndef NO_WEBENGINE
+     } else if (type == DetermineAuthTypeJob::LoginFlowV2) {
+         _credentialsPage = _flow2CredsPage;
+     } else if (type == DetermineAuthTypeJob::WebViewFlow) {
+         _credentialsPage = _webViewPage;
++#endif
+     } else { // try Basic auth even for "Unknown"
+         _credentialsPage = _httpCredsPage;
+     }
+@@ -242,7 +266,12 @@ void OwncloudWizard::slotCurrentPageChanged(int id)
+     }
+     setOption(QWizard::HaveCustomButton1, id == WizardCommon::Page_AdvancedSetup);
+-    if (id == WizardCommon::Page_AdvancedSetup && (_credentialsPage == _browserCredsPage || _credentialsPage == _flow2CredsPage)) {
++    if (id == WizardCommon::Page_AdvancedSetup
++           && (_credentialsPage == _browserCredsPage
++#ifndef NO_WEBENGINE
++           || _credentialsPage == _flow2CredsPage
++#endif
++           )) {
+         // For OAuth, disable the back button in the Page_AdvancedSetup because we don't want
+         // to re-open the browser.
+         button(QWizard::BackButton)->setEnabled(false);
+diff --git a/src/gui/wizard/owncloudwizard.h b/src/gui/wizard/owncloudwizard.h
+index ee6161ca5..c0ee06403 100644
+--- a/src/gui/wizard/owncloudwizard.h
++++ b/src/gui/wizard/owncloudwizard.h
+@@ -39,8 +39,10 @@ class OwncloudAdvancedSetupPage;
+ class OwncloudWizardResultPage;
+ class AbstractCredentials;
+ class AbstractCredentialsWizardPage;
++#ifndef NO_WEBENGINE
+ class WebViewPage;
+ class Flow2AuthCredsPage;
++#endif
+ /**
+  * @brief The OwncloudWizard class
+@@ -114,11 +116,15 @@ private:
+ #ifndef NO_SHIBBOLETH
+     OwncloudShibbolethCredsPage *_shibbolethCredsPage;
+ #endif
++#ifndef NO_WEBENGINE
+     Flow2AuthCredsPage *_flow2CredsPage;
++#endif
+     OwncloudAdvancedSetupPage *_advancedSetupPage;
+     OwncloudWizardResultPage *_resultPage;
+     AbstractCredentialsWizardPage *_credentialsPage = nullptr;
++#ifndef NO_WEBENGINE
+     WebViewPage *_webViewPage;
++#endif
+     QStringList _setupLog;
+diff --git a/src/libsync/networkjobs.cpp b/src/libsync/networkjobs.cpp
+index fc8464558..dbf625e38 100644
+--- a/src/libsync/networkjobs.cpp
++++ b/src/libsync/networkjobs.cpp
+@@ -963,12 +963,20 @@ void DetermineAuthTypeJob::checkAllDone()
+     // WebViewFlow > OAuth > Shib > Basic
+     if (_account->serverVersionInt() >= Account::makeServerVersion(12, 0, 0)) {
++#ifndef NO_WEBENGINE
+         result = WebViewFlow;
++#else
++        result = Basic;
++#endif
+     }
+     // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic
+     if (_account->serverVersionInt() >= Account::makeServerVersion(16, 0, 0)) {
++#ifndef NO_WEBENGINE
+         result = LoginFlowV2;
++#else
++        result = Basic;
++#endif
+     }
+     // If we determined that we need the webview flow (GS for example) then we switch to that
diff --git a/net-misc/nextcloud-client/nextcloud-client-3.1.1-r100.ebuild b/net-misc/nextcloud-client/nextcloud-client-3.1.1-r100.ebuild
new file mode 100644 (file)
index 0000000..ecdf831
--- /dev/null
@@ -0,0 +1,95 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake xdg
+
+DESCRIPTION="Desktop Syncing Client for Nextcloud"
+HOMEPAGE="https://github.com/nextcloud/desktop"
+SRC_URI="https://github.com/nextcloud/desktop/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="CC-BY-3.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="doc dolphin libressl nautilus test +webflow"
+
+COMMON_DEPEND=">=dev-db/sqlite-3.4:3
+       dev-libs/qtkeychain[gnome-keyring,qt5(+)]
+       dev-qt/qtconcurrent:5
+       dev-qt/qtcore:5
+       dev-qt/qtdbus:5
+       dev-qt/qtdeclarative:5
+       dev-qt/qtgui:5
+       dev-qt/qtnetwork:5[ssl]
+       dev-qt/qtquickcontrols2:5
+       dev-qt/qtsql:5
+       dev-qt/qtsvg:5
+       dev-qt/qtwidgets:5
+       dev-qt/qtxml:5
+       sys-fs/inotify-tools
+       dolphin? (
+               kde-frameworks/kcoreaddons:5
+               kde-frameworks/kio:5
+       )
+       !libressl? ( >=dev-libs/openssl-1.1.0:0= )
+       libressl? ( >=dev-libs/libressl-3.1:0= )
+       nautilus? ( dev-python/nautilus-python )
+       webflow? ( dev-qt/qtwebengine:5[widgets] )"
+
+RDEPEND="${COMMON_DEPEND}"
+DEPEND="${COMMON_DEPEND}
+       dev-qt/linguist-tools:5
+       doc? (
+               dev-python/sphinx
+               dev-tex/latexmk
+               dev-texlive/texlive-latexextra
+               virtual/latex-base
+       )
+       dolphin? ( kde-frameworks/extra-cmake-modules )
+       test? (
+               dev-util/cmocka
+               dev-qt/qttest:5
+       )"
+
+RESTRICT="!test? ( test )"
+
+S=${WORKDIR}/desktop-${PV/_/-}
+
+src_prepare() {
+       # Keep tests in ${T}
+       sed -i -e "s#\"/tmp#\"${T}#g" test/test*.cpp || die
+
+       if ! use webflow; then
+               eapply "${FILESDIR}/v3.1.1-nowebengine.patch"
+       fi
+
+       if ! use nautilus; then
+               pushd shell_integration > /dev/null || die
+               cmake_comment_add_subdirectory nautilus
+               popd > /dev/null || die
+       fi
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc
+               -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF}
+               -DCMAKE_DISABLE_FIND_PACKAGE_Sphinx=$(usex !doc)
+               -DCMAKE_DISABLE_FIND_PACKAGE_KF5=$(usex !dolphin)
+               -DNO_WEBENGINE=$(usex !webflow)
+               -DNO_SHIBBOLETH=yes
+               -DUNIT_TESTING=$(usex test)
+       )
+
+       cmake_src_configure
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+       if ! use doc ; then
+               elog "Documentation and man pages not installed"
+               elog "Enable doc USE-flag to generate them"
+       fi
+}