diff --git a/0030-Fix-build-with-GCC-12-standard-attributes-in-middle-.patch b/0030-Fix-build-with-GCC-12-standard-attributes-in-middle-.patch new file mode 100644 index 0000000..d15fc39 --- /dev/null +++ b/0030-Fix-build-with-GCC-12-standard-attributes-in-middle-.patch @@ -0,0 +1,70 @@ +From 1b1807bb65c2f1415f4c10cea2f1982706b1905e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=96mer=20Fad=C4=B1l=20Usta?= +Date: Thu, 12 May 2022 04:51:01 +0000 +Subject: [PATCH] Fix build with GCC 12 (standard attributes in middle of decl-specifiers) + +--- + src/KDbConnection.h | 2 +- + src/drivers/mysql/MysqlConnection_p.h | 4 ++-- + src/drivers/sqlite/SqliteConnection_p.h | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/KDbConnection.h b/src/KDbConnection.h +index a6968cf8..1a9cf748 100644 +--- a/src/KDbConnection.h ++++ b/src/KDbConnection.h +@@ -1191,7 +1191,7 @@ protected: + @todo Add support for nested transactions, + e.g. KDbTransactionData* beginTransaction(KDbTransactionData *parent) + */ +- virtual Q_REQUIRED_RESULT KDbTransactionData *drv_beginTransaction(); ++ Q_REQUIRED_RESULT virtual KDbTransactionData *drv_beginTransaction(); + + /*! Note for driver developers: begins new transaction + and returns handle to it. Default implementation just +diff --git a/src/drivers/mysql/MysqlConnection_p.h b/src/drivers/mysql/MysqlConnection_p.h +index 05d3da00..c9bbf5ef 100644 +--- a/src/drivers/mysql/MysqlConnection_p.h ++++ b/src/drivers/mysql/MysqlConnection_p.h +@@ -166,7 +166,7 @@ public: + return data ? mysql_num_fields(data) : 0; + } + +- inline Q_REQUIRED_RESULT KDbSqlField *field(int index) override { ++ Q_REQUIRED_RESULT inline KDbSqlField *field(int index) override { + if (!fields) { + if (!data) { + return nullptr; +@@ -178,7 +178,7 @@ public: + + Q_REQUIRED_RESULT KDbField *createField(const QString &tableName, int index) override; + +- inline Q_REQUIRED_RESULT QSharedPointer fetchRecord() override ++ Q_REQUIRED_RESULT inline QSharedPointer fetchRecord() override + { + QSharedPointer record; + MYSQL_ROW row = data ? mysql_fetch_row(data) : nullptr; +diff --git a/src/drivers/sqlite/SqliteConnection_p.h b/src/drivers/sqlite/SqliteConnection_p.h +index 841abbd3..a9492827 100644 +--- a/src/drivers/sqlite/SqliteConnection_p.h ++++ b/src/drivers/sqlite/SqliteConnection_p.h +@@ -140,14 +140,14 @@ public: + return sqlite3_column_count(prepared_st); + } + +- inline Q_REQUIRED_RESULT KDbSqlField *field(int index) override ++ Q_REQUIRED_RESULT inline KDbSqlField *field(int index) override + { + return prepared_st ? new SqliteSqlField(prepared_st, index) : nullptr; + } + + Q_REQUIRED_RESULT KDbField *createField(const QString &tableName, int index) override; + +- inline Q_REQUIRED_RESULT QSharedPointer fetchRecord() override ++ Q_REQUIRED_RESULT inline QSharedPointer fetchRecord() override + { + SqliteSqlRecord *record; + const int res = sqlite3_step(prepared_st); +-- +2.35.3 + diff --git a/1001-gcc-12-inline.patch b/1001-gcc-12-inline.patch new file mode 100644 index 0000000..b44fa93 --- /dev/null +++ b/1001-gcc-12-inline.patch @@ -0,0 +1,21 @@ +diff --git a/src/drivers/postgresql/PostgresqlConnection_p.h b/src/drivers/postgresql/PostgresqlConnection_p.h +index c0485786..99040c6a 100644 +--- a/src/drivers/postgresql/PostgresqlConnection_p.h ++++ b/src/drivers/postgresql/PostgresqlConnection_p.h +@@ -155,14 +155,14 @@ public: + return PQnfields(result); + } + +- inline Q_REQUIRED_RESULT KDbSqlField *field(int index) override ++ Q_REQUIRED_RESULT inline KDbSqlField *field(int index) override + { + return new PostgresqlSqlField(result, index); + } + + Q_REQUIRED_RESULT KDbField *createField(const QString &tableName, int index) override; + +- inline Q_REQUIRED_RESULT QSharedPointer fetchRecord() override ++ Q_REQUIRED_RESULT inline QSharedPointer fetchRecord() override + { + return QSharedPointer(recordToFetch < recordsCount + ? new PostgresqlSqlRecord(result, recordToFetch++) diff --git a/kdb.spec b/kdb.spec index 4933854..a34409b 100644 --- a/kdb.spec +++ b/kdb.spec @@ -34,10 +34,13 @@ Patch13: 0013-cmake-find-PostgreSQL-13.patch Patch17: 0017-Find-also-Python3-with-find_package-PythonInterp.patch Patch20: 0020-Fix-build-with-newer-Qt.patch Patch22: 0022-cmake-find-PostgreSQL-14.patch +Patch30: 0030-Fix-build-with-GCC-12-standard-attributes-in-middle-.patch ## upstreamable patches # fix/santitize KDb3.pc dependencies Patch100: kdb-3.2.0-pkgconfig.patch +# https://invent.kde.org/libraries/kdb/-/merge_requests/11 +Patch1001: 1001-gcc-12-inline.patch BuildRequires: gcc-c++