5 Commits

Author SHA1 Message Date
Adriaan de Groot
51e89e58dd CMake: bump version and requirements
Builds cleanly with Calamares 3.3.1
2024-01-12 23:15:55 +01:00
Adriaan de Groot
d8d5a1fb26 CMake: find Calamares first, then other bits 2024-01-09 23:10:38 +01:00
Adriaan de Groot
85f05e8121 Merge pull request #31 from Undef-a/wip/undef/fix-ftbfs
Fix failure to configure/build with newer CMake and Calamares 3.3.0
2024-01-09 23:06:45 +01:00
undef
c28c9b8114 Port modules to Calamares 3.3.0
Calamares 3.3.0 changed the import name and namespace of
CalamaresUtilsSystem and CalamaresUtilsGui.
2023-12-17 03:40:44 +00:00
undef
935f21ace5 CMakeLists: Copy KF CoreAddons and FeatureSummary imports from Calamares
Without these the package no-longer compiles with recent versions of
cmake.
2023-12-17 03:40:40 +00:00
9 changed files with 43 additions and 14 deletions

View File

@@ -32,6 +32,9 @@
# In this repository, there is just one "group" to which USE_* applies: # In this repository, there is just one "group" to which USE_* applies:
# USE_os : operating-system-specific modules. # USE_os : operating-system-specific modules.
# #
# There is a knob WITH_QT6 which can be used to build against Qt6 rather
# than Qt5. This must match what Calamares itself is built with.
#
### NOTES ### NOTES
# #
# Call this CMake file in script mode, e.g. `cmake -P CMakeLists.txt` # Call this CMake file in script mode, e.g. `cmake -P CMakeLists.txt`
@@ -40,7 +43,7 @@
# #
cmake_minimum_required(VERSION 3.16 FATAL_ERROR) cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set( CALAMARES_EXTENSIONS_VERSION 1.4.0 ) set( CALAMARES_EXTENSIONS_VERSION 3.3.1 )
include( ${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake ) include( ${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake )
if ( CMAKE_SCRIPT_MODE_FILE ) if ( CMAKE_SCRIPT_MODE_FILE )
@@ -60,7 +63,7 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON )
# consumers by loading the developer's config from a build # consumers by loading the developer's config from a build
# directory (which doesn't have the rest of the config # directory (which doesn't have the rest of the config
# installed inside it). # installed inside it).
set( CALAMARES_VERSION_REQUIRED 3.3.0 ) set( CALAMARES_VERSION_REQUIRED 3.3.1 )
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} NO_CMAKE_PACKAGE_REGISTRY) find_package(Calamares ${CALAMARES_VERSION_REQUIRED} NO_CMAKE_PACKAGE_REGISTRY)
if (NOT TARGET Calamares::calamares OR NOT TARGET Calamares::calamaresui) if (NOT TARGET Calamares::calamares OR NOT TARGET Calamares::calamaresui)
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} REQUIRED) find_package(Calamares ${CALAMARES_VERSION_REQUIRED} REQUIRED)
@@ -70,6 +73,32 @@ message(STATUS "Found Calamares version ${Calamares_VERSION}")
message(STATUS " libraries ${Calamares_LIB_DIRS}") message(STATUS " libraries ${Calamares_LIB_DIRS}")
message(STATUS "") message(STATUS "")
### EXTRACTING DEPENDENCIES AND CONFIGURATION FROM CALAMARES
#
#
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"
)
### CMAKE SETUP ### CMAKE SETUP
# #
# Enable IN_LIST # Enable IN_LIST

View File

@@ -18,7 +18,7 @@ Config::Config( QObject* parent )
void void
Config::setConfigurationMap( const QVariantMap& cfgMap ) Config::setConfigurationMap( const QVariantMap& cfgMap )
{ {
using namespace CalamaresUtils; using namespace Calamares;
if ( getBool( cfgMap, "bogus", false ) ) if ( getBool( cfgMap, "bogus", false ) )
{ {

View File

@@ -5,7 +5,7 @@
#include "GlobalStorage.h" #include "GlobalStorage.h"
#include "JobQueue.h" #include "JobQueue.h"
#include "Settings.h" #include "Settings.h"
#include "utils/CalamaresUtilsSystem.h" #include "utils/System.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include <QDir> #include <QDir>
@@ -75,7 +75,7 @@ Calamares::JobResult
PartitionJob::exec() PartitionJob::exec()
{ {
using namespace Calamares; using namespace Calamares;
using namespace CalamaresUtils; using namespace Calamares;
using namespace std; using namespace std;
const QString pathMount = "/mnt/install"; const QString pathMount = "/mnt/install";

View File

@@ -5,7 +5,7 @@
#include "GlobalStorage.h" #include "GlobalStorage.h"
#include "JobQueue.h" #include "JobQueue.h"
#include "Settings.h" #include "Settings.h"
#include "utils/CalamaresUtilsSystem.h" #include "utils/System.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include <QDir> #include <QDir>
@@ -47,7 +47,7 @@ Calamares::JobResult
UsersJob::exec() UsersJob::exec()
{ {
using namespace Calamares; using namespace Calamares;
using namespace CalamaresUtils; using namespace Calamares;
using namespace std; using namespace std;
QList< QPair< QStringList, QString > > commands = { QList< QPair< QStringList, QString > > commands = {

View File

@@ -62,7 +62,7 @@ FSArchiverRunner::checkPrerequisites( QString& fsarchiverExecutable ) const
Calamares::JobResult Calamares::JobResult
FSArchiverRunner::checkDestination( QString& destinationPath ) const FSArchiverRunner::checkDestination( QString& destinationPath ) const
{ {
destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); destinationPath = Calamares::System::instance()->targetPath( m_destination );
if ( destinationPath.isEmpty() ) if ( destinationPath.isEmpty() )
{ {
return Calamares::JobResult::internalError( return Calamares::JobResult::internalError(

View File

@@ -9,7 +9,7 @@
#include "Runners.h" #include "Runners.h"
#include <utils/CalamaresUtilsSystem.h> #include <utils/System.h>
#include <utils/Logger.h> #include <utils/Logger.h>
#include <QFileInfo> #include <QFileInfo>

View File

@@ -38,7 +38,7 @@ TarballRunner::run()
Calamares::JobResult::MissingRequirements ); Calamares::JobResult::MissingRequirements );
} }
const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); const QString destinationPath = Calamares::System::instance()->targetPath( m_destination );
if ( destinationPath.isEmpty() ) if ( destinationPath.isEmpty() )
{ {
return Calamares::JobResult::internalError( return Calamares::JobResult::internalError(

View File

@@ -101,8 +101,8 @@ UnpackFSCJob::exec()
void void
UnpackFSCJob::setConfigurationMap( const QVariantMap& map ) UnpackFSCJob::setConfigurationMap( const QVariantMap& map )
{ {
QString source = CalamaresUtils::getString( map, "source" ); QString source = Calamares::getString( map, "source" );
QString sourceTypeName = CalamaresUtils::getString( map, "sourcefs" ); QString sourceTypeName = Calamares::getString( map, "sourcefs" );
if ( source.isEmpty() || sourceTypeName.isEmpty() ) if ( source.isEmpty() || sourceTypeName.isEmpty() )
{ {
cWarning() << "Skipping item with bad source data:" << map; cWarning() << "Skipping item with bad source data:" << map;
@@ -115,7 +115,7 @@ UnpackFSCJob::setConfigurationMap( const QVariantMap& map )
cWarning() << "Skipping item with source type None"; cWarning() << "Skipping item with source type None";
return; return;
} }
QString destination = CalamaresUtils::getString( map, "destination" ); QString destination = Calamares::getString( map, "destination" );
if ( destination.isEmpty() ) if ( destination.isEmpty() )
{ {
cWarning() << "Skipping item with empty destination"; cWarning() << "Skipping item with empty destination";

View File

@@ -38,7 +38,7 @@ UnsquashRunner::run()
Calamares::JobResult::MissingRequirements ); Calamares::JobResult::MissingRequirements );
} }
const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); const QString destinationPath = Calamares::System::instance()->targetPath( m_destination );
if ( destinationPath.isEmpty() ) if ( destinationPath.isEmpty() )
{ {
return Calamares::JobResult::internalError( return Calamares::JobResult::internalError(