public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: kde-apps/akonadi/files/, kde-apps/akonadi/
@ 2019-04-03 12:02 Andreas Sturmlechner
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Sturmlechner @ 2019-04-03 12:02 UTC (permalink / raw
  To: gentoo-commits

commit:     3ea5b36d1fa41f02a87828cd8e674110dee3f18c
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  3 10:30:34 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Apr  3 12:02:32 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ea5b36d

kde-apps/akonadi: Fix a regression when updating attributes

Major regression forcing mail to be re-downloaded all the time at every mail
check, hogging the akonadi server and leading to deadlocks and other issues.

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 kde-apps/akonadi/akonadi-18.12.3-r1.ebuild         | 117 +++++++++++++++++++++
 ...lection-detach-at-wrong-time-in-attribute.patch |  97 +++++++++++++++++
 ...12.3-major-regression-updating-attributes.patch |  55 ++++++++++
 3 files changed, 269 insertions(+)

diff --git a/kde-apps/akonadi/akonadi-18.12.3-r1.ebuild b/kde-apps/akonadi/akonadi-18.12.3-r1.ebuild
new file mode 100644
index 00000000000..8b3713c95d8
--- /dev/null
+++ b/kde-apps/akonadi/akonadi-18.12.3-r1.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+KDE_DESIGNERPLUGIN="true"
+KDE_TEST="forceoptional"
+VIRTUALDBUS_TEST="true"
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="Storage service for PIM data and libraries for PIM apps"
+HOMEPAGE="https://community.kde.org/KDE_PIM/akonadi"
+
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+LICENSE="LGPL-2.1+"
+IUSE="+mysql postgres sqlite tools xml"
+
+REQUIRED_USE="|| ( mysql postgres sqlite ) test? ( tools )"
+
+COMMON_DEPEND="
+	$(add_frameworks_dep kcompletion)
+	$(add_frameworks_dep kconfig)
+	$(add_frameworks_dep kconfigwidgets)
+	$(add_frameworks_dep kcoreaddons)
+	$(add_frameworks_dep kcrash)
+	$(add_frameworks_dep kdbusaddons)
+	$(add_frameworks_dep ki18n)
+	$(add_frameworks_dep kiconthemes)
+	$(add_frameworks_dep kio)
+	$(add_frameworks_dep kitemmodels)
+	$(add_frameworks_dep kitemviews)
+	$(add_frameworks_dep kwidgetsaddons)
+	$(add_frameworks_dep kwindowsystem)
+	$(add_frameworks_dep kxmlgui)
+	$(add_qt_dep qtdbus)
+	$(add_qt_dep qtgui)
+	$(add_qt_dep qtnetwork)
+	$(add_qt_dep qtsql 'mysql?,postgres?')
+	$(add_qt_dep qtwidgets)
+	$(add_qt_dep qtxml)
+	sqlite? (
+		$(add_qt_dep qtsql 'sqlite' '' '5=')
+		dev-db/sqlite:3
+	)
+	xml? ( dev-libs/libxml2 )
+"
+DEPEND="${COMMON_DEPEND}
+	dev-libs/boost
+	dev-libs/libxslt
+	test? ( sys-apps/dbus )
+"
+RDEPEND="${COMMON_DEPEND}
+	!kde-apps/akonadi:4
+	!<kde-apps/kapptemplate-17.11.80
+	!kde-apps/kdepim-l10n
+	!kde-apps/kdepimlibs
+	mysql? ( virtual/mysql )
+	postgres? ( dev-db/postgresql )
+"
+
+# some akonadi tests time out, that probably needs more work as it's ~700 tests
+RESTRICT+=" test"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-18.12.2-mysql56-crash.patch"
+	"${FILESDIR}/${P}-major-regression-updating-attributes.patch"
+	"${FILESDIR}/${P}-collection-detach-at-wrong-time-in-attribute.patch"
+)
+
+pkg_setup() {
+	# Set default storage backend in order: MySQL, PostgreSQL, SQLite
+	# reverse driver check to keep the order
+	use sqlite && DRIVER="QSQLITE3"
+	use postgres && DRIVER="QPSQL"
+	use mysql && DRIVER="QMYSQL"
+
+	if use sqlite || has_version "<${CATEGORY}/${P}[sqlite]"; then
+		ewarn "We strongly recommend you change your Akonadi database backend to either MySQL"
+		ewarn "or PostgreSQL in your user configuration."
+		ewarn "In particular, kde-apps/kmail does not work properly with the sqlite backend."
+	fi
+
+	kde5_pkg_setup
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DAKONADI_BUILD_QSQLITE=$(usex sqlite)
+		-DBUILD_TOOLS=$(usex tools)
+		$(cmake-utils_use_find_package xml LibXml2)
+	)
+
+	kde5_src_configure
+}
+
+src_install() {
+	# Who knows, maybe it accidentally fixes our permission issues
+	cat <<-EOF > "${T}"/akonadiserverrc
+[%General]
+Driver=${DRIVER}
+EOF
+	insinto /usr/share/config/akonadi
+	doins "${T}"/akonadiserverrc
+
+	kde5_src_install
+}
+
+pkg_postinst() {
+	kde5_pkg_postinst
+	elog "You can select the storage backend in ~/.config/akonadi/akonadiserverrc."
+	elog "Available drivers are:"
+	use mysql && elog "  QMYSQL"
+	use postgres && elog "  QPSQL"
+	use sqlite && elog "  QSQLITE3"
+	elog "${DRIVER} has been set as your default akonadi storage backend."
+}

diff --git a/kde-apps/akonadi/files/akonadi-18.12.3-collection-detach-at-wrong-time-in-attribute.patch b/kde-apps/akonadi/files/akonadi-18.12.3-collection-detach-at-wrong-time-in-attribute.patch
new file mode 100644
index 00000000000..bee866dc3bc
--- /dev/null
+++ b/kde-apps/akonadi/files/akonadi-18.12.3-collection-detach-at-wrong-time-in-attribute.patch
@@ -0,0 +1,97 @@
+From 53ad3b6d73d92ea289cf0183c10e2b8a35c8127a Mon Sep 17 00:00:00 2001
+From: David Faure <faure@kde.org>
+Date: Thu, 21 Mar 2019 23:37:36 +0100
+Subject: Fix collection detaching at the wrong time in attribute()
+
+Summary:
+Found in FatCRM where changes to collection attributes were not stored
+anymore.
+
+Test Plan:
+New unittest to ensure that we get the attribute from the
+detached collection, not from the original one.
+
+Reviewers: dvratil
+
+Reviewed By: dvratil
+
+Subscribers: kde-pim
+
+Tags: #kde_pim
+
+Differential Revision: https://phabricator.kde.org/D19741
+---
+ autotests/libs/collectionattributetest.cpp | 15 +++++++++++++++
+ autotests/libs/collectionattributetest.h   |  1 +
+ src/core/collection.h                      |  8 ++------
+ 3 files changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/autotests/libs/collectionattributetest.cpp b/autotests/libs/collectionattributetest.cpp
+index e264a37..9c46561 100644
+--- a/autotests/libs/collectionattributetest.cpp
++++ b/autotests/libs/collectionattributetest.cpp
+@@ -240,3 +240,18 @@ void CollectionAttributeTest::testCollectionIdentificationAttribute()
+     QCOMPARE(parsed.identifier(), id);
+     QCOMPARE(parsed.collectionNamespace(), ns);
+ }
++
++void CollectionAttributeTest::testDetach()
++{
++    // GIVEN a collection with an attribute
++    Collection col;
++    col.attribute<TestAttribute>(Akonadi::Collection::AddIfMissing);
++    Collection col2 = col; // and a copy, so that non-const access detaches
++
++    // WHEN
++    TestAttribute *attr = col2.attribute<TestAttribute>(Akonadi::Collection::AddIfMissing);
++    TestAttribute *attr2 = col2.attribute<TestAttribute>();
++
++    // THEN
++    QCOMPARE(attr, attr2);
++}
+diff --git a/autotests/libs/collectionattributetest.h b/autotests/libs/collectionattributetest.h
+index 420df78..2afa9eb 100644
+--- a/autotests/libs/collectionattributetest.h
++++ b/autotests/libs/collectionattributetest.h
+@@ -32,6 +32,7 @@ private Q_SLOTS:
+     void testDefaultAttributes();
+     void testCollectionRightsAttribute();
+     void testCollectionIdentificationAttribute();
++    void testDetach();
+ };
+ 
+ #endif
+diff --git a/src/core/collection.h b/src/core/collection.h
+index b5a496c..9c19cc9 100644
+--- a/src/core/collection.h
++++ b/src/core/collection.h
+@@ -565,10 +565,10 @@ inline T *Akonadi::Collection::attribute(Collection::CreateOption option)
+     Q_UNUSED(option);
+ 
+     const T dummy;
++    markAttributesChanged();
+     if (hasAttribute(dummy.type())) {
+         T *attr = dynamic_cast<T *>(attribute(dummy.type()));
+         if (attr) {
+-            markAttributesChanged();
+             return attr;
+         }
+         //Reuse 5250
+@@ -585,14 +585,10 @@ template <typename T>
+ inline T *Akonadi::Collection::attribute() const
+ {
+     const QByteArray type = T().type();
++    const_cast<Collection*>(this)->markAttributesChanged();
+     if (hasAttribute(type)) {
+         T *attr = dynamic_cast<T *>(attribute(type));
+         if (attr) {
+-            // FIXME: This method returns a non-const pointer, so callers may still modify the
+-            // attribute. Unfortunately, just making this function return a const pointer and
+-            // creating a non-const overload does not work, as many users of this function abuse the
+-            // non-const pointer and modify the attribute even on a const object.
+-            const_cast<Collection*>(this)->markAttributesChanged();
+             return attr;
+         }
+         //reuse 5250
+-- 
+cgit v1.1

diff --git a/kde-apps/akonadi/files/akonadi-18.12.3-major-regression-updating-attributes.patch b/kde-apps/akonadi/files/akonadi-18.12.3-major-regression-updating-attributes.patch
new file mode 100644
index 00000000000..c3e62af2d02
--- /dev/null
+++ b/kde-apps/akonadi/files/akonadi-18.12.3-major-regression-updating-attributes.patch
@@ -0,0 +1,55 @@
+From 1d8851495bcfa6ff5d3fa35882b68fdf68b21a7f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
+Date: Thu, 21 Mar 2019 13:22:58 +0100
+Subject: Fix a regression when updating attributes
+
+This fixes a regression introduced in 3a062e6a and 6054e42d where some
+attributes were not sent to the Akonadi server in update job even though
+they were modified. This was due to a bad API design which returns a
+non-const pointer to an attribute from a const method, so callers sometimes
+modify the returned attribute on a const object. Since the method itself
+is const though, it did not mark the attribute as modified.
+
+Proper fix is to introduce a purely const and non-const overloads for
+the attribute accessors, unfortunatelly this requires fixing a lot of our code
+in many places first to not abuse the non-constness of the returned
+attribute.
+
+Note that since the code is in an inlined method, all clients should be
+recompiled.
+
+CCMAIL: faure@kde.org
+---
+ src/core/collection.h | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/src/core/collection.h b/src/core/collection.h
+index 50c0926..b5a496c 100644
+--- a/src/core/collection.h
++++ b/src/core/collection.h
+@@ -584,14 +584,19 @@ inline T *Akonadi::Collection::attribute(Collection::CreateOption option)
+ template <typename T>
+ inline T *Akonadi::Collection::attribute() const
+ {
+-    const T dummy;
+-    if (hasAttribute(dummy.type())) {
+-        T *attr = dynamic_cast<T *>(attribute(dummy.type()));
++    const QByteArray type = T().type();
++    if (hasAttribute(type)) {
++        T *attr = dynamic_cast<T *>(attribute(type));
+         if (attr) {
++            // FIXME: This method returns a non-const pointer, so callers may still modify the
++            // attribute. Unfortunately, just making this function return a const pointer and
++            // creating a non-const overload does not work, as many users of this function abuse the
++            // non-const pointer and modify the attribute even on a const object.
++            const_cast<Collection*>(this)->markAttributesChanged();
+             return attr;
+         }
+         //reuse 5250
+-        qWarning() << "Found attribute of unknown type" << dummy.type()
++        qWarning() << "Found attribute of unknown type" << type
+                    << ". Did you forget to call AttributeFactory::registerAttribute()?";
+     }
+ 
+-- 
+cgit v1.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-apps/akonadi/files/, kde-apps/akonadi/
@ 2019-07-26 16:43 Andreas Sturmlechner
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Sturmlechner @ 2019-07-26 16:43 UTC (permalink / raw
  To: gentoo-commits

commit:     ef72a86e4ea8465c58af50314f403a1602b3e086
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 26 15:25:16 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Jul 26 16:43:38 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef72a86e

kde-apps/akonadi: Fix non-lowercase external QMYSQL dbs

Package-Manager: Portage-2.3.66, Repoman-2.3.16
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 kde-apps/akonadi/akonadi-19.04.3-r1.ebuild         | 127 +++++++++++++++++++++
 .../akonadi/files/akonadi-19.04.3-qmysql-fix.patch |  44 +++++++
 2 files changed, 171 insertions(+)

diff --git a/kde-apps/akonadi/akonadi-19.04.3-r1.ebuild b/kde-apps/akonadi/akonadi-19.04.3-r1.ebuild
new file mode 100644
index 00000000000..364a5f02cd8
--- /dev/null
+++ b/kde-apps/akonadi/akonadi-19.04.3-r1.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+KDE_DESIGNERPLUGIN="true"
+KDE_TEST="forceoptional"
+VIRTUALDBUS_TEST="true"
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="Storage service for PIM data and libraries for PIM apps"
+HOMEPAGE="https://community.kde.org/KDE_PIM/akonadi"
+
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+LICENSE="LGPL-2.1+"
+IUSE="+mysql postgres sqlite tools xml"
+
+REQUIRED_USE="|| ( mysql postgres sqlite ) test? ( tools )"
+
+COMMON_DEPEND="
+	$(add_frameworks_dep kcompletion)
+	$(add_frameworks_dep kconfig)
+	$(add_frameworks_dep kconfigwidgets)
+	$(add_frameworks_dep kcoreaddons)
+	$(add_frameworks_dep kcrash)
+	$(add_frameworks_dep kdbusaddons)
+	$(add_frameworks_dep ki18n)
+	$(add_frameworks_dep kiconthemes)
+	$(add_frameworks_dep kio)
+	$(add_frameworks_dep kitemmodels)
+	$(add_frameworks_dep kitemviews)
+	$(add_frameworks_dep kwidgetsaddons)
+	$(add_frameworks_dep kwindowsystem)
+	$(add_frameworks_dep kxmlgui)
+	$(add_qt_dep qtdbus)
+	$(add_qt_dep qtgui)
+	$(add_qt_dep qtnetwork)
+	$(add_qt_dep qtsql 'mysql?,postgres?')
+	$(add_qt_dep qtwidgets)
+	$(add_qt_dep qtxml)
+	sqlite? (
+		$(add_qt_dep qtsql 'sqlite' '' '5=')
+		dev-db/sqlite:3
+	)
+	xml? ( dev-libs/libxml2 )
+"
+DEPEND="${COMMON_DEPEND}
+	dev-libs/boost
+	dev-libs/libxslt
+	test? ( sys-apps/dbus )
+"
+RDEPEND="${COMMON_DEPEND}
+	!<kde-apps/kapptemplate-17.11.80
+	!kde-apps/kdepim-l10n
+	!kde-apps/kdepimlibs
+	mysql? ( virtual/mysql )
+	postgres? ( dev-db/postgresql )
+"
+
+# some akonadi tests time out, that probably needs more work as it's ~700 tests
+RESTRICT+=" test"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-18.12.2-mysql56-crash.patch"
+	"${FILESDIR}/${P}-qmysql-fix.patch"
+)
+
+pkg_setup() {
+	# Set default storage backend in order: MySQL, PostgreSQL, SQLite
+	# reverse driver check to keep the order
+	use sqlite && DRIVER="QSQLITE3"
+	use postgres && DRIVER="QPSQL"
+	use mysql && DRIVER="QMYSQL"
+
+	if use mysql && has_version ">=dev-db/mariadb-10.4"; then
+		ewarn "If an existing Akonadi QMYSQL database is being upgraded using"
+		ewarn ">=dev-db/mariadb-10.4 and KMail stops fetching and sending mail,"
+		ewarn "check ~/.local/share/akonadi/akonadiserver.error for errors like:"
+		ewarn "  \"Cannot add or update a child row: a foreign key constraint fails\""
+		ewarn
+		ewarn "Manual steps are required to fix it, see also:"
+		ewarn "  https://bugs.gentoo.org/688746 (see Whiteboard)"
+		ewarn "  https://bugs.kde.org/show_bug.cgi?id=409224"
+		ewarn
+	fi
+
+	if use sqlite || has_version "<${CATEGORY}/${P}[sqlite]"; then
+		ewarn "We strongly recommend you change your Akonadi database backend to either MySQL"
+		ewarn "or PostgreSQL in your user configuration."
+		ewarn "In particular, kde-apps/kmail does not work properly with the sqlite backend."
+	fi
+
+	kde5_pkg_setup
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DAKONADI_BUILD_QSQLITE=$(usex sqlite)
+		-DBUILD_TOOLS=$(usex tools)
+		$(cmake-utils_use_find_package xml LibXml2)
+	)
+
+	kde5_src_configure
+}
+
+src_install() {
+	# Who knows, maybe it accidentally fixes our permission issues
+	cat <<-EOF > "${T}"/akonadiserverrc
+[%General]
+Driver=${DRIVER}
+EOF
+	insinto /usr/share/config/akonadi
+	doins "${T}"/akonadiserverrc
+
+	kde5_src_install
+}
+
+pkg_postinst() {
+	kde5_pkg_postinst
+	elog "You can select the storage backend in ~/.config/akonadi/akonadiserverrc."
+	elog "Available drivers are:"
+	use mysql && elog "  QMYSQL"
+	use postgres && elog "  QPSQL"
+	use sqlite && elog "  QSQLITE3"
+	elog "${DRIVER} has been set as your default akonadi storage backend."
+}

diff --git a/kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch b/kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch
new file mode 100644
index 00000000000..c26d3d993b2
--- /dev/null
+++ b/kde-apps/akonadi/files/akonadi-19.04.3-qmysql-fix.patch
@@ -0,0 +1,44 @@
+From 8b8db29d10b2ef92deb2d87ff613f3d7f39af34e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
+Date: Fri, 26 Jul 2019 13:31:58 +0200
+Subject: Fix compatibility with QMYSQL driver after 74aed95
+
+Summary:
+QPSQL requires the table name passed to QSqlDatabase::record() to be lowercase
+since Qt 5.13, but doing that breaks QMYSQL, so only adjust the name when
+using QPSQL.
+
+CCBUG: 409234
+
+Reviewers: #kde_pim, vkrause
+
+Reviewed By: #kde_pim, vkrause
+
+Subscribers: kde-pim
+
+Tags: #kde_pim
+
+Differential Revision: https://phabricator.kde.org/D22677
+---
+ src/server/storage/dbintrospector.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/server/storage/dbintrospector.cpp b/src/server/storage/dbintrospector.cpp
+index 70d952a..932444c 100644
+--- a/src/server/storage/dbintrospector.cpp
++++ b/src/server/storage/dbintrospector.cpp
+@@ -76,7 +76,10 @@ bool DbIntrospector::hasColumn(const QString &tableName, const QString &columnNa
+     QStringList columns = m_columnCache.value(tableName);
+ 
+     if (columns.isEmpty()) {
+-        const QSqlRecord table = m_database.record(tableName.toLower());
++        // QPSQL requires the name to be lower case, but it breaks compatibility with existing
++        // tables with other drivers (see BKO#409234). Yay for abstraction...
++        const auto name = (DbType::type(m_database) == DbType::PostgreSQL) ? tableName.toLower() : tableName;
++        const QSqlRecord table = m_database.record(name);
+         const int numTables = table.count();
+         columns.reserve(numTables);
+         for (int i = 0; i < numTables; ++i) {
+-- 
+cgit v1.1
+


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-apps/akonadi/files/, kde-apps/akonadi/
@ 2021-02-16 22:35 Andreas Sturmlechner
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Sturmlechner @ 2021-02-16 22:35 UTC (permalink / raw
  To: gentoo-commits

commit:     8b744749e2562e7593b07b93c018d4e6cbd51986
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 16 22:25:09 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Feb 16 22:35:25 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b744749

kde-apps/akonadi: Switch back mariadb -> mysql, use 'loose_' options

This is reverting commit 6b90510a (kde overlay), instead trying to fix
MySQL server settings while keeping MariaDB settings intact.

KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=421922

Reported-by: Stephan Karacson <stkaopen <AT> gmx.at>
Thanks-to: Victor Mataré <vmatare+gbug <AT> posteo.de>
Thanks-to: Thomas Deutschmann <whissi <AT> gentoo.org>
Bug: https://bugs.gentoo.org/709812
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 kde-apps/akonadi/akonadi-20.12.2-r1.ebuild         | 39 +++++------
 .../files/akonadi-20.12.2-mysql8-conf.patch        | 75 ++++++++++++++++++++++
 2 files changed, 92 insertions(+), 22 deletions(-)

diff --git a/kde-apps/akonadi/akonadi-20.12.2-r1.ebuild b/kde-apps/akonadi/akonadi-20.12.2-r1.ebuild
index d01ba34d4e7..3c234d906ee 100644
--- a/kde-apps/akonadi/akonadi-20.12.2-r1.ebuild
+++ b/kde-apps/akonadi/akonadi-20.12.2-r1.ebuild
@@ -17,16 +17,19 @@ HOMEPAGE="https://community.kde.org/KDE_PIM/akonadi"
 LICENSE="LGPL-2.1+"
 SLOT="5"
 KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
-IUSE="+kaccounts +mariadb postgres sqlite tools xml"
+IUSE="+kaccounts +mysql postgres sqlite tools xml"
 
-REQUIRED_USE="|| ( mariadb postgres sqlite ) test? ( tools )"
+REQUIRED_USE="|| ( mysql postgres sqlite ) test? ( tools )"
+
+# some akonadi tests time out, that probably needs more work as it's ~700 tests
+RESTRICT+=" test"
 
 COMMON_DEPEND="
 	app-arch/xz-utils
 	>=dev-qt/qtdbus-${QTMIN}:5
 	>=dev-qt/qtgui-${QTMIN}:5
 	>=dev-qt/qtnetwork-${QTMIN}:5
-	>=dev-qt/qtsql-${QTMIN}:5[postgres?]
+	>=dev-qt/qtsql-${QTMIN}:5[mysql?,postgres?]
 	>=dev-qt/qtwidgets-${QTMIN}:5
 	>=dev-qt/qtxml-${QTMIN}:5
 	>=kde-frameworks/kconfig-${KFMIN}:5
@@ -45,7 +48,6 @@ COMMON_DEPEND="
 		>=kde-apps/kaccounts-integration-20.08.3:5
 		net-libs/accounts-qt
 	)
-	mariadb? ( >=dev-qt/qtsql-${QTMIN}:5[mysql] )
 	sqlite? (
 		dev-db/sqlite:3
 		>=dev-qt/qtsql-${QTMIN}:5=[sqlite]
@@ -58,24 +60,24 @@ DEPEND="${COMMON_DEPEND}
 	test? ( sys-apps/dbus )
 "
 RDEPEND="${COMMON_DEPEND}
-	mariadb? ( >=dev-db/mariadb-10.4:* )
+	mysql? ( virtual/mysql )
 	postgres? ( dev-db/postgresql )
 "
 
-# some akonadi tests time out, that probably needs more work as it's ~700 tests
-RESTRICT+=" test"
-
-PATCHES=( "${FILESDIR}/${PN}-18.12.2-mysql56-crash.patch" )
+PATCHES=(
+	"${FILESDIR}/${PN}-18.12.2-mysql56-crash.patch"
+	"${FILESDIR}/${P}-mysql8-conf.patch" # bug 709812
+)
 
 pkg_setup() {
-	# Set default storage backend in order: MariaDB, PostgreSQL, SQLite
+	# Set default storage backend in order: MySQL, PostgreSQL, SQLite
 	# reverse driver check to keep the order
 	use sqlite && DRIVER="QSQLITE3"
 	use postgres && DRIVER="QPSQL"
-	use mariadb && DRIVER="QMYSQL"
+	use mysql && DRIVER="QMYSQL"
 
-	if use mariadb && has_version ">=dev-db/mariadb-10.4"; then
-		ewarn "If an existing Akonadi MariaDB database is being upgraded using"
+	if use mysql && has_version ">=dev-db/mariadb-10.4"; then
+		ewarn "If an existing Akonadi QMYSQL database is being upgraded using"
 		ewarn ">=dev-db/mariadb-10.4 and KMail stops fetching and sending mail,"
 		ewarn "check ~/.local/share/akonadi/akonadiserver.error for errors like:"
 		ewarn "  \"Cannot add or update a child row: a foreign key constraint fails\""
@@ -88,17 +90,10 @@ pkg_setup() {
 
 	if use sqlite || has_version "<${CATEGORY}/${P}[sqlite]"; then
 		ewarn "We strongly recommend you change your Akonadi database backend to"
-		ewarn "either MariaDB or PostgreSQL in your user configuration."
+		ewarn "either MariaDB/MySQL or PostgreSQL in your user configuration."
 		ewarn "In particular, kde-apps/kmail does not work properly with the sqlite backend."
 	fi
 
-	if has_version "kde-apps/akonadi[mysql]"; then
-		ewarn "Due to configuration incompatibilities we are unable to provide"
-		ewarn "the option to use dev-db/mysql. You must switch to dev-db/mariadb."
-		ewarn "  https://bugs.gentoo.org/709812"
-		ewarn "  https://bugs.kde.org/show_bug.cgi?id=421922"
-	fi
-
 	ecm_pkg_setup
 }
 
@@ -130,7 +125,7 @@ pkg_postinst() {
 	ecm_pkg_postinst
 	elog "You can select the storage backend in ~/.config/akonadi/akonadiserverrc."
 	elog "Available drivers are:"
-	use mariadb && elog "  QMYSQL"
+	use mysql && elog "  QMYSQL"
 	use postgres && elog "  QPSQL"
 	use sqlite && elog "  QSQLITE3"
 	elog "${DRIVER} has been set as your default akonadi storage backend."

diff --git a/kde-apps/akonadi/files/akonadi-20.12.2-mysql8-conf.patch b/kde-apps/akonadi/files/akonadi-20.12.2-mysql8-conf.patch
new file mode 100644
index 00000000000..8edf9d605dd
--- /dev/null
+++ b/kde-apps/akonadi/files/akonadi-20.12.2-mysql8-conf.patch
@@ -0,0 +1,75 @@
+From 9c666d0d6039a87f6286014c7d9c7281a5bd9dd1 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Tue, 16 Feb 2021 21:38:14 +0100
+Subject: [PATCH] MySQL server settings: Make use of 'loose_' option prefix
+
+Idea by one of the Gentoo MySQL maintainers. This makes MySQL skip over
+unsupported options rather than fail, which is important with >=MySQL-8.
+
+See also:
+https://dev.mysql.com/doc/refman/8.0/en/option-files.html#option-file-syntax
+https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#option-prefixes
+
+BUG: 421922
+
+Thanks-to: Thomas Deutschmann <whissi@gentoo.org>
+---
+ src/server/storage/mysql-global-mobile.conf | 6 +++---
+ src/server/storage/mysql-global.conf        | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/server/storage/mysql-global-mobile.conf b/src/server/storage/mysql-global-mobile.conf
+index 19649d347..48e150af7 100644
+--- a/src/server/storage/mysql-global-mobile.conf
++++ b/src/server/storage/mysql-global-mobile.conf
+@@ -65,7 +65,7 @@ innodb_large_prefix=1
+ log_error=mysql.err
+ 
+ # print warnings and connection errors (default:1)
+-log_warnings=2
++loose_log_warnings=2
+ 
+ # Convert table named to lowercase
+ lower_case_table_names=1
+@@ -80,10 +80,10 @@ max_connections=256
+ # (make sense when having the same query multiple times)
+ 
+ # Memory allocated for caching query results (default:0 (disabled))
+-query_cache_size=0
++loose_query_cache_size=0
+ 
+ # Do not cache results (default:1)
+-query_cache_type=0
++loose_query_cache_type=0
+ 
+ # Do not use the privileges mechanisms
+ skip_grant_tables
+diff --git a/src/server/storage/mysql-global.conf b/src/server/storage/mysql-global.conf
+index ab4a4a1e3..b67a4ec1e 100644
+--- a/src/server/storage/mysql-global.conf
++++ b/src/server/storage/mysql-global.conf
+@@ -62,7 +62,7 @@ innodb_log_file_size=64M
+ log_error=mysql.err
+ 
+ # print warnings and connection errors (default:1)
+-log_warnings=2
++loose_log_warnings=2
+ 
+ # Convert table named to lowercase
+ lower_case_table_names=1
+@@ -77,10 +77,10 @@ max_connections=256
+ # (make sense when having the same query multiple times)
+ 
+ # Memory allocated for caching query results (default:0 (disabled))
+-query_cache_size=0
++loose_query_cache_size=0
+ 
+ # Do not cache results (default:1)
+-query_cache_type=0
++loose_query_cache_type=0
+ 
+ # Do not use the privileges mechanisms
+ skip_grant_tables
+-- 
+2.30.1
+


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-apps/akonadi/files/, kde-apps/akonadi/
@ 2021-04-04 19:53 Andreas Sturmlechner
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Sturmlechner @ 2021-04-04 19:53 UTC (permalink / raw
  To: gentoo-commits

commit:     fe87d665b6f99bad6352d89eb9862632ba144fa0
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 16 23:04:33 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Apr  4 19:53:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe87d665

kde-apps/akonadi: Update IUSE=mysql instructions using readme.gentoo

Provide detailed instructions for how to fix existing backends.

Bug: https://bugs.gentoo.org/688746
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 kde-apps/akonadi/akonadi-20.12.3.ebuild | 15 +++++--------
 kde-apps/akonadi/files/README.gentoo    | 39 +++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 9 deletions(-)

diff --git a/kde-apps/akonadi/akonadi-20.12.3.ebuild b/kde-apps/akonadi/akonadi-20.12.3.ebuild
index 6f78d4f5ff9..29372098360 100644
--- a/kde-apps/akonadi/akonadi-20.12.3.ebuild
+++ b/kde-apps/akonadi/akonadi-20.12.3.ebuild
@@ -9,7 +9,7 @@ KFMIN=5.75.0
 QTMIN=5.15.2
 VIRTUALDBUS_TEST="true"
 VIRTUALX_REQUIRED="test"
-inherit ecm kde.org
+inherit ecm kde.org readme.gentoo-r1
 
 DESCRIPTION="Storage service for PIM data and libraries for PIM apps"
 HOMEPAGE="https://community.kde.org/KDE_PIM/akonadi"
@@ -73,15 +73,9 @@ pkg_setup() {
 	use postgres && DRIVER="QPSQL"
 	use mysql && DRIVER="QMYSQL"
 
-	if use mysql && has_version ">=dev-db/mariadb-10.4"; then
-		ewarn "If an existing Akonadi QMYSQL database is being upgraded using"
-		ewarn ">=dev-db/mariadb-10.4 and KMail stops fetching and sending mail,"
-		ewarn "check ~/.local/share/akonadi/akonadiserver.error for errors like:"
-		ewarn "  \"Cannot add or update a child row: a foreign key constraint fails\""
+	if use mysql && has_version "${CATEGORY}/${PN}[mysql]" && has_version "dev-db/mariadb"; then
 		ewarn
-		ewarn "Manual steps are required to fix it, see also:"
-		ewarn "  https://bugs.gentoo.org/688746 (see Whiteboard)"
-		ewarn "  https://bugs.kde.org/show_bug.cgi?id=409224"
+		ewarn "Attention: Make sure to read README.gentoo after install."
 		ewarn
 	fi
 
@@ -116,6 +110,7 @@ EOF
 	doins "${T}"/akonadiserverrc
 
 	ecm_src_install
+	readme.gentoo_create_doc
 }
 
 pkg_postinst() {
@@ -126,4 +121,6 @@ pkg_postinst() {
 	use postgres && elog "  QPSQL"
 	use sqlite && elog "  QSQLITE3"
 	elog "${DRIVER} has been set as your default akonadi storage backend."
+	use mysql && elog
+	use mysql && FORCE_PRINT_ELOG=1 readme.gentoo_print_elog
 }

diff --git a/kde-apps/akonadi/files/README.gentoo b/kde-apps/akonadi/files/README.gentoo
new file mode 100644
index 00000000000..c778f6d1a21
--- /dev/null
+++ b/kde-apps/akonadi/files/README.gentoo
@@ -0,0 +1,39 @@
+Akonadi QMYSQL backends that were created using <dev-db/mariadb-10.5.9-r3 may
+be in need of a manual fix. Failure to do so could result in akonadi service
+to stop fetching and sending mail for KMail or any other kind of issues in PIM
+applications depending on akonadi like KOrganizer, KAddressBook etc.
+
+Note:
+  - All commands that follow are to be run by a regular user.
+  - They will have to be repeated for any other user of KDE PIM.
+  - Use your favorite terminal.
+
+  1) Check if "mysql" system db is present:
+     $ mysql -S /run/user/$(id -u)/akonadi/mysql.socket -e 'select schema_name \
+         from information_schema.schemata where schema_name = "mysql"'
+
+     The output obtained should look like this:
+        +-------------+
+        | schema_name |
+        +-------------+
+        | mysql       |
+        +-------------+
+
+     If so, then automatic DB upgrades will succeed, no further action necessary.
+
+  2) If, however, the above query returned empty, add the missing database:
+     $ mysql -S /run/user/$(id -u)/akonadi/mysql.socket -e 'create database mysql'
+
+     Future MariaDB releases should upgrade without manual intervention now.
+
+  3) Optional: You may have come here with an already defunct akonadi service.
+     To manually fix the akonadi MariaDB backend:
+     $ mysql_upgrade -S /run/user/$(id -u)/akonadi/default/mysql.socket \
+         --defaults-file=~/.local/share/akonadi/mysql.conf
+
+     Don't forget to restart the akonadi service afterwards:
+     $ akonadictl restart
+
+References:
+  [1] https://bugs.gentoo.org/688746
+  [2] https://bugs.kde.org/show_bug.cgi?id=409224


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-04 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-16 22:35 [gentoo-commits] repo/gentoo:master commit in: kde-apps/akonadi/files/, kde-apps/akonadi/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2021-04-04 19:53 Andreas Sturmlechner
2019-07-26 16:43 Andreas Sturmlechner
2019-04-03 12:02 Andreas Sturmlechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox