commit:     e43c26c2c1fcb27bb345e6eae13e02b8efba28e5
Author:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 21 20:40:19 2022 +0000
Commit:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
CommitDate: Thu Jul 21 20:51:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e43c26c2

net-misc/owncloud-client: fix compilation with gcc 12

Closes: https://bugs.gentoo.org/843398
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org>

 .../files/owncloud-client-2.10.1.7389-gcc12.patch  | 93 ++++++++++++++++++++++
 .../owncloud-client-2.10.1.7389.ebuild             |  2 +
 2 files changed, 95 insertions(+)

diff --git 
a/net-misc/owncloud-client/files/owncloud-client-2.10.1.7389-gcc12.patch 
b/net-misc/owncloud-client/files/owncloud-client-2.10.1.7389-gcc12.patch
new file mode 100644
index 000000000000..31981415f887
--- /dev/null
+++ b/net-misc/owncloud-client/files/owncloud-client-2.10.1.7389-gcc12.patch
@@ -0,0 +1,93 @@
+From c1e3bb8457d77619a1c31217716789e76fd06500 Mon Sep 17 00:00:00 2001
+From: Hannah von Reth <[email protected]>
+Date: Fri, 20 May 2022 11:19:59 +0200
+Subject: [PATCH] Fix build with gcc12
+
+---
+ src/common/asserts.h |  2 +-
+ src/common/vfs.h     | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/common/asserts.h b/src/common/asserts.h
+index 9f43c532a6d..5fa4b4da3e5 100644
+--- a/src/common/asserts.h
++++ b/src/common/asserts.h
+@@ -44,7 +44,7 @@
+     } else {                                                                  
                                              \
+     }
+ 
+-inline OC_REQUIRED_RESULT bool __OC_ENSURE(bool condition, const char *cond, 
const char *file, int line, const char *info)
++OC_REQUIRED_RESULT inline bool __OC_ENSURE(bool condition, const char *cond, 
const char *file, int line, const char *info)
+ {
+     if (Q_UNLIKELY(!condition)) {
+         OC_ASSERT_MSG("ENSURE: \"%s\" in file %s, line %d %s", cond, file, 
line, info);
+diff --git a/src/common/vfs.h b/src/common/vfs.h
+index 983c999106c..da04d7ed97d 100644
+--- a/src/common/vfs.h
++++ b/src/common/vfs.h
+@@ -162,17 +162,17 @@ class OCSYNC_EXPORT Vfs : public QObject
+     virtual bool isHydrating() const = 0;
+ 
+     /// Create a new dehydrated placeholder. Called from PropagateDownload.
+-    virtual OC_REQUIRED_RESULT Result<void, QString> createPlaceholder(const 
SyncFileItem &item) = 0;
++    OC_REQUIRED_RESULT virtual Result<void, QString> createPlaceholder(const 
SyncFileItem &item) = 0;
+ 
+     /** Discovery hook: even unchanged files may need UPDATE_METADATA.
+      *
+      * For instance cfapi vfs wants local hydrated non-placeholder files to
+      * become hydrated placeholder files.
+      */
+-    virtual OC_REQUIRED_RESULT bool needsMetadataUpdate(const SyncFileItem 
&item) = 0;
++    OC_REQUIRED_RESULT virtual bool needsMetadataUpdate(const SyncFileItem 
&item) = 0;
+ 
+     /// Determine whether the file at the given absolute path is a dehydrated 
placeholder.
+-    virtual OC_REQUIRED_RESULT bool isDehydratedPlaceholder(const QString 
&filePath) = 0;
++    OC_REQUIRED_RESULT virtual bool isDehydratedPlaceholder(const QString 
&filePath) = 0;
+ 
+     /** Similar to isDehydratedPlaceholder() but used from sync discovery.
+      *
+@@ -181,7 +181,7 @@ class OCSYNC_EXPORT Vfs : public QObject
+      *
+      * Returning true means that type was fully determined.
+      */
+-    virtual OC_REQUIRED_RESULT bool statTypeVirtualFile(csync_file_stat_t 
*stat, void *stat_data) = 0;
++    OC_REQUIRED_RESULT virtual bool statTypeVirtualFile(csync_file_stat_t 
*stat, void *stat_data) = 0;
+ 
+     /** Sets the pin state for the item at a path.
+      *
+@@ -192,7 +192,7 @@ class OCSYNC_EXPORT Vfs : public QObject
+      *
+      * relFilePath is relative to the sync folder. Can be "" for root folder.
+      */
+-    virtual OC_REQUIRED_RESULT bool setPinState(const QString &relFilePath, 
PinState state) = 0;
++    OC_REQUIRED_RESULT virtual bool setPinState(const QString &relFilePath, 
PinState state) = 0;
+ 
+     /** Returns the pin state of an item at a path.
+      *
+@@ -203,7 +203,7 @@ class OCSYNC_EXPORT Vfs : public QObject
+      *
+      * Returns none on retrieval error.
+      */
+-    virtual OC_REQUIRED_RESULT Optional<PinState> pinState(const QString 
&relFilePath) = 0;
++    OC_REQUIRED_RESULT virtual Optional<PinState> pinState(const QString 
&relFilePath) = 0;
+ 
+     /** Returns availability status of an item at a path.
+      *
+@@ -212,7 +212,7 @@ class OCSYNC_EXPORT Vfs : public QObject
+      *
+      * folderPath is relative to the sync folder. Can be "" for root folder.
+      */
+-    virtual OC_REQUIRED_RESULT AvailabilityResult availability(const QString 
&folderPath) = 0;
++    OC_REQUIRED_RESULT virtual AvailabilityResult availability(const QString 
&folderPath) = 0;
+ 
+ public slots:
+     /** Update in-sync state based on SyncFileStatusTracker signal.
+@@ -240,7 +240,7 @@ public slots:
+      * If the remote metadata changes, the local placeholder's metadata 
should possibly
+      * change as well.
+      */
+-    virtual OC_REQUIRED_RESULT Result<ConvertToPlaceholderResult, QString> 
updateMetadata(const SyncFileItem &item, const QString &filePath, const QString 
&replacesFile) = 0;
++    OC_REQUIRED_RESULT virtual Result<ConvertToPlaceholderResult, QString> 
updateMetadata(const SyncFileItem &item, const QString &filePath, const QString 
&replacesFile) = 0;
+ 
+     /** Setup the plugin for the folder.
+      *

diff --git a/net-misc/owncloud-client/owncloud-client-2.10.1.7389.ebuild 
b/net-misc/owncloud-client/owncloud-client-2.10.1.7389.ebuild
index e75c66fabf69..cff04f395855 100644
--- a/net-misc/owncloud-client/owncloud-client-2.10.1.7389.ebuild
+++ b/net-misc/owncloud-client/owncloud-client-2.10.1.7389.ebuild
@@ -45,6 +45,8 @@ RESTRICT="!test? ( test )"
 
 S=${WORKDIR}/${MY_PN}-${PV}
 
+PATCHES=( "${FILESDIR}"/${P}-gcc12.patch )
+
 src_prepare() {
        # Keep tests in ${T}
        sed -i -e "s#\"/tmp#\"${T}#g" test/test*.cpp || die

Reply via email to