From 935f21ace598ec4fc64ed5b20cc2743cf2120a72 Mon Sep 17 00:00:00 2001 From: undef Date: Sun, 17 Dec 2023 03:32:32 +0000 Subject: [PATCH 1/2] CMakeLists: Copy KF CoreAddons and FeatureSummary imports from Calamares Without these the package no-longer compiles with recent versions of cmake. --- CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a52f5ca..a35be16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,28 @@ project(calamares-extensions set( CMAKE_CXX_STANDARD 17 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) +if(WITH_QT6) + set(kfname "KF6") + set(KF_VERSION 5.240) # KDE Neon weirdness +else() + message(STATUS "Building Calamares with Qt5") + set(kfname "KF5") + set(KF_VERSION 5.78) + # API that was deprecated before Qt 5.15 causes a compile error + add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050f00) +endif() + +include( FeatureSummary ) +find_package(${kfname}CoreAddons ${KF_VERSION} QUIET) +set_package_properties( + ${kfname}CoreAddons + PROPERTIES + TYPE REQUIRED + DESCRIPTION "KDE Framework CoreAddons" + URL "https://api.kde.org/frameworks/" + PURPOSE "Essential Framework for AboutData and Macros" +) + # On developer's machine, the user package registry breaks # consumers by loading the developer's config from a build # directory (which doesn't have the rest of the config From c28c9b8114a1ccb3eb080a91f8d9d9b96e429f14 Mon Sep 17 00:00:00 2001 From: undef Date: Sun, 17 Dec 2023 03:34:10 +0000 Subject: [PATCH 2/2] Port modules to Calamares 3.3.0 Calamares 3.3.0 changed the import name and namespace of CalamaresUtilsSystem and CalamaresUtilsGui. --- modules/mobile/Config.cpp | 2 +- modules/mobile/PartitionJob.cpp | 4 ++-- modules/mobile/UsersJob.cpp | 4 ++-- modules/unpackfsc/FSArchiverRunner.cpp | 2 +- modules/unpackfsc/Runners.cpp | 2 +- modules/unpackfsc/TarballRunner.cpp | 2 +- modules/unpackfsc/UnpackFSCJob.cpp | 6 +++--- modules/unpackfsc/UnsquashRunner.cpp | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/mobile/Config.cpp b/modules/mobile/Config.cpp index 145aa8a..93bbfd8 100644 --- a/modules/mobile/Config.cpp +++ b/modules/mobile/Config.cpp @@ -18,7 +18,7 @@ Config::Config( QObject* parent ) void Config::setConfigurationMap( const QVariantMap& cfgMap ) { - using namespace CalamaresUtils; + using namespace Calamares; if ( getBool( cfgMap, "bogus", false ) ) { diff --git a/modules/mobile/PartitionJob.cpp b/modules/mobile/PartitionJob.cpp index db2e5bb..ecb6ad9 100644 --- a/modules/mobile/PartitionJob.cpp +++ b/modules/mobile/PartitionJob.cpp @@ -5,7 +5,7 @@ #include "GlobalStorage.h" #include "JobQueue.h" #include "Settings.h" -#include "utils/CalamaresUtilsSystem.h" +#include "utils/System.h" #include "utils/Logger.h" #include @@ -75,7 +75,7 @@ Calamares::JobResult PartitionJob::exec() { using namespace Calamares; - using namespace CalamaresUtils; + using namespace Calamares; using namespace std; const QString pathMount = "/mnt/install"; diff --git a/modules/mobile/UsersJob.cpp b/modules/mobile/UsersJob.cpp index abe4be4..7d637d6 100644 --- a/modules/mobile/UsersJob.cpp +++ b/modules/mobile/UsersJob.cpp @@ -5,7 +5,7 @@ #include "GlobalStorage.h" #include "JobQueue.h" #include "Settings.h" -#include "utils/CalamaresUtilsSystem.h" +#include "utils/System.h" #include "utils/Logger.h" #include @@ -47,7 +47,7 @@ Calamares::JobResult UsersJob::exec() { using namespace Calamares; - using namespace CalamaresUtils; + using namespace Calamares; using namespace std; QList< QPair< QStringList, QString > > commands = { diff --git a/modules/unpackfsc/FSArchiverRunner.cpp b/modules/unpackfsc/FSArchiverRunner.cpp index 6fb3a56..9f1254c 100644 --- a/modules/unpackfsc/FSArchiverRunner.cpp +++ b/modules/unpackfsc/FSArchiverRunner.cpp @@ -62,7 +62,7 @@ FSArchiverRunner::checkPrerequisites( QString& fsarchiverExecutable ) const Calamares::JobResult FSArchiverRunner::checkDestination( QString& destinationPath ) const { - destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); + destinationPath = Calamares::System::instance()->targetPath( m_destination ); if ( destinationPath.isEmpty() ) { return Calamares::JobResult::internalError( diff --git a/modules/unpackfsc/Runners.cpp b/modules/unpackfsc/Runners.cpp index a2a810b..3b38622 100644 --- a/modules/unpackfsc/Runners.cpp +++ b/modules/unpackfsc/Runners.cpp @@ -9,7 +9,7 @@ #include "Runners.h" -#include +#include #include #include diff --git a/modules/unpackfsc/TarballRunner.cpp b/modules/unpackfsc/TarballRunner.cpp index abb8d1e..79dbec9 100644 --- a/modules/unpackfsc/TarballRunner.cpp +++ b/modules/unpackfsc/TarballRunner.cpp @@ -38,7 +38,7 @@ TarballRunner::run() Calamares::JobResult::MissingRequirements ); } - const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); + const QString destinationPath = Calamares::System::instance()->targetPath( m_destination ); if ( destinationPath.isEmpty() ) { return Calamares::JobResult::internalError( diff --git a/modules/unpackfsc/UnpackFSCJob.cpp b/modules/unpackfsc/UnpackFSCJob.cpp index f1f9c27..832abff 100644 --- a/modules/unpackfsc/UnpackFSCJob.cpp +++ b/modules/unpackfsc/UnpackFSCJob.cpp @@ -101,8 +101,8 @@ UnpackFSCJob::exec() void UnpackFSCJob::setConfigurationMap( const QVariantMap& map ) { - QString source = CalamaresUtils::getString( map, "source" ); - QString sourceTypeName = CalamaresUtils::getString( map, "sourcefs" ); + QString source = Calamares::getString( map, "source" ); + QString sourceTypeName = Calamares::getString( map, "sourcefs" ); if ( source.isEmpty() || sourceTypeName.isEmpty() ) { cWarning() << "Skipping item with bad source data:" << map; @@ -115,7 +115,7 @@ UnpackFSCJob::setConfigurationMap( const QVariantMap& map ) cWarning() << "Skipping item with source type None"; return; } - QString destination = CalamaresUtils::getString( map, "destination" ); + QString destination = Calamares::getString( map, "destination" ); if ( destination.isEmpty() ) { cWarning() << "Skipping item with empty destination"; diff --git a/modules/unpackfsc/UnsquashRunner.cpp b/modules/unpackfsc/UnsquashRunner.cpp index e6f2350..b3712b9 100644 --- a/modules/unpackfsc/UnsquashRunner.cpp +++ b/modules/unpackfsc/UnsquashRunner.cpp @@ -38,7 +38,7 @@ UnsquashRunner::run() Calamares::JobResult::MissingRequirements ); } - const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); + const QString destinationPath = Calamares::System::instance()->targetPath( m_destination ); if ( destinationPath.isEmpty() ) { return Calamares::JobResult::internalError(