add nextcloud client with netrc fix

https://github.com/nextcloud/desktop/pull/7698
This commit is contained in:
Fredrik Eriksson 2024-12-28 14:06:10 +01:00
parent e952dfceb4
commit 8367972879
Signed by: feffe
GPG Key ID: E6B5580B853D322B
6 changed files with 273 additions and 0 deletions

View File

@ -0,0 +1,7 @@
AUX nextcloud-client-3.14.2-doc-fix.patch 1253 BLAKE2B 8e0c44c5fdb02fc6d815c70a3fb8a9b28fe7d68e2d8b3a5a297a26c194a8866c39222df740cb1ecd70d7f615f491dea5f229b5bf9bf5ec3f7995d2f20254e518 SHA512 b9efc5723eb2f52ba7fc90325696fada2ddc88b47d47df576cfc74750a97b55bad77acda274983530f43c503ded8e4d7cc444005dd62b699926f46fdb2bd87aa
AUX nextcloud-client-3.15.2-netrc.patch 1769 BLAKE2B f1d0e790feead13940c62c20ec54414ff498b2abb1850af21f509476857b51111c2893db024c5af2b56711b5aa220d2179e8efbf6d24e0a28866113fabf9d7fd SHA512 fe738c200b610c7f881ffce0399ee5abc17fe284b95dcd78666961a50b9e4d67d0e9c57919c04a9b5b56005445bd41f581a355f59d7477131008d3c12f0d682d
AUX nextcloud-client-3.6.6-no-redefine-fortify-source.patch 1447 BLAKE2B 14a3a1a1206a0a0027aa9c59e07b6d81174428aaaf90fba5706e9c7a2f076753a4b2f364ffa0f22dabf785d58832dde1aeba61e3cb3cc92feffa8b4b614c5d65 SHA512 808c10f8ea1905d54f62f895b2089c2acb602e838143f6a4268a5ab1e966ffe6ff01f132b8b65e0eebde21435a859cc7fb4f868a2ca81da4dcaa02292a337ed7
DIST nextcloud-client-3.15.2-fix-macosvfs-file-sharing.png.patch 727 BLAKE2B 77d87c47caa28c0d60afdef161c05a365d953e31e7331fd4b07adfe232ddd04a6108ad325a25befe961862dccb118c251239b84cfb63f1c72c205df31055ad69 SHA512 d4d8928aa63b7e174c7fe8099d349a5779e8be1b1a71dfecfded9f971533ba677fc85013c53c7cafdc05e1aed81820c6ef3b5e7c3f6a5cae62fc284a2a9371db
DIST nextcloud-client-3.15.2.tar.gz 15671238 BLAKE2B ea98587f4183d42d3e6ace54c0cd8b2208e7e21bfbb2385af84c8688b2d5464171f90e287302c5d6081b234b8cbec4e2b05635d1385a2980f133bba7127a6203 SHA512 982b74d57954440496f973781aa6a719d316b3651fecbb5da4d4b211dda0574094b2ba35f83c6afe2e67c7be095528e0cf8544e9214e8d9db445f1ab95c8c256
EBUILD nextcloud-client-3.15.2-r1.ebuild 3205 BLAKE2B 8f42717f3f09eaf080f49082c39bc73064e085bf2a4fccb4c9d8fef7559b06698769736a4951b0ea162ba86b17d15378417e056104339f5ae57eb1abad3c505f SHA512 4aaa95ac4b9dd7f1715a962bb8d3f79a9f5f431550cd4f4d54c92d4722f518714034b6f15a9738e3624bc3620ab378c9001755215adcc971f02099a13719364a
MISC metadata.xml 712 BLAKE2B 423b16fa8879b0bc21d8ff1c692e5e592f571b5d69dcdd35fe79dae08b770c0d5beb2cbf71af2e7410d1dfd6917d15bac0482a84a40ce602ab03ab0f59940355 SHA512 2cfeff27549192c2aaa9c64369545e75b3a056c123d7647c96505dd410490230027401961e95ef88c93b0485393bd54aa11ddc922bcaf2782f9e68a2d8d17b32

View File

@ -0,0 +1,35 @@
From 463b4e63046a907581d5f4899aaddfa0afd9120a Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flo@geekplace.eu>
Date: Tue, 22 Oct 2024 12:18:31 +0200
Subject: [PATCH] doc: delete section containing non-existing images
Those images where deleted in 6d3335bd60ba ("Update instructions to
build on Windows.") and are no longer available. Hence, drop the
whole section referencing them.
Fixes: 6d3335bd60ba1cb499985fc15e0b918fe8c404f4
--- a/doc/building.rst
+++ b/doc/building.rst
@@ -215,19 +215,6 @@ System requirements
- Microsoft Visual Studio 2022 and tools to compile C++
- `KDE Craft <https://community.kde.org/Craft>`_
-Setting up Microsoft Visual Studio
-----------------------------------
-
-1. Click on 'Modify' in the Visual Studio Installer:
-
- .. image:: ./images/building/visual-studio-installer.png
- :alt: Visual Studio Installer
-
-2. Select 'Desktop development with C++'
-
- .. image:: ./images/building/desktop-development-with-cpp.png
- :alt: Desktop development with C++
-
Handling the dependencies
-------------------------
We handle the dependencies using `KDE Craft <https://community.kde.org/Craft>`_ because it is easy to set it up and it makes the maintenance much more reliable in all platforms.
--
2.45.2

View File

@ -0,0 +1,56 @@
diff --git a/src/cmd/netrcparser.cpp b/src/cmd/netrcparser.cpp
index 266fe4f..15417e1 100644
--- a/src/cmd/netrcparser.cpp
+++ b/src/cmd/netrcparser.cpp
@@ -14,8 +14,7 @@
#include <QDir>
#include <QFile>
-#include <QTextStream>
-#include <QStringTokenizer>
+#include <QRegularExpression>
#include <QDebug>
@@ -58,32 +57,33 @@ bool NetrcParser::parse()
}
QString content = netrc.readAll();
- auto tokenizer = QStringTokenizer{content, u" \n\t"};
+ auto tokens = content.split(QRegularExpression("\\s+"));
LoginPair pair;
QString machine;
bool isDefault = false;
- for(auto itToken = tokenizer.cbegin(); itToken != tokenizer.cend(); ++itToken) {
- const auto key = *itToken;
+ for(int i=0; i<tokens.count(); i++) {
+ const auto key = tokens[i];
if (key == defaultKeyword) {
tryAddEntryAndClear(machine, pair, isDefault);
isDefault = true;
continue; // don't read a value
}
- if (itToken != tokenizer.cend()) {
+ i++;
+ if (i > tokens.count()) {
qDebug() << "error fetching value for" << key;
return false;
}
- auto value = *(++itToken);
+ auto value = tokens[i];
if (key == machineKeyword) {
tryAddEntryAndClear(machine, pair, isDefault);
- machine = value.toString();
+ machine = value;
} else if (key == loginKeyword) {
- pair.first = value.toString();
+ pair.first = value;
} else if (key == passwordKeyword) {
- pair.second = value.toString();
+ pair.second = value;
} // ignore unsupported tokens
}
tryAddEntryAndClear(machine, pair, isDefault);

View File

@ -0,0 +1,31 @@
Gentoo's toolchain always sets F_S (level 2 at minimum) by default.
https://bugs.gentoo.org/890072
--- a/cmake/modules/DefineCompilerFlags.cmake
+++ b/cmake/modules/DefineCompilerFlags.cmake
@@ -47,12 +47,6 @@ if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
if (CMAKE_BUILD_TYPE)
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
- if (CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)" AND (NOT ${CMAKE_C_FLAGS} MATCHES "FORTIFY_SOURCE=[3-9]"))
- check_c_compiler_flag("-Wp,-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
- if (WITH_FORTIFY_SOURCE)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wp,-D_FORTIFY_SOURCE=2")
- endif (WITH_FORTIFY_SOURCE)
- endif()
endif()
endif (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,10 +31,6 @@ if(NOT MSVC)
endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
- if(CMAKE_BUILD_TYPE_LOWER MATCHES "(release|relwithdebinfo|minsizerel)" AND ((NOT ${CMAKE_C_FLAGS} MATCHES "FORTIFY_SOURCE=[3-9]") AND (NOT ${CMAKE_CXX_FLAGS} MATCHES "FORTIFY_SOURCE=[3-9]")))
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2")
- endif()
if (CMAKE_CXX_COMPILER MATCHES "Clang")
# Calling Qt's qCWarning(category, ...) with no params for "..." is a GNU

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>voyageur@gentoo.org</email>
<name>Bernard Cafarelli</name>
</maintainer>
<maintainer type="person">
<name>Florian Schmaus</name>
<email>flow@gentoo.org</email>
</maintainer>
<use>
<flag name="dolphin">Install the <pkg>kde-apps/dolphin</pkg> extension</flag>
<flag name="nautilus">Install the <pkg>gnome-base/nautilus</pkg> extension</flag>
<flag name="webengine">Enable old Flow1 login using <pkg>dev-qt/qtwebengine</pkg></flag>
</use>
<upstream>
<remote-id type="github">nextcloud/desktop</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,124 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake virtualx 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
https://github.com/nextcloud/desktop/commit/49a7c8d7874643da2550793877115c7f3dbd2d05.patch
-> ${PN}-3.15.2-fix-macosvfs-file-sharing.png.patch
"
S="${WORKDIR}/desktop-${PV/_/-}"
LICENSE="CC-BY-3.0 GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm64 ~ppc64 ~x86"
IUSE="doc dolphin nautilus test webengine"
RESTRICT="!test? ( test )"
RDEPEND="
>=dev-db/sqlite-3.34:3
dev-libs/glib:2
>=dev-libs/openssl-1.1.0:0=
>=dev-libs/qtkeychain-0.14.2:=[qt6(+)]
dev-qt/qt5compat:6
>=dev-qt/qtbase-6.6.0:6[dbus,gui,network,sql,sqlite,widgets]
dev-qt/qtdeclarative:6[widgets]
dev-qt/qtsvg:6
dev-qt/qtwebsockets:6
kde-frameworks/karchive:6
kde-frameworks/kguiaddons:6
net-libs/libcloudproviders
sys-libs/zlib
dolphin? (
kde-frameworks/kcoreaddons:6
kde-frameworks/kio:6
)
nautilus? ( dev-python/nautilus-python )
webengine? ( dev-qt/qtwebengine:6[widgets] )
"
DEPEND="
${RDEPEND}
dev-qt/qtbase:6[concurrent,xml]
|| (
gnome-base/librsvg
media-gfx/inkscape
)
doc? (
dev-python/sphinx
dev-tex/latexmk
dev-texlive/texlive-latexextra
virtual/latex-base
)
test? (
dev-util/cmocka
)
"
BDEPEND="
dev-qt/qttools:6[linguist]
dolphin? ( >=kde-frameworks/extra-cmake-modules-5.106.0 )
"
PATCHES=(
"${FILESDIR}"/${PN}-3.6.6-no-redefine-fortify-source.patch
# https://github.com/nextcloud/desktop/pull/7383
"${FILESDIR}"/${PN}-3.14.2-doc-fix.patch
# https://github.com/nextcloud/desktop/pull/7691
"${DISTDIR}"/${PN}-3.15.2-fix-macosvfs-file-sharing.png.patch
# https://github.com/nextcloud/desktop/pull/7698
"${FILESDIR}"/${PN}-3.15.2-netrc.patch
)
src_prepare() {
# Keep tests in ${T}
sed -i -e "s#\"/tmp#\"${T}#g" test/test*.cpp || die
# The image under images/building/path.png does no longer
# exist. This is already fixed upstream and can be dropped on the
# next bump
sed -i '/images\/building\/path.png/d' doc/building.rst || die
cmake_src_prepare
}
src_configure() {
local mycmakeargs=(
-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF}
-DBUILD_UPDATER=OFF
$(cmake_use_find_package doc Sphinx)
$(cmake_use_find_package doc PdfLatex)
-DBUILD_WITH_WEBENGINE=$(usex webengine)
-DBUILD_SHELL_INTEGRATION_DOLPHIN=$(usex dolphin)
-DBUILD_SHELL_INTEGRATION_NAUTILUS=$(usex nautilus)
-DBUILD_TESTING=$(usex test)
)
cmake_src_configure
}
src_test() {
TEST_VERBOSE=1 virtx cmake_src_test
}
src_compile() {
local compile_targets=(all)
if use doc; then
compile_targets+=(doc doc-man)
fi
cmake_src_compile ${compile_targets[@]}
}
pkg_postinst() {
xdg_pkg_postinst
if ! has_version -r "dev-libs/qtkeychain[keyring]"; then
elog "dev-libs/qtkeychain has not been build with the 'keyring' USE flag."
elog "Please consider enabling the 'keyring' USE flag. Otherwise you may"
elog "have to authenticate manually every time you start the nextlcoud client."
elog "See https://bugs.gentoo.org/912844 for more information."
fi
}