[welcome] Make libparted optional

- This turns off the space-available check in the welcome module;
   without libparted, always fail that check.
 - Allows running the welcome module on OS without libparted.
This commit is contained in:
Adriaan de Groot 2018-01-13 21:26:31 +01:00
parent b0c4fbc1bb
commit 2bc394656d
2 changed files with 18 additions and 7 deletions

View File

@ -1,20 +1,24 @@
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
find_package( LIBPARTED REQUIRED )
find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED DBus Network )
find_package( LIBPARTED )
if ( LIBPARTED_FOUND )
set( PARTMAN_SRC checker/partman_devices.c )
set( CHECKER_LINK_LIBRARIES ${LIBPARTED_LIBRARY} )
else()
set( PARTMAN_SRC )
set( CHECKER_LINK_LIBRARIES )
add_definitions( -DWITHOUT_LIBPARTED )
endif()
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
set( CHECKER_SOURCES
checker/CheckItemWidget.cpp
checker/CheckerWidget.cpp
checker/RequirementsChecker.cpp
checker/partman_devices.c
)
set( CHECKER_LINK_LIBRARIES
${LIBPARTED_LIBRARY}
Qt5::DBus
Qt5::Network
${PARTMAN_SRC}
)
calamares_add_plugin( welcome
@ -29,5 +33,7 @@ calamares_add_plugin( welcome
LINK_PRIVATE_LIBRARIES
calamaresui
${CHECKER_LINK_LIBRARIES}
Qt5::DBus
Qt5::Network
SHARED_LIB
)

View File

@ -313,7 +313,12 @@ RequirementsChecker::verdict() const
bool
RequirementsChecker::checkEnoughStorage( qint64 requiredSpace )
{
#ifdef WITHOUT_LIBPARTED
cDebug() << "WARNING: RequirementsChecker is configured without libparted.";
return false;
#else
return check_big_enough( requiredSpace );
#endif
}