Merge pull request #2011 from calamares/improve-kpmcore
Fix kpmcore detection and compilation on Debian-11
This commit is contained in:
commit
eef3bb19d3
2
.github/workflows/nightly-debian.yml
vendored
2
.github/workflows/nightly-debian.yml
vendored
@ -9,9 +9,7 @@ env:
|
|||||||
BUILDDIR: /build
|
BUILDDIR: /build
|
||||||
SRCDIR: ${{ github.workspace }}
|
SRCDIR: ${{ github.workspace }}
|
||||||
CMAKE_ARGS: |
|
CMAKE_ARGS: |
|
||||||
-DWEBVIEW_FORCE_WEBKIT=1
|
|
||||||
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
|
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
|
||||||
-DWITH_PYTHONQT=OFF"
|
|
||||||
-DCMAKE_BUILD_TYPE=Debug
|
-DCMAKE_BUILD_TYPE=Debug
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
2
.github/workflows/nightly-neon.yml
vendored
2
.github/workflows/nightly-neon.yml
vendored
@ -9,9 +9,7 @@ env:
|
|||||||
BUILDDIR: /build
|
BUILDDIR: /build
|
||||||
SRCDIR: ${{ github.workspace }}
|
SRCDIR: ${{ github.workspace }}
|
||||||
CMAKE_ARGS: |
|
CMAKE_ARGS: |
|
||||||
-DWEBVIEW_FORCE_WEBKIT=1
|
|
||||||
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
|
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
|
||||||
-DWITH_PYTHONQT=OFF"
|
|
||||||
-DCMAKE_BUILD_TYPE=Debug
|
-DCMAKE_BUILD_TYPE=Debug
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
2
.github/workflows/nightly-opensuse.yml
vendored
2
.github/workflows/nightly-opensuse.yml
vendored
@ -9,9 +9,7 @@ env:
|
|||||||
BUILDDIR: /build
|
BUILDDIR: /build
|
||||||
SRCDIR: ${{ github.workspace }}
|
SRCDIR: ${{ github.workspace }}
|
||||||
CMAKE_ARGS: |
|
CMAKE_ARGS: |
|
||||||
-DWEBVIEW_FORCE_WEBKIT=1
|
|
||||||
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
|
-DKDE_INSTALL_USE_QT_SYS_PATHS=ON
|
||||||
-DWITH_PYTHONQT=OFF"
|
|
||||||
-DCMAKE_BUILD_TYPE=Debug
|
-DCMAKE_BUILD_TYPE=Debug
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -7,21 +7,49 @@
|
|||||||
#
|
#
|
||||||
# Finds KPMcore and consistently sets API flags based on the version.
|
# Finds KPMcore and consistently sets API flags based on the version.
|
||||||
#
|
#
|
||||||
if ( NOT KPMcore_searched_for )
|
# If KPMcore is not found, still create calamares::kpmcore interface
|
||||||
|
# library, which will add definition WITHOUT_KPMcore.
|
||||||
|
#
|
||||||
|
if(NOT KPMcore_searched_for AND NOT TARGET calapmcore)
|
||||||
set(KPMcore_searched_for TRUE)
|
set(KPMcore_searched_for TRUE)
|
||||||
|
|
||||||
find_package( KPMcore 21.12.0 )
|
find_package(KPMcore 20.04.0)
|
||||||
set_package_properties(
|
set_package_properties(
|
||||||
KPMcore PROPERTIES
|
KPMcore
|
||||||
|
PROPERTIES
|
||||||
URL "https://invent.kde.org/kde/kpmcore"
|
URL "https://invent.kde.org/kde/kpmcore"
|
||||||
DESCRIPTION "KDE Partitioning library"
|
DESCRIPTION "KDE Partitioning library"
|
||||||
TYPE RECOMMENDED
|
TYPE RECOMMENDED
|
||||||
PURPOSE "For disk partitioning support"
|
PURPOSE "For disk partitioning support"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Create an internal Calamares interface to KPMcore
|
||||||
|
# and give it a nice alias name. If kpmcore is not found,
|
||||||
|
# then make a "no KPMcore" library.
|
||||||
|
add_library(calapmcore INTERFACE)
|
||||||
|
|
||||||
if(KPMcore_FOUND)
|
if(KPMcore_FOUND)
|
||||||
|
find_package(Qt5 REQUIRED DBus) # Needed for KPMCore
|
||||||
|
find_package(KF5 REQUIRED I18n WidgetsAddons) # Needed for KPMCore
|
||||||
|
|
||||||
|
target_link_libraries(calapmcore INTERFACE kpmcore Qt5::DBus KF5::I18n KF5::WidgetsAddons)
|
||||||
|
target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR})
|
||||||
set(KPMcore_API_DEFINITIONS "")
|
set(KPMcore_API_DEFINITIONS "")
|
||||||
else()
|
else()
|
||||||
set(KPMcore_API_DEFINITIONS WITHOUT_KPMcore)
|
set(KPMcore_API_DEFINITIONS WITHOUT_KPMcore)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
foreach(d ${KPMcore_API_DEFINITIONS})
|
||||||
|
target_compile_definitions(calapmcore INTERFACE ${d})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
add_library(calamares::kpmcore ALIAS calapmcore)
|
||||||
|
else()
|
||||||
|
if(TARGET calapmcore)
|
||||||
|
message(STATUS "KPMcore has already been found")
|
||||||
|
set(KPMcore_FOUND TRUE)
|
||||||
|
else()
|
||||||
|
message(STATUS "KPMcore has been searched-for and not found")
|
||||||
|
set(KPMcore_FOUND FALSE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -130,13 +130,6 @@ endif()
|
|||||||
include(KPMcoreHelper)
|
include(KPMcoreHelper)
|
||||||
|
|
||||||
if(KPMcore_FOUND)
|
if(KPMcore_FOUND)
|
||||||
find_package(Qt5 REQUIRED DBus) # Needed for KPMCore
|
|
||||||
find_package(KF5 REQUIRED I18n WidgetsAddons) # Needed for KPMCore
|
|
||||||
|
|
||||||
foreach(d ${KPMcore_API_DEFINITIONS})
|
|
||||||
add_definitions(-D${d})
|
|
||||||
endforeach()
|
|
||||||
include_directories(${KPMCORE_INCLUDE_DIR})
|
|
||||||
target_sources(
|
target_sources(
|
||||||
calamares
|
calamares
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@ -145,7 +138,7 @@ if(KPMcore_FOUND)
|
|||||||
partition/PartitionIterator.cpp
|
partition/PartitionIterator.cpp
|
||||||
partition/PartitionQuery.cpp
|
partition/PartitionQuery.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(calamares PRIVATE kpmcore)
|
target_link_libraries(calamares PRIVATE calamares::kpmcore)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
### LIBRARY
|
### LIBRARY
|
||||||
@ -260,8 +253,8 @@ calamares_add_test(libcalamaresnetworktest SOURCES network/Tests.cpp)
|
|||||||
calamares_add_test(libcalamarespackagestest SOURCES packages/Tests.cpp)
|
calamares_add_test(libcalamarespackagestest SOURCES packages/Tests.cpp)
|
||||||
|
|
||||||
if(KPMcore_FOUND)
|
if(KPMcore_FOUND)
|
||||||
calamares_add_test(libcalamarespartitiontest SOURCES partition/Global.cpp partition/Tests.cpp LIBRARIES kpmcore)
|
calamares_add_test(libcalamarespartitiontest SOURCES partition/Global.cpp partition/Tests.cpp LIBRARIES calamares::kpmcore)
|
||||||
calamares_add_test(libcalamarespartitionkpmtest SOURCES partition/KPMTests.cpp LIBRARIES kpmcore)
|
calamares_add_test(libcalamarespartitionkpmtest SOURCES partition/KPMTests.cpp LIBRARIES calamares::kpmcore)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
calamares_add_test(libcalamaresutilstest SOURCES utils/Tests.cpp utils/Runner.cpp)
|
calamares_add_test(libcalamaresutilstest SOURCES utils/Tests.cpp utils/Runner.cpp)
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#include "FileSystem.h"
|
#include "FileSystem.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
|
|
||||||
|
// TODO: this assumes KPMcore is present, but the header and TU
|
||||||
|
// are used always.
|
||||||
#include <kpmcore/fs/filesystem.h>
|
#include <kpmcore/fs/filesystem.h>
|
||||||
|
|
||||||
namespace CalamaresUtils
|
namespace CalamaresUtils
|
||||||
|
@ -9,7 +9,7 @@ find_package(KF5WidgetsAddons CONFIG)
|
|||||||
|
|
||||||
include(KPMcoreHelper)
|
include(KPMcoreHelper)
|
||||||
|
|
||||||
if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND)
|
if(KPMcore_FOUND)
|
||||||
include_directories(${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition)
|
include_directories(${KPMCORE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/modules/partition)
|
||||||
|
|
||||||
# The PartitionIterator is a small class, and it's easiest -- but also a
|
# The PartitionIterator is a small class, and it's easiest -- but also a
|
||||||
@ -20,7 +20,7 @@ if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND)
|
|||||||
SOURCES
|
SOURCES
|
||||||
ResizeFSJob.cpp
|
ResizeFSJob.cpp
|
||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
kpmcore
|
calamares::kpmcore
|
||||||
COMPILE_DEFINITIONS ${KPMcore_API_DEFINITIONS}
|
COMPILE_DEFINITIONS ${KPMcore_API_DEFINITIONS}
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
@ -49,9 +49,7 @@ find_package(KF5Config CONFIG)
|
|||||||
find_package(KF5I18n CONFIG)
|
find_package(KF5I18n CONFIG)
|
||||||
find_package(KF5WidgetsAddons CONFIG)
|
find_package(KF5WidgetsAddons CONFIG)
|
||||||
|
|
||||||
if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND)
|
if(KPMcore_FOUND)
|
||||||
list(APPEND _partition_defs ${KPMcore_API_DEFINITIONS})
|
|
||||||
include_directories(${KPMCORE_INCLUDE_DIR})
|
|
||||||
include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui)
|
include_directories(${PROJECT_BINARY_DIR}/src/libcalamaresui)
|
||||||
|
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
@ -118,7 +116,7 @@ if(KPMcore_FOUND AND Qt5DBus_FOUND AND KF5CoreAddons_FOUND AND KF5Config_FOUND)
|
|||||||
gui/ReplaceWidget.ui
|
gui/ReplaceWidget.ui
|
||||||
gui/VolumeGroupBaseDialog.ui
|
gui/VolumeGroupBaseDialog.ui
|
||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
kpmcore
|
calamares::kpmcore
|
||||||
KF5::CoreAddons
|
KF5::CoreAddons
|
||||||
COMPILE_DEFINITIONS ${_partition_defs}
|
COMPILE_DEFINITIONS ${_partition_defs}
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
|
@ -25,14 +25,14 @@ calamares_add_test(
|
|||||||
${PartitionModule_SOURCE_DIR}/jobs/DeletePartitionJob.cpp
|
${PartitionModule_SOURCE_DIR}/jobs/DeletePartitionJob.cpp
|
||||||
${PartitionModule_SOURCE_DIR}/jobs/PartitionJob.cpp
|
${PartitionModule_SOURCE_DIR}/jobs/PartitionJob.cpp
|
||||||
${PartitionModule_SOURCE_DIR}/jobs/ResizePartitionJob.cpp
|
${PartitionModule_SOURCE_DIR}/jobs/ResizePartitionJob.cpp
|
||||||
LIBRARIES kpmcore
|
LIBRARIES calamares::kpmcore
|
||||||
DEFINITIONS ${_partition_defs}
|
DEFINITIONS ${_partition_defs}
|
||||||
)
|
)
|
||||||
|
|
||||||
calamares_add_test(
|
calamares_add_test(
|
||||||
partitionclearmountsjobtest
|
partitionclearmountsjobtest
|
||||||
SOURCES ${PartitionModule_SOURCE_DIR}/jobs/ClearMountsJob.cpp ClearMountsJobTests.cpp
|
SOURCES ${PartitionModule_SOURCE_DIR}/jobs/ClearMountsJob.cpp ClearMountsJobTests.cpp
|
||||||
LIBRARIES kpmcore
|
LIBRARIES calamares::kpmcore
|
||||||
DEFINITIONS ${_partition_defs}
|
DEFINITIONS ${_partition_defs}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ calamares_add_test(
|
|||||||
${PartitionModule_SOURCE_DIR}/core/PartitionLayout.cpp
|
${PartitionModule_SOURCE_DIR}/core/PartitionLayout.cpp
|
||||||
${PartitionModule_SOURCE_DIR}/core/PartUtils.cpp
|
${PartitionModule_SOURCE_DIR}/core/PartUtils.cpp
|
||||||
${PartitionModule_SOURCE_DIR}/core/DeviceModel.cpp
|
${PartitionModule_SOURCE_DIR}/core/DeviceModel.cpp
|
||||||
LIBRARIES kpmcore Calamares::calamaresui
|
LIBRARIES calamares::kpmcore Calamares::calamaresui
|
||||||
DEFINITIONS ${_partition_defs}
|
DEFINITIONS ${_partition_defs}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -58,6 +58,6 @@ calamares_add_test(
|
|||||||
calamares_add_test(
|
calamares_add_test(
|
||||||
partitiondevicestest
|
partitiondevicestest
|
||||||
SOURCES DevicesTests.cpp ${PartitionModule_SOURCE_DIR}/core/DeviceList.cpp
|
SOURCES DevicesTests.cpp ${PartitionModule_SOURCE_DIR}/core/DeviceList.cpp
|
||||||
LIBRARIES kpmcore
|
LIBRARIES calamares::kpmcore
|
||||||
DEFINITIONS ${_partition_defs}
|
DEFINITIONS ${_partition_defs}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user