aboutsummaryrefslogtreecommitdiffstats
path: root/community/kdb
diff options
context:
space:
mode:
Diffstat (limited to 'community/kdb')
-rw-r--r--community/kdb/0001-fix-build-with-newer-qt.patch67
-rw-r--r--community/kdb/0002-fix-build-with-postgresql-12+.patch36
-rw-r--r--community/kdb/APKBUILD69
3 files changed, 172 insertions, 0 deletions
diff --git a/community/kdb/0001-fix-build-with-newer-qt.patch b/community/kdb/0001-fix-build-with-newer-qt.patch
new file mode 100644
index 0000000000..a9a04ad493
--- /dev/null
+++ b/community/kdb/0001-fix-build-with-newer-qt.patch
@@ -0,0 +1,67 @@
+From b36d74f13a1421437a725fb74502c993c359392a Mon Sep 17 00:00:00 2001
+From: Nicolas Fella <nicolas.fella@gmx.de>
+Date: Mon, 16 Nov 2020 16:41:27 +0100
+Subject: [PATCH] Fix build with newer Qt
+
+---
+ src/KDb.cpp | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/src/KDb.cpp b/src/KDb.cpp
+index 5c3b601f..ee92c2ee 100644
+--- a/src/KDb.cpp
++++ b/src/KDb.cpp
+@@ -1635,33 +1635,33 @@ QString KDb::escapeBLOB(const QByteArray& array, BLOBEscapingType type)
+ for (int i = 0; i < size; i++) {
+ const unsigned char val = array[i];
+ if (val < 32 || val >= 127 || val == 39 || val == 92) {
+- str[new_length++] = '\\';
+- str[new_length++] = '\\';
+- str[new_length++] = '0' + val / 64;
+- str[new_length++] = '0' + (val % 64) / 8;
+- str[new_length++] = '0' + val % 8;
++ str[new_length++] = QLatin1Char('\\');
++ str[new_length++] = QLatin1Char('\\');
++ str[new_length++] = QChar::fromLatin1('0' + val / 64);
++ str[new_length++] = QChar::fromLatin1('0' + (val % 64) / 8);
++ str[new_length++] = QChar::fromLatin1('0' + val % 8);
+ } else {
+- str[new_length++] = val;
++ str[new_length++] = QChar::fromLatin1(val);
+ }
+ }
+ } else {
+ for (int i = 0; i < size; i++) {
+ const unsigned char val = array[i];
+- str[new_length++] = intToHexDigit(val / 16);
+- str[new_length++] = intToHexDigit(val % 16);
++ str[new_length++] = QChar::fromLatin1(intToHexDigit(val / 16));
++ str[new_length++] = QChar::fromLatin1(intToHexDigit(val % 16));
+ }
+ }
+ if (type == BLOBEscapingType::XHex || type == BLOBEscapingType::Octal) {
+- str[new_length++] = '\'';
++ str[new_length++] = QLatin1Char('\'');
+ } else if (type == BLOBEscapingType::ByteaHex) {
+- str[new_length++] = '\'';
+- str[new_length++] = ':';
+- str[new_length++] = ':';
+- str[new_length++] = 'b';
+- str[new_length++] = 'y';
+- str[new_length++] = 't';
+- str[new_length++] = 'e';
+- str[new_length++] = 'a';
++ str[new_length++] = QLatin1Char('\'');
++ str[new_length++] = QLatin1Char(':');
++ str[new_length++] = QLatin1Char(':');
++ str[new_length++] = QLatin1Char('b');
++ str[new_length++] = QLatin1Char('y');
++ str[new_length++] = QLatin1Char('t');
++ str[new_length++] = QLatin1Char('e');
++ str[new_length++] = QLatin1Char('a');
+ }
+ return str;
+ }
+--
+GitLab
+
diff --git a/community/kdb/0002-fix-build-with-postgresql-12+.patch b/community/kdb/0002-fix-build-with-postgresql-12+.patch
new file mode 100644
index 0000000000..831720fed8
--- /dev/null
+++ b/community/kdb/0002-fix-build-with-postgresql-12+.patch
@@ -0,0 +1,36 @@
+From 40cdaea4d7824cc1b0d26e6ad2dcb61fa2077911 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <pino@kde.org>
+Date: Tue, 29 Oct 2019 07:52:32 +0100
+Subject: [PATCH] PgSQL driver: fix build with PostgreSQL 12+
+
+ABSTIMEOID and RELTIMEOID were removed, as their data types were dropped.
+---
+ src/drivers/postgresql/PostgresqlTypes.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/drivers/postgresql/PostgresqlTypes.cpp b/src/drivers/postgresql/PostgresqlTypes.cpp
+index ea576d69..0697129e 100644
+--- a/src/drivers/postgresql/PostgresqlTypes.cpp
++++ b/src/drivers/postgresql/PostgresqlTypes.cpp
+@@ -36,6 +36,7 @@
+ #endif
+ #include <libpq-fe.h>
+ #include <catalog/pg_type.h> // needed for BOOLOID, etc.
++#include <pg_config.h> // needed for PG_VERSION_NUM
+
+ #ifdef _MSC_VER
+ #pragma warning( pop )
+@@ -70,8 +71,10 @@ void PostgresqlDriver::initPgsqlToKDbMap()
+ //! @todo POLYGONOID geometric polygon '(pt1,...)'
+ m_pgsqlToKDbTypes.insert(FLOAT4OID, KDbField::Double);
+ m_pgsqlToKDbTypes.insert(FLOAT8OID, KDbField::Double);
++#if PG_VERSION_NUM < 120000
+ m_pgsqlToKDbTypes.insert(ABSTIMEOID, KDbField::Date);
+ m_pgsqlToKDbTypes.insert(RELTIMEOID, KDbField::Date);
++#endif
+ //! @todo TINTERVALOID (abstime,abstime), time interval
+ //! @todo CIRCLEOID geometric circle '(center,radius)'
+ //! @todo CASHOID monetary amounts, $d,ddd.cc
+--
+GitLab
+
diff --git a/community/kdb/APKBUILD b/community/kdb/APKBUILD
new file mode 100644
index 0000000000..71b4e8a5b5
--- /dev/null
+++ b/community/kdb/APKBUILD
@@ -0,0 +1,69 @@
+# Contributor: Bart Ribbers <bribbers@disroot.org>
+# Maintainer: Bart Ribbers <bribbers@disroot.org>
+pkgname=kdb
+pkgver=3.2.0
+pkgrel=1
+pkgdesc="Database connectivity and creation framework for various database vendors"
+url="https://community.kde.org/KDb"
+# armhf blocked by extra-cmake-modules
+arch="all !armhf"
+license="LGPL-2.0-or-later"
+makedepends="
+ extra-cmake-modules
+ icu-dev
+ kcoreaddons-dev
+ mariadb-dev
+ postgresql-dev
+ python3
+ qt5-qtbase-dev
+ qt5-qttools-dev
+ sqlite-dev
+ "
+subpackages="$pkgname-dev $pkgname-lang $pkgname-sqlite $pkgname-mysql $pkgname-postgresql"
+source="https://download.kde.org/stable/kdb/src/kdb-$pkgver.tar.xz
+ 0001-fix-build-with-newer-qt.patch
+ 0002-fix-build-with-postgresql-12+.patch
+ "
+
+build() {
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DPYTHON_EXECUTABLE=/usr/bin/python3
+ cmake --build build
+}
+
+check() {
+ cd build
+ CTEST_OUTPUT_ON_FAILURE=TRUE ctest
+}
+
+package() {
+ DESTDIR="$pkgdir" cmake --install build
+}
+
+sqlite() {
+ pkgdesc="$pkgdesc (sqlite driver)"
+
+ amove \
+ usr/lib/qt5/plugins/kdb3/kdb_sqlitedriver.so \
+ usr/lib/qt5/plugins/kdb3/sqlite3/kdb_sqlite_icu.so \
+ usr/bin/kdb3_sqlite3_dump
+}
+
+mysql() {
+ pkgdesc="$pkgdesc (mysql driver)"
+
+ amove usr/lib/qt5/plugins/kdb3/kdb_mysqldriver.so
+}
+
+postgresql() {
+ pkgdesc="$pkgdesc (postgresql driver)"
+
+ amove usr/lib/qt5/plugins/kdb3/kdb_postgresqldriver.so
+}
+
+sha512sums="7df22f2c5b6e20ae3de71cb6c76b234d2f1f33b2abcdffa85be313c63d067a40a85ed102b6256207315db08ced5d69f8bc40afdf84a188463713a6b2ffdb2df7 kdb-3.2.0.tar.xz
+7fc18bd99d45ed6f874d7aceff271d6262bae550340b243414026c1683837a27b6e261a992a187f4fbebfdf5ac5fd67400528b6d1b3b9c33abb35fe4237989bf 0001-fix-build-with-newer-qt.patch
+c7d6fe068bf1dfd206d96e1214595d7001ce03cc591837bbb1e500d440178d95eedb3f07d2fe4a5d9c07fcfe6dad0ee5e0a74ede5ecca4e09572dea1ca35110b 0002-fix-build-with-postgresql-12+.patch"