From e5fdecddf333762e5af8957bd9a4a00c0ab39c22 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 20:55:22 +0200 Subject: [PATCH 01/14] Disable use of any deprecated Qt <6 API --- src/src.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/src.pro b/src/src.pro index cfbd865..32b2f5b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -10,6 +10,8 @@ if(!defined(VERSION, var)) { VERSION = $$system(git --no-pager show --pretty=oneline --no-notes | head -1 | cut -b-40) } +DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x05FFFF + VERSTR = '\\"$${VERSION}\\"' # place quotes around the version string DEFINES += VER=\"$${VERSTR}\" # create a VER macro containing the version string From eee16fb9d2ca907b4a36d2225f93ca37b5c6ceec Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:08:37 +0200 Subject: [PATCH 02/14] Add core5compat to lower the bar for initial support for Qt 6 --- src/src.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/src.pro b/src/src.pro index 32b2f5b..59e1f08 100644 --- a/src/src.pro +++ b/src/src.pro @@ -29,6 +29,10 @@ target.path = $$BINDIR DEPENDPATH += . QT = core +greaterThan(QT_MAJOR_VERSION, 5) { + QT += core5compat +} + INCLUDEPATH += . $$SVN_INCLUDE $$APR_INCLUDE !isEmpty(SVN_LIBDIR): LIBS += -L$$SVN_LIBDIR LIBS += -lsvn_fs-1 -lsvn_repos-1 -lapr-1 -lsvn_subr-1 From 41fe9c390de89d2a081aca6e9b59b9d7a393f2b1 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:14:39 +0200 Subject: [PATCH 03/14] Resolve use of QString::replace(const QRegExp &, const QString &) for Qt 6 --- src/ruleparser.h | 4 ++++ src/svn.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/ruleparser.h b/src/ruleparser.h index ec20817..5c5bacb 100644 --- a/src/ruleparser.h +++ b/src/ruleparser.h @@ -63,7 +63,11 @@ class Rules QString replacement; bool isValid() { return !pattern.isEmpty(); } +#if QT_VERSION >= 0x060000 + QString apply(QString &string) { return pattern.replaceIn(string, replacement); } +#else QString& apply(QString &string) { return string.replace(pattern, replacement); } +#endif }; QRegExp rx; diff --git a/src/svn.cpp b/src/svn.cpp index a6740b9..aefe407 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -438,7 +438,11 @@ void SvnRevision::splitPathName(const Rules::Match &rule, const QString &pathNam if (repository_p) { *repository_p = svnprefix; +#if QT_VERSION >= 0x060000 + *repository_p = rule.rx.replaceIn(*repository_p, rule.repository); +#else repository_p->replace(rule.rx, rule.repository); +#endif foreach (Rules::Match::Substitution subst, rule.repo_substs) { subst.apply(*repository_p); } @@ -446,7 +450,11 @@ void SvnRevision::splitPathName(const Rules::Match &rule, const QString &pathNam if (effectiveRepository_p) { *effectiveRepository_p = svnprefix; +#if QT_VERSION >= 0x060000 + *effectiveRepository_p = rule.rx.replaceIn(*effectiveRepository_p, rule.repository); +#else effectiveRepository_p->replace(rule.rx, rule.repository); +#endif foreach (Rules::Match::Substitution subst, rule.repo_substs) { subst.apply(*effectiveRepository_p); } @@ -458,7 +466,11 @@ void SvnRevision::splitPathName(const Rules::Match &rule, const QString &pathNam if (branch_p) { *branch_p = svnprefix; +#if QT_VERSION >= 0x060000 + *branch_p = rule.rx.replaceIn(*branch_p, rule.branch); +#else branch_p->replace(rule.rx, rule.branch); +#endif foreach (Rules::Match::Substitution subst, rule.branch_substs) { subst.apply(*branch_p); } @@ -466,7 +478,11 @@ void SvnRevision::splitPathName(const Rules::Match &rule, const QString &pathNam if (path_p) { QString prefix = svnprefix; +#if QT_VERSION >= 0x060000 + prefix = rule.rx.replaceIn(prefix, rule.prefix); +#else prefix.replace(rule.rx, rule.prefix); +#endif *path_p = prefix + pathName.mid(svnprefix.length()); } } @@ -1308,7 +1324,11 @@ int SvnRevision::fetchIgnoreProps(QString *ignore, apr_pool_t *pool, const char // they didn't match anything in Subversion but would in Git eventually ignore->remove(QRegExp("^[^\\r\\n]*[\\\\/][^\\r\\n]*(?:[\\r\\n]|$)|[\\r\\n][^\\r\\n]*[\\\\/][^\\r\\n]*(?=[\\r\\n]|$)")); // add a slash in front to have the same meaning in Git of only working on the direct children +#if QT_VERSION >= 0x060000 + *ignore = QRegExp("(^|[\\r\\n])\\s*(?![\\r\\n]|$)").replaceIn(*ignore, "\\1/"); +#else ignore->replace(QRegExp("(^|[\\r\\n])\\s*(?![\\r\\n]|$)"), "\\1/"); +#endif if (ignore->trimmed().isEmpty()) { *ignore = QString(); } @@ -1330,7 +1350,11 @@ int SvnRevision::fetchIgnoreProps(QString *ignore, apr_pool_t *pool, const char } // replace multiple asterisks Subversion meaning by Git meaning +#if QT_VERSION >= 0x060000 + *ignore = QRegExp("\\*+").replaceIn(*ignore, "*"); +#else ignore->replace(QRegExp("\\*+"), "*"); +#endif return EXIT_SUCCESS; } From d3579f4da06477921472a314f492131f98e54f71 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:51:44 +0200 Subject: [PATCH 04/14] Resolve use of Qstring::remove(const QRegExp &) for Qt 6 --- src/svn.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/svn.cpp b/src/svn.cpp index aefe407..a3f7ee8 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -1322,7 +1322,11 @@ int SvnRevision::fetchIgnoreProps(QString *ignore, apr_pool_t *pool, const char *ignore = QString(prop->data); // remove patterns with slashes or backslashes, // they didn't match anything in Subversion but would in Git eventually +#if QT_VERSION >= 0x060000 + *ignore = QRegExp("^[^\\r\\n]*[\\\\/][^\\r\\n]*(?:[\\r\\n]|$)|[\\r\\n][^\\r\\n]*[\\\\/][^\\r\\n]*(?=[\\r\\n]|$)").removeIn(*ignore); +#else ignore->remove(QRegExp("^[^\\r\\n]*[\\\\/][^\\r\\n]*(?:[\\r\\n]|$)|[\\r\\n][^\\r\\n]*[\\\\/][^\\r\\n]*(?=[\\r\\n]|$)")); +#endif // add a slash in front to have the same meaning in Git of only working on the direct children #if QT_VERSION >= 0x060000 *ignore = QRegExp("(^|[\\r\\n])\\s*(?![\\r\\n]|$)").replaceIn(*ignore, "\\1/"); @@ -1343,7 +1347,11 @@ int SvnRevision::fetchIgnoreProps(QString *ignore, apr_pool_t *pool, const char QString global_ignore = QString(prop->data); // remove patterns with slashes or backslashes, // they didn't match anything in Subversion but would in Git eventually +#if QT_VERSION >= 0x060000 + global_ignore = QRegExp("^[^\\r\\n]*[\\\\/][^\\r\\n]*(?:[\\r\\n]|$)|[\\r\\n][^\\r\\n]*[\\\\/][^\\r\\n]*(?=[\\r\\n]|$)").removeIn(global_ignore); +#else global_ignore.remove(QRegExp("^[^\\r\\n]*[\\\\/][^\\r\\n]*(?:[\\r\\n]|$)|[\\r\\n][^\\r\\n]*[\\\\/][^\\r\\n]*(?=[\\r\\n]|$)")); +#endif if (!global_ignore.trimmed().isEmpty()) { ignore->append(global_ignore); } From 35a41fd536a16bb61639f2c0d5c1866c984728bb Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:17:16 +0200 Subject: [PATCH 05/14] Resolve use of QString::KeepEmptyParts for Qt 6 --- src/ruleparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruleparser.cpp b/src/ruleparser.cpp index 29339eb..f321035 100644 --- a/src/ruleparser.cpp +++ b/src/ruleparser.cpp @@ -156,7 +156,7 @@ void Rules::load(const QString &filename) qFatal("Could not read the rules file: %s", qPrintable(filename)); QTextStream s(&file); - QStringList lines = s.readAll().split('\n', QString::KeepEmptyParts); + QStringList lines = s.readAll().split('\n', Qt::KeepEmptyParts); QStringList::iterator it; for(it = lines.begin(); it != lines.end(); ++it) { From 67c30a2c5028a590044e77d8b046d9d95085d386 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:54:41 +0200 Subject: [PATCH 06/14] Resolve use of QString::SkipEmptyParts for Qt 6 --- src/CommandLineParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CommandLineParser.cpp b/src/CommandLineParser.cpp index 2ce1ba1..4d8d518 100644 --- a/src/CommandLineParser.cpp +++ b/src/CommandLineParser.cpp @@ -79,7 +79,7 @@ void CommandLineParser::Private::addDefinitions(const CommandLineOption * option QString option = QString::fromLatin1(options[i].specification); // options with optional params are written as "--option required[, optional] if (option.indexOf(QLatin1Char(',')) >= 0 && ( option.indexOf(QLatin1Char('[')) < 0 || option.indexOf(QLatin1Char(']')) < 0) ) { - QStringList optionParts = option.split(QLatin1Char(','), QString::SkipEmptyParts); + QStringList optionParts = option.split(QLatin1Char(','), Qt::SkipEmptyParts); if (optionParts.count() != 2) { qWarning() << "WARN: option definition '" << option << "' is faulty; only one ',' allowed"; continue; @@ -104,7 +104,7 @@ void CommandLineParser::Private::addDefinitions(const CommandLineOption * option if(definition.name.isEmpty()) continue; if (option.indexOf(QLatin1Char(' ')) > 0) { - QStringList optionParts = definition.name.split(QLatin1Char(' '), QString::SkipEmptyParts); + QStringList optionParts = definition.name.split(QLatin1Char(' '), Qt::SkipEmptyParts); definition.name = optionParts[0]; bool first = true; foreach (QString s, optionParts) { @@ -137,7 +137,7 @@ void CommandLineParser::Private::setArgumentDefinition(const char *defs) { requiredArguments = 0; argumentDefinition = QString::fromLatin1(defs); - QStringList optionParts = argumentDefinition.split(QLatin1Char(' '), QString::SkipEmptyParts); + QStringList optionParts = argumentDefinition.split(QLatin1Char(' '), Qt::SkipEmptyParts); bool inArg = false; foreach (QString s, optionParts) { s = s.trimmed(); From 0e8da1504040722d0eb7dd6bec6b0cdc46d2df24 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:24:46 +0200 Subject: [PATCH 07/14] Resolve use of qUpperBound for Qt 6 --- src/repository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repository.cpp b/src/repository.cpp index b926ad4..e7ddfe3 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -616,7 +616,7 @@ long long FastImportRepository::markFrom(const QString &branchFrom, int branchRe return brFrom.marks.last(); } - QVector::const_iterator it = qUpperBound(brFrom.commits, branchRevNum); + QVector::const_iterator it = std::upper_bound(brFrom.commits.constBegin(), brFrom.commits.constEnd(), branchRevNum); if (it == brFrom.commits.begin()) { return 0; } From 60e64e52831ee3f0bd6b9d7a85b69e3d83efecd8 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:27:10 +0200 Subject: [PATCH 08/14] Resolve use of plain "endl" for Qt 6 --- src/CommandLineParser.cpp | 6 +++--- src/main.cpp | 2 +- src/repository.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CommandLineParser.cpp b/src/CommandLineParser.cpp index 4d8d518..5586a06 100644 --- a/src/CommandLineParser.cpp +++ b/src/CommandLineParser.cpp @@ -335,10 +335,10 @@ void CommandLineParser::usage(const QString &name, const QString &argumentDescri cout << " [OPTION]"; if (! argumentDescription.isEmpty()) cout << " " << argumentDescription; - cout << endl << endl; + cout << Qt::endl << Qt::endl; if (d->definitions.count() > 0) - cout << "Options:" << endl; + cout << "Options:" << Qt::endl; int commandLength = 0; foreach (Private::OptionDefinition definition, d->definitions) commandLength = qMax(definition.name.length(), commandLength); @@ -352,7 +352,7 @@ void CommandLineParser::usage(const QString &name, const QString &argumentDescri cout << definition.name; for (int i = definition.name.length(); i <= commandLength; i++) cout << ' '; - cout << definition.comment <undefinedOptions()) { if (!first) out << " : "; - out << "unrecognized option or missing argument for; `" << option << "'" << endl; + out << "unrecognized option or missing argument for; `" << option << "'" << Qt::endl; first = false; } return 10; diff --git a/src/repository.cpp b/src/repository.cpp index e7ddfe3..8d27da7 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -737,7 +737,7 @@ Repository::Transaction *FastImportRepository::newTransaction(const QString &bra int revnum) { if (!branchExists(branch)) { - qWarning() << "WARN: Transaction:" << branch << "is not a known branch in repository" << name << endl + qWarning() << "WARN: Transaction:" << branch << "is not a known branch in repository" << name << Qt::endl << "Going to create it automatically"; } From ec224a37606cb0097016f00f68a49944693eb70a Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:29:52 +0200 Subject: [PATCH 09/14] Resolve use of QByteArray::append(QString) for Qt 6 --- src/repository.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/repository.cpp b/src/repository.cpp index 8d27da7..0d01b89 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -1027,7 +1027,7 @@ QIODevice *FastImportRepository::Transaction::addFile(const QString &path, int m modifiedFiles.append(" :"); modifiedFiles.append(QByteArray::number(mark)); modifiedFiles.append(' '); - modifiedFiles.append(repository->prefix + path.toUtf8()); + modifiedFiles.append(repository->prefix.toUtf8() + path.toUtf8()); modifiedFiles.append("\n"); // it is returned for being written to, so start the process in any case @@ -1080,11 +1080,11 @@ bool FastImportRepository::Transaction::commitNote(const QByteArray ¬eText, b QByteArray s(""); s.append("commit refs/notes/commits\n"); s.append("mark :" + QByteArray::number(maxMark) + "\n"); - s.append("committer " + author + " " + QString::number(datetime) + " +0000" + "\n"); - s.append("data " + QString::number(message.length()) + "\n"); + s.append("committer " + author + " " + QByteArray::number(datetime) + " +0000" + "\n"); + s.append("data " + QByteArray::number(message.length()) + "\n"); s.append(message + "\n"); s.append("N inline " + commitRef + "\n"); - s.append("data " + QString::number(text.length()) + "\n"); + s.append("data " + QByteArray::number(text.length()) + "\n"); s.append(text + "\n"); repository->startFastImport(); repository->fastImport.write(s); @@ -1152,7 +1152,7 @@ int FastImportRepository::Transaction::commit() s.append("commit " + branchRef + "\n"); s.append("mark :" + QByteArray::number(mark) + "\n"); s.append("committer " + author + " " + QString::number(datetime).toUtf8() + " +0000" + "\n"); - s.append("data " + QString::number(message.length()) + "\n"); + s.append("data " + QByteArray::number(message.length()) + "\n"); s.append(message + "\n"); repository->fastImport.write(s); From 205d7fcfc78a78d25e9ee32e10c1a1ec929dcadd Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:34:59 +0200 Subject: [PATCH 10/14] Resolve use of qSort for Qt 6 --- src/repository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repository.cpp b/src/repository.cpp index 0d01b89..f359de3 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -1161,7 +1161,7 @@ int FastImportRepository::Transaction::commit() mark_t i = !!parentmark; // if parentmark != 0, there's at least one parent if(log.contains("This commit was manufactured by cvs2svn") && merges.count() > 1) { - qSort(merges); + std::sort(merges.begin(), merges.end()); repository->fastImport.write("merge :" + QByteArray::number(merges.last()) + "\n"); merges.pop_back(); qWarning() << "WARN: Discarding all but the highest merge point as a workaround for cvs2svn created branch/tag" From 0dcb63752f4807eb909e5bdf3b2769b8ec80968c Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:45:35 +0200 Subject: [PATCH 11/14] Resolve use of QMap::insertMulti for Qt 6 --- src/svn.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/svn.cpp b/src/svn.cpp index a3f7ee8..7f4809b 100644 --- a/src/svn.cpp +++ b/src/svn.cpp @@ -493,7 +493,11 @@ int SvnRevision::prepareTransactions() apr_hash_t *changes; SVN_ERR(svn_fs_paths_changed2(&changes, fs_root, pool)); +#if QT_VERSION >= 0x060000 + QMultiMap map; +#else QMap map; +#endif for (apr_hash_index_t *i = apr_hash_first(pool, changes); i; i = apr_hash_next(i)) { const void *vkey; void *value; @@ -513,10 +517,18 @@ int SvnRevision::prepareTransactions() fflush(stderr); exit(1); } +#if QT_VERSION >= 0x060000 + map.insert(QByteArray(key), change); +#else map.insertMulti(QByteArray(key), change); +#endif } +#if QT_VERSION >= 0x060000 + QMultiMapIterator i(map); +#else QMapIterator i(map); +#endif while (i.hasNext()) { i.next(); if (exportEntry(i.key(), i.value(), changes) == EXIT_FAILURE) @@ -991,16 +1003,28 @@ int SvnRevision::recursiveDumpDir(Repository::Transaction *txn, svn_fs_t *fs, sv // While we get a hash, put it in a map for sorted lookup, so we can // repeat the conversions and get the same git commit hashes. +#if QT_VERSION >= 0x060000 + QMultiMap map; +#else QMap map; +#endif for (apr_hash_index_t *i = apr_hash_first(pool, entries); i; i = apr_hash_next(i)) { const void *vkey; void *value; apr_hash_this(i, &vkey, NULL, &value); svn_fs_dirent_t *dirent = reinterpret_cast(value); +#if QT_VERSION >= 0x060000 + map.insert(QByteArray(dirent->name), dirent->kind); +#else map.insertMulti(QByteArray(dirent->name), dirent->kind); +#endif } +#if QT_VERSION >= 0x060000 + QMultiMapIterator i(map); +#else QMapIterator i(map); +#endif while (i.hasNext()) { dirpool.clear(); i.next(); @@ -1059,17 +1083,29 @@ int SvnRevision::recurse(const char *path, const svn_fs_path_change2_t *change, // While we get a hash, put it in a map for sorted lookup, so we can // repeat the conversions and get the same git commit hashes. +#if QT_VERSION >= 0x060000 + QMultiMap map; +#else QMap map; +#endif for (apr_hash_index_t *i = apr_hash_first(pool, entries); i; i = apr_hash_next(i)) { dirpool.clear(); const void *vkey; void *value; apr_hash_this(i, &vkey, NULL, &value); svn_fs_dirent_t *dirent = reinterpret_cast(value); +#if QT_VERSION >= 0x060000 + map.insert(QByteArray(dirent->name), dirent->kind); +#else map.insertMulti(QByteArray(dirent->name), dirent->kind); +#endif } +#if QT_VERSION >= 0x060000 + QMultiMapIterator i(map); +#else QMapIterator i(map); +#endif while (i.hasNext()) { dirpool.clear(); i.next(); @@ -1287,16 +1323,28 @@ int SvnRevision::addGitIgnoreOnBranch(apr_pool_t *pool, QString key, QString pat return EXIT_FAILURE; } +#if QT_VERSION >= 0x060000 + QMultiMap map; +#else QMap map; +#endif for (apr_hash_index_t *i = apr_hash_first(pool, entries); i; i = apr_hash_next(i)) { const void *vkey; void *value; apr_hash_this(i, &vkey, NULL, &value); svn_fs_dirent_t *dirent = reinterpret_cast(value); +#if QT_VERSION >= 0x060000 + map.insert(QByteArray(dirent->name), dirent->kind); +#else map.insertMulti(QByteArray(dirent->name), dirent->kind); +#endif } +#if QT_VERSION >= 0x060000 + QMultiMapIterator i(map); +#else QMapIterator i(map); +#endif while (i.hasNext()) { i.next(); QString entryName = key + "/" + i.key(); From 728b4b6ac4ffca79a25a83b5863d7cc02d4d0551 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 21:58:38 +0200 Subject: [PATCH 12/14] Resolve use of QIODevice::WriteOnly for Qt 6 --- src/CommandLineParser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CommandLineParser.cpp b/src/CommandLineParser.cpp index 5586a06..32cae18 100644 --- a/src/CommandLineParser.cpp +++ b/src/CommandLineParser.cpp @@ -327,7 +327,11 @@ CommandLineParser::~CommandLineParser() void CommandLineParser::usage(const QString &name, const QString &argumentDescription) { +#if QT_VERSION >= 0x060000 + QTextStream cout(stdout, QIODeviceBase::WriteOnly); +#else QTextStream cout(stdout, QIODevice::WriteOnly); +#endif cout << "Usage: " << d->argumentStrings[0]; if (! name.isEmpty()) cout << " " << name; From c32b1ee08966e2f86e5e4f5cc6c5839e6ebb75dc Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 27 Apr 2025 22:30:21 +0200 Subject: [PATCH 13/14] Require Qt >=5.14.0 for Qt::{KeepEmptyParts,SkipEmptyParts,endl} - https://doc.qt.io/qt-5/qt.html#SplitBehaviorFlags-enum - https://doc.qt.io/qt-5/qt.html#endl --- src/src.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/src.pro b/src/src.pro index 59e1f08..35c2b5b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -29,6 +29,12 @@ target.path = $$BINDIR DEPENDPATH += . QT = core +_MIN_QT_VERSION = 5.14.0 + +!versionAtLeast(QT_VERSION, $${_MIN_QT_VERSION}) { + error("Qt $${QT_VERSION} found but Qt >=$${_MIN_QT_VERSION} required, cannot continue.") +} + greaterThan(QT_MAJOR_VERSION, 5) { QT += core5compat } From 6333d1b917f26fa4ccd887761a466df59809e2e6 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Apr 2025 22:20:56 +0200 Subject: [PATCH 14/14] build.yaml: Cover both Qt 5 and Qt 6 --- .github/workflows/build.yaml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c20e3bf..e02f81c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -34,11 +34,23 @@ jobs: matrix: include: - runs-on: ubuntu-24.04 - qt: qt5-qmake + qt_major: 6 + qt_qmake: qmake6 + qt_packages: qmake6 qt6-base-dev qt6-5compat-dev + - runs-on: ubuntu-24.04 + qt_major: 5 + qt_qmake: qmake + qt_packages: qt5-qmake qtbase5-dev + - runs-on: ubuntu-22.04 + qt_major: 6 + qt_qmake: qmake6 + qt_packages: qmake6 qt6-base-dev libqt6core5compat6-dev - runs-on: ubuntu-22.04 - qt: qt5-qmake + qt_major: 5 + qt_qmake: qmake + qt_packages: qt5-qmake qtbase5-dev - name: Build (Linux, ${{ matrix.runs-on }}) + name: Build (Linux, ${{ matrix.runs-on }}, Qt ${{ matrix.qt_major }}) runs-on: ${{ matrix.runs-on }} steps: - name: 'Install build dependencies' @@ -49,8 +61,7 @@ jobs: build-essential \ libapr1-dev \ libsvn-dev \ - ${{ matrix.qt }} \ - qtbase5-dev \ + ${{ matrix.qt_packages }} \ subversion - name: 'Checkout Git branch' @@ -59,8 +70,10 @@ jobs: submodules: true - name: 'Configure' + env: + QMAKE: ${{ matrix.qt_qmake }} run: |- - qmake + ${QMAKE} - name: 'Build' run: |-