From ecd7c6c7a8be10c7bda6ea82fba65ecd90bf8ed7 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Mon, 19 Feb 2024 18:11:16 +0000 Subject: [PATCH] kdb, revbump, switch python version, add patches from upstream for newer Qt5 (#10123) --- dev-db/kdb/kdb-3.2.0.recipe | 33 +++--- dev-db/kdb/patches/kdb-3.2.0.patchset | 165 ++++++++++++++++++++++++++ 2 files changed, 181 insertions(+), 17 deletions(-) create mode 100644 dev-db/kdb/patches/kdb-3.2.0.patchset diff --git a/dev-db/kdb/kdb-3.2.0.recipe b/dev-db/kdb/kdb-3.2.0.recipe index 7ef9b3baa..f402e9ed7 100644 --- a/dev-db/kdb/kdb-3.2.0.recipe +++ b/dev-db/kdb/kdb-3.2.0.recipe @@ -12,10 +12,11 @@ handling layer for Kexi and similar complex apps." HOMEPAGE="https://community.kde.org/KDb" COPYRIGHT="2010-2021 KDE Organisation" LICENSE="GNU LGPL v2.1" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/KDE/kdb/archive/v$portVersion.tar.gz" CHECKSUM_SHA256="c651d240c641b5cdd882a99c5ec6345387d0a4e05f8ca1d59f4daaf08c3f7141" SOURCE_DIR="kdb-$portVersion" +PATCHES="kdb-$portVersion.patchset" ARCHITECTURES="all !x86_gcc2" SECONDARY_ARCHITECTURES="x86" @@ -68,41 +69,39 @@ BUILD_PREREQUIRES=" cmd:cmake cmd:g++$secondaryArchSuffix cmd:make - cmd:python2 + cmd:pkg_config$secondaryArchSuffix + cmd:python3 cmd:qdbuscpp2xml$secondaryArchSuffix >= 5 " BUILD() { - mkdir -p build - cd build - - cmake .. $cmakeDirArgs \ + cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \ + $cmakeDirArgs \ + -DPYTHON_EXECUTABLE=/system/bin/python3 \ -DKDE_INSTALL_PLUGINDIR=$addOnsDir/Qt5 \ -DKDE_INSTALL_QTPLUGINDIR=$addOnsDir/Qt5 \ -DECM_MKSPECS_INSTALL_DIR=$dataDir/Qt5/mkspecs \ - -DECM_DIR=/system/data/cmake/Modules/ECM/cmake - make $jobArgs + -DECM_DIR=/system/data/cmake/Modules/ECM/cmake \ + -Wno-dev + make -Cbuild $jobArgs } INSTALL() { - cd build - make install + make -Cbuild install + prepareInstalledDevelLib \ + libKDb3 fixPkgconfig - prepareInstalledDevelLibs \ - libKDb3 - packageEntries devel \ + $developDir \ $dataDir \ - $libDir/cmake \ - $developDir + $libDir/cmake } TEST() { - cd build - make test + make -Cbuild test } diff --git a/dev-db/kdb/patches/kdb-3.2.0.patchset b/dev-db/kdb/patches/kdb-3.2.0.patchset new file mode 100644 index 000000000..9ee189413 --- /dev/null +++ b/dev-db/kdb/patches/kdb-3.2.0.patchset @@ -0,0 +1,165 @@ +From cc34c817d9960271a00c70179035097c7448664e Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Mon, 19 Feb 2024 13:43:10 +0100 +Subject: python3 changes + +Silence deprecated warnings + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 940acba..c035b16 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -44,6 +44,10 @@ get_git_revision_and_branch() + add_unfinished_features_option() + add_pc_file(${PROJECT_NAME}) + ++if(HAIKU) ++ add_definitions(-Wno-deprecated-copy -Wno-deprecated-declarations) ++endif() ++ + add_subdirectory(src) + add_subdirectory(tools) + +diff --git a/tools/sdc.py b/tools/sdc.py +index 70f386e..0a69a94 100755 +--- a/tools/sdc.py ++++ b/tools/sdc.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # -*- coding: utf-8 -*- + from __future__ import print_function, unicode_literals + # +-- +2.42.1 + + +From 137afd14448cbf4b0769d425b72e130666551cab Mon Sep 17 00:00:00 2001 +From: Pino Toscano +Date: Tue, 29 Oct 2019 07:52:32 +0100 +Subject: [PATCH] PgSQL driver: fix build with PostgreSQL 12+ + + +diff --git a/src/drivers/postgresql/PostgresqlTypes.cpp b/src/drivers/postgresql/PostgresqlTypes.cpp +index ea576d6..0697129 100644 +--- a/src/drivers/postgresql/PostgresqlTypes.cpp ++++ b/src/drivers/postgresql/PostgresqlTypes.cpp +@@ -36,6 +36,7 @@ + #endif + #include + #include // needed for BOOLOID, etc. ++#include // 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 +-- +2.42.1 + + +From 85e408bfe1b73fe46f71ae1ceb532291ace63d3d Mon Sep 17 00:00:00 2001 +From: Nicolas Fella +Date: Mon, 16 Nov 2020 16:41:27 +0100 +Subject: [PATCH] Fix build with newer Qt + + +diff --git a/src/KDb.cpp b/src/KDb.cpp +index 5c3b601..ee92c2e 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; + } +-- +2.42.1 + + +From 6c83fd949c2d30aa7c2c759162e7067288677321 Mon Sep 17 00:00:00 2001 +From: Bhushan Shah +Date: Sun, 13 Dec 2020 19:16:30 +0530 +Subject: [PATCH] include KDEInstallDirs as first thing + +Otherwise ECMGeneratePriFile won't get correct paths and will install +pri file in wrong place and things wanting to use kdb with qmake won't +work. + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c035b16..14f61ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -11,12 +11,12 @@ kdb_add_tests(OFF) + kdb_add_examples(OFF) + + # ECM ++include(KDEInstallDirs) + include(ECMGeneratePriFile) + include(ECMInstallIcons) + include(ECMOptionalAddSubdirectory) + include(ECMPoQmTools) + include(ECMSetupVersion) +-include(KDEInstallDirs) + include(KDECMakeSettings NO_POLICY_SCOPE) + include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) + +-- +2.42.1 +