Qt6: resolve TODOs against missing KF6
- On FreeBSD, no KF6 was available - On KDE Neon Unstable, there are somewhat wonky KF6 packages available - Adjust CMake to find the KDE Neon versions, then fix the C++ code
This commit is contained in:
parent
4b3278058b
commit
8a8860e75c
@ -32,7 +32,7 @@
|
|||||||
# BUILD_<foo> : choose additional things to build
|
# BUILD_<foo> : choose additional things to build
|
||||||
# - TESTING (standard CMake option)
|
# - TESTING (standard CMake option)
|
||||||
# - SCHEMA_TESTING (requires Python, see ci/configvalidator.py)
|
# - SCHEMA_TESTING (requires Python, see ci/configvalidator.py)
|
||||||
# - KF5Crash (uses KCrash, rather than Calamares internal, for crash reporting)
|
# - BUILD_CRASH_REPORTING (uses KCrash, rather than Calamares internal, for crash reporting)
|
||||||
# DEBUG_<foo> : special developer flags for debugging.
|
# DEBUG_<foo> : special developer flags for debugging.
|
||||||
#
|
#
|
||||||
# Example usage:
|
# Example usage:
|
||||||
@ -85,7 +85,7 @@ option(WITH_QT6 "Use Qt6 instead of Qt5" OFF)
|
|||||||
# Additional parts to build that do not affect ABI
|
# Additional parts to build that do not affect ABI
|
||||||
option(BUILD_SCHEMA_TESTING "Enable schema-validation-tests" ON)
|
option(BUILD_SCHEMA_TESTING "Enable schema-validation-tests" ON)
|
||||||
# Options for the calamares executable
|
# Options for the calamares executable
|
||||||
option(BUILD_KF5Crash "Enable crash reporting with KCrash." ON)
|
option(BUILD_CRASH_REPORTING "Enable crash reporting with KCrash." ON)
|
||||||
|
|
||||||
# Possible debugging flags are:
|
# Possible debugging flags are:
|
||||||
# - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone
|
# - DEBUG_TIMEZONES draws latitude and longitude lines on the timezone
|
||||||
@ -166,21 +166,24 @@ set( _tx_incomplete eo es_PR gu ie ja-Hira kk kn lo lv mk ne_NP
|
|||||||
if(WITH_QT6)
|
if(WITH_QT6)
|
||||||
message(STATUS "Building Calamares with Qt6")
|
message(STATUS "Building Calamares with Qt6")
|
||||||
set(qtname "Qt6")
|
set(qtname "Qt6")
|
||||||
|
set(kfname "KF5")
|
||||||
set(QT_VERSION 6.5.0)
|
set(QT_VERSION 6.5.0)
|
||||||
|
set(ECM_VERSION 5.240)
|
||||||
|
set(KF_VERSION 5.103) # KDE Neon weirdness
|
||||||
# API that was deprecated before Qt 5.15 causes a compile error
|
# API that was deprecated before Qt 5.15 causes a compile error
|
||||||
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060400)
|
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060400)
|
||||||
|
|
||||||
set(BUILD_KF5Crash OFF) # TODO: Qt6
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "Building Calamares with Qt5")
|
message(STATUS "Building Calamares with Qt5")
|
||||||
set(qtname "Qt5")
|
set(qtname "Qt5")
|
||||||
|
set(kfname "KF5")
|
||||||
set(QT_VERSION 5.15.0)
|
set(QT_VERSION 5.15.0)
|
||||||
|
set(ECM_VERSION 5.100)
|
||||||
|
set(KF_VERSION 5.100)
|
||||||
# API that was deprecated before Qt 5.15 causes a compile error
|
# API that was deprecated before Qt 5.15 causes a compile error
|
||||||
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050f00)
|
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050f00)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BOOSTPYTHON_VERSION 1.72.0)
|
set(BOOSTPYTHON_VERSION 1.72.0)
|
||||||
set(ECM_VERSION 5.100)
|
|
||||||
set(PYTHONLIBS_VERSION 3.6)
|
set(PYTHONLIBS_VERSION 3.6)
|
||||||
set(YAMLCPP_VERSION 0.5.1)
|
set(YAMLCPP_VERSION 0.5.1)
|
||||||
|
|
||||||
@ -333,6 +336,7 @@ set_package_properties(
|
|||||||
# no need to mess with the module path after.
|
# no need to mess with the module path after.
|
||||||
find_package(ECM ${ECM_VERSION} NO_MODULE)
|
find_package(ECM ${ECM_VERSION} NO_MODULE)
|
||||||
if(ECM_FOUND)
|
if(ECM_FOUND)
|
||||||
|
message(STATUS "Found KDE ECM ${ECM_MODULE_PATH}")
|
||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
# ECM implies that we can build the tests, too
|
# ECM implies that we can build the tests, too
|
||||||
@ -342,20 +346,39 @@ if(ECM_FOUND)
|
|||||||
include(KDEInstallDirs)
|
include(KDEInstallDirs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(KF5 ${ECM_VERSION} QUIET COMPONENTS CoreAddons Crash)
|
find_package(${kfname} ${KF_VERSION} QUIET COMPONENTS CoreAddons)
|
||||||
set_package_properties(
|
set_package_properties(
|
||||||
KF5::CoreAddons
|
${kfname}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
TYPE REQUIRED
|
TYPE REQUIRED
|
||||||
DESCRIPTION "Classes built on QtCore for About Data"
|
DESCRIPTION "KDE Frameworks (CoreAddons)"
|
||||||
URL "https://api.kde.org/frameworks/kcoreaddons/"
|
URL "https://api.kde.org/frameworks/kcoreaddons/"
|
||||||
PURPOSE "About Calamares"
|
PURPOSE "About Calamares"
|
||||||
)
|
)
|
||||||
if(NOT KF5Crash_FOUND)
|
|
||||||
if(BUILD_KF5Crash)
|
feature_summary(
|
||||||
message(WARNING "BUILD_KF5Crash is set, but KF5::Crash is not available.")
|
WHAT REQUIRED_PACKAGES_NOT_FOUND
|
||||||
|
FATAL_ON_MISSING_REQUIRED_PACKAGES
|
||||||
|
DESCRIPTION "The following REQUIRED packages were not found:"
|
||||||
|
QUIET_ON_EMPTY
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# OPTIONAL DEPENDENCIES
|
||||||
|
#
|
||||||
|
# First, set KF back to optional so that any missing components don't trip us up.
|
||||||
|
set_package_properties(
|
||||||
|
${kfname}
|
||||||
|
PROPERTIES
|
||||||
|
TYPE OPTIONAL
|
||||||
|
)
|
||||||
|
find_package(${kfname} ${KF_VERSION} QUIET COMPONENTS CoreAddons Crash)
|
||||||
|
|
||||||
|
if(NOT TARGET ${kfname}::Crash)
|
||||||
|
if(BUILD_CRASH_REPORTING)
|
||||||
|
message(WARNING "BUILD_CRASH_REPORTING is set, but ${kfname}::Crash is not available.")
|
||||||
endif()
|
endif()
|
||||||
set(BUILD_KF5Crash OFF)
|
set(BUILD_CRASH_REPORTING OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Python ${PYTHONLIBS_VERSION} COMPONENTS Interpreter Development)
|
find_package(Python ${PYTHONLIBS_VERSION} COMPONENTS Interpreter Development)
|
||||||
@ -556,7 +579,7 @@ add_subdirectory(src)
|
|||||||
add_feature_info(Python ${WITH_PYTHON} "Python job modules")
|
add_feature_info(Python ${WITH_PYTHON} "Python job modules")
|
||||||
add_feature_info(Qml ${WITH_QML} "QML UI support")
|
add_feature_info(Qml ${WITH_QML} "QML UI support")
|
||||||
add_feature_info(Polkit ${INSTALL_POLKIT} "Install Polkit files")
|
add_feature_info(Polkit ${INSTALL_POLKIT} "Install Polkit files")
|
||||||
add_feature_info(KCrash ${BUILD_KF5Crash} "Crash dumps via KCrash")
|
add_feature_info(KCrash ${BUILD_CRASH_REPORTING} "Crash dumps via KCrash")
|
||||||
|
|
||||||
### CMake infrastructure installation
|
### CMake infrastructure installation
|
||||||
#
|
#
|
||||||
@ -640,9 +663,7 @@ endif()
|
|||||||
|
|
||||||
### CMAKE SUMMARY REPORT
|
### CMAKE SUMMARY REPORT
|
||||||
#
|
#
|
||||||
if(NOT WITH_QT6) # TODO: Qt6
|
|
||||||
get_directory_property(SKIPPED_MODULES DIRECTORY src/modules DEFINITION LIST_SKIPPED_MODULES)
|
get_directory_property(SKIPPED_MODULES DIRECTORY src/modules DEFINITION LIST_SKIPPED_MODULES)
|
||||||
endif()
|
|
||||||
calamares_explain_skipped_modules( ${SKIPPED_MODULES} )
|
calamares_explain_skipped_modules( ${SKIPPED_MODULES} )
|
||||||
|
|
||||||
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "The following features have been disabled:" QUIET_ON_EMPTY)
|
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "The following features have been disabled:" QUIET_ON_EMPTY)
|
||||||
|
@ -11,15 +11,18 @@
|
|||||||
# library, which will add definition WITHOUT_KPMcore.
|
# library, which will add definition WITHOUT_KPMcore.
|
||||||
#
|
#
|
||||||
if(NOT TARGET calapmcore)
|
if(NOT TARGET calapmcore)
|
||||||
find_package(KPMcore 20.04.0)
|
if(NOT WITH_QT6)
|
||||||
set_package_properties(
|
# TODO: Qt6 how to detect the version of Qt that KPMCore needs?
|
||||||
KPMcore
|
find_package(KPMcore 20.04.0)
|
||||||
PROPERTIES
|
set_package_properties(
|
||||||
URL "https://invent.kde.org/kde/kpmcore"
|
KPMcore
|
||||||
DESCRIPTION "KDE Partitioning library"
|
PROPERTIES
|
||||||
TYPE RECOMMENDED
|
URL "https://invent.kde.org/kde/kpmcore"
|
||||||
PURPOSE "For disk partitioning support"
|
DESCRIPTION "KDE Partitioning library"
|
||||||
)
|
TYPE RECOMMENDED
|
||||||
|
PURPOSE "For disk partitioning support"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Create an internal Calamares interface to KPMcore
|
# Create an internal Calamares interface to KPMcore
|
||||||
# and give it a nice alias name. If kpmcore is not found,
|
# and give it a nice alias name. If kpmcore is not found,
|
||||||
|
@ -40,12 +40,10 @@ target_link_libraries(
|
|||||||
calamares_bin
|
calamares_bin
|
||||||
PRIVATE calamares calamaresui calamares-i18n kdsingleapplication ${qtname}::Core ${qtname}::Widgets
|
PRIVATE calamares calamaresui calamares-i18n kdsingleapplication ${qtname}::Core ${qtname}::Widgets
|
||||||
)
|
)
|
||||||
if(NOT WITH_QT6) # TODO: Qt6
|
target_link_libraries(calamares_bin PRIVATE ${kfname}::CoreAddons)
|
||||||
target_link_libraries(calamares_bin PRIVATE KF5::CoreAddons)
|
if(BUILD_CRASH_REPORTING)
|
||||||
endif()
|
target_link_libraries(calamares_bin PRIVATE ${kfname}::Crash)
|
||||||
if(BUILD_KF5Crash)
|
target_compile_definitions(calamares_bin PRIVATE BUILD_CRASH_REPORTING)
|
||||||
target_link_libraries(calamares_bin PRIVATE KF5::Crash)
|
|
||||||
target_compile_definitions(calamares_bin PRIVATE BUILD_KF5Crash)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS calamares_bin BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS calamares_bin BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
@ -19,16 +19,9 @@
|
|||||||
// From 3rdparty/
|
// From 3rdparty/
|
||||||
#include "kdsingleapplication.h"
|
#include "kdsingleapplication.h"
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
|
#include <KAboutData>
|
||||||
// TODO: Qt6
|
#ifdef BUILD_CRASH_REPORTING
|
||||||
// Ignore KAboutData
|
#include <KCrash>
|
||||||
#define HAVE_KABOUTDATA 0
|
|
||||||
#else
|
|
||||||
#include <KCoreAddons/KAboutData>
|
|
||||||
#define HAVE_KABOUTDATA 1
|
|
||||||
#endif
|
|
||||||
#ifdef BUILD_KF5Crash
|
|
||||||
#include <KCrash/KCrash>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
@ -120,7 +113,6 @@ main( int argc, char* argv[] )
|
|||||||
#endif
|
#endif
|
||||||
CalamaresApplication a( argc, argv );
|
CalamaresApplication a( argc, argv );
|
||||||
|
|
||||||
#if HAVE_KABOUTDATA
|
|
||||||
KAboutData aboutData( "calamares",
|
KAboutData aboutData( "calamares",
|
||||||
"Calamares",
|
"Calamares",
|
||||||
a.applicationVersion(),
|
a.applicationVersion(),
|
||||||
@ -131,10 +123,9 @@ main( int argc, char* argv[] )
|
|||||||
"https://calamares.io",
|
"https://calamares.io",
|
||||||
"https://github.com/calamares/calamares/issues" );
|
"https://github.com/calamares/calamares/issues" );
|
||||||
KAboutData::setApplicationData( aboutData );
|
KAboutData::setApplicationData( aboutData );
|
||||||
#endif
|
|
||||||
a.setApplicationDisplayName( QString() ); // To avoid putting an extra "Calamares/" into the log-file
|
a.setApplicationDisplayName( QString() ); // To avoid putting an extra "Calamares/" into the log-file
|
||||||
|
|
||||||
#ifdef BUILD_KF5Crash
|
#ifdef BUILD_CRASH_REPORTING
|
||||||
KCrash::initialize();
|
KCrash::initialize();
|
||||||
// KCrash::setCrashHandler();
|
// KCrash::setCrashHandler();
|
||||||
KCrash::setDrKonqiEnabled( true );
|
KCrash::setDrKonqiEnabled( true );
|
||||||
|
@ -101,9 +101,7 @@ set_target_properties(
|
|||||||
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares
|
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares
|
||||||
)
|
)
|
||||||
target_link_libraries(calamares LINK_PUBLIC yamlcpp::yamlcpp ${qtname}::Core)
|
target_link_libraries(calamares LINK_PUBLIC yamlcpp::yamlcpp ${qtname}::Core)
|
||||||
if(NOT WITH_QT6) # TODO: Qt6
|
target_link_libraries(calamares LINK_PUBLIC ${kfname}::CoreAddons)
|
||||||
target_link_libraries(calamares LINK_PUBLIC KF5::CoreAddons)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
### OPTIONAL Automount support (requires dbus)
|
### OPTIONAL Automount support (requires dbus)
|
||||||
#
|
#
|
||||||
|
@ -11,16 +11,6 @@
|
|||||||
#include "StringExpander.h"
|
#include "StringExpander.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
|
|
||||||
// TODO: Qt6
|
|
||||||
KWordMacroExpander::~KWordMacroExpander() {};
|
|
||||||
bool
|
|
||||||
KWordMacroExpander::expandMacro( const QString& str, QStringList& ret )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
namespace String
|
namespace String
|
||||||
|
@ -13,44 +13,7 @@
|
|||||||
|
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
|
||||||
#include <KMacroExpander>
|
#include <KMacroExpander>
|
||||||
#else
|
|
||||||
// TODO: Qt6
|
|
||||||
//
|
|
||||||
// Mock up part of KF6
|
|
||||||
#include <QHash>
|
|
||||||
#include <QString>
|
|
||||||
class KMacroExpanderBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QString expandMacrosShellQuote( const QString& c ) { return c; }
|
|
||||||
};
|
|
||||||
class KMacroExpander
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static QString expandMacros( const QString& source, const QHash< QString, QString > dict, char sep )
|
|
||||||
{
|
|
||||||
return source;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
class KWordMacroExpander : public KMacroExpanderBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
KWordMacroExpander( QChar c )
|
|
||||||
: m_escape( c )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
virtual ~KWordMacroExpander();
|
|
||||||
virtual bool expandMacro( const QString& str, QStringList& ret );
|
|
||||||
void expandMacros( QString& s ) {}
|
|
||||||
|
|
||||||
QChar escapeChar() const { return m_escape; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
QChar m_escape;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
@ -56,12 +56,9 @@ calamares_add_library(calamaresui
|
|||||||
SOVERSION ${CALAMARES_SOVERSION}
|
SOVERSION ${CALAMARES_SOVERSION}
|
||||||
)
|
)
|
||||||
target_link_libraries(calamaresui PRIVATE yamlcpp::yamlcpp)
|
target_link_libraries(calamaresui PRIVATE yamlcpp::yamlcpp)
|
||||||
if(NOT WITH_QT6) # TODO: Qt6
|
target_compile_definitions(calamaresui PRIVATE WITH_KOSRelease)
|
||||||
if(KF5CoreAddons_FOUND AND KF5CoreAddons_VERSION VERSION_GREATER_EQUAL 5.58)
|
target_link_libraries(calamaresui PRIVATE ${kfname}::CoreAddons)
|
||||||
target_compile_definitions(calamaresui PRIVATE WITH_KOSRelease)
|
|
||||||
target_link_libraries(calamaresui PRIVATE KF5::CoreAddons)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(WITH_QML)
|
if(WITH_QML)
|
||||||
target_link_libraries(calamaresui PUBLIC ${qtname}::QuickWidgets)
|
target_link_libraries(calamaresui PUBLIC ${qtname}::QuickWidgets)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user