Merge branch 'master' of https://github.com/calamares/calamares into development

This commit is contained in:
Philip Müller 2020-06-15 12:10:15 +02:00
commit 216caf9130
35 changed files with 298 additions and 210 deletions

1
.gitignore vendored
View File

@ -50,3 +50,4 @@ CMakeLists.txt.user
# Kate # Kate
*.kate-swp *.kate-swp
tags

12
CHANGES
View File

@ -6,14 +6,18 @@ website will have to do for older versions.
# 3.2.26 (unreleased) # # 3.2.26 (unreleased) #
This release contains contributions from (alphabetically by first name): This release contains contributions from (alphabetically by first name):
- No external contributors yet - Pablo Ovelleiro Corral
## Core ## ## Core ##
- No core changes yet - External modules can now be built again, outside of the Calamares
source and build-tree.
## Modules ## ## Modules ##
- No module changes yet - *locale* put some more places into the correct timezone **visually**;
for instance Norfolk Island gave up UTC+11.5 in 2015 and is now
UTC+11, but Calamares still showed it in a zone separate from UTC+11.
- *packages* gained support for the Void Linux package manager,
*xbps*. (thanks Pablo)
# 3.2.25 (2020-06-06) # # 3.2.25 (2020-06-06) #

View File

@ -162,7 +162,13 @@ if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
) )
endif() endif()
# CMake Modules
include( CMakePackageConfigHelpers )
include( CTest ) include( CTest )
include( FeatureSummary )
# Calamares Modules
include( CMakeColors )
### C++ SETUP ### C++ SETUP
# #
@ -248,9 +254,6 @@ if( CMAKE_COMPILER_IS_GNUCXX )
endif() endif()
endif() endif()
include( FeatureSummary )
include( CMakeColors )
### DEPENDENCIES ### DEPENDENCIES
# #
@ -520,16 +523,10 @@ endif()
# make predefined install dirs available everywhere # make predefined install dirs available everywhere
include( GNUInstallDirs ) include( GNUInstallDirs )
# make uninstall support # This is used by CalamaresAddLibrary; once Calamares is installed,
configure_file( # the CalamaresConfig.cmake module sets this variable to the IMPORTED
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" # libraries for Calamares.
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" set( Calamares_LIBRARIES calamares )
IMMEDIATE @ONLY
)
# Early configure these files as we need them later on
set( CALAMARES_CMAKE_DIR "${CMAKE_SOURCE_DIR}/CMakeModules" )
set( CALAMARES_LIBRARIES calamares )
add_subdirectory( src ) add_subdirectory( src )
@ -539,32 +536,39 @@ add_feature_info(Config ${INSTALL_CONFIG} "Install Calamares configuration")
add_feature_info(KCrash ${WITH_KF5Crash} "Crash dumps via KCrash") add_feature_info(KCrash ${WITH_KF5Crash} "Crash dumps via KCrash")
add_feature_info(KDBusAddons ${WITH_KF5DBus} "Unique-application via DBus") add_feature_info(KDBusAddons ${WITH_KF5DBus} "Unique-application via DBus")
# Add all targets to the build-tree export set ### CMake infrastructure installation
#
#
set( CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Calamares" CACHE PATH "Installation directory for CMake files" ) set( CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Calamares" CACHE PATH "Installation directory for CMake files" )
set( CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" ) set( CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" )
export( TARGETS calamares
FILE "${PROJECT_BINARY_DIR}/CalamaresLibraryDepends.cmake" )
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export( PACKAGE Calamares ) export( PACKAGE Calamares )
configure_package_config_file(
# Create a CalamaresBuildTreeSettings.cmake file for the use from the build tree "CalamaresConfig.cmake.in"
configure_file( CalamaresBuildTreeSettings.cmake.in "${PROJECT_BINARY_DIR}/CalamaresBuildTreeSettings.cmake" @ONLY ) "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
# Create the CalamaresConfig.cmake and CalamaresConfigVersion files PATH_VARS
file( RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMAKE_INSTALL_FULL_INCLUDEDIR}" ) CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_LIBDIR
configure_file( CalamaresConfig.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake" @ONLY ) CMAKE_INSTALL_DATADIR
configure_file( CalamaresConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake" @ONLY ) )
configure_file( CalamaresUse.cmake.in "${PROJECT_BINARY_DIR}/CalamaresUse.cmake" @ONLY ) write_basic_package_version_file(
${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(
EXPORT Calamares
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
FILE "CalamaresTargets.cmake"
NAMESPACE Calamares::
)
# Install the cmake files # Install the cmake files
install( install(
FILES FILES
"${PROJECT_BINARY_DIR}/CalamaresConfig.cmake" "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"
"${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake" "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/CalamaresUse.cmake"
"CMakeModules/CalamaresAddBrandingSubdirectory.cmake" "CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
"CMakeModules/CalamaresAddLibrary.cmake" "CMakeModules/CalamaresAddLibrary.cmake"
"CMakeModules/CalamaresAddModuleSubdirectory.cmake" "CMakeModules/CalamaresAddModuleSubdirectory.cmake"
@ -573,48 +577,36 @@ install(
"CMakeModules/CalamaresAddTranslations.cmake" "CMakeModules/CalamaresAddTranslations.cmake"
"CMakeModules/CalamaresAutomoc.cmake" "CMakeModules/CalamaresAutomoc.cmake"
"CMakeModules/CMakeColors.cmake" "CMakeModules/CMakeColors.cmake"
"CMakeModules/FindYAMLCPP.cmake"
DESTINATION DESTINATION
"${CMAKE_INSTALL_CMAKEDIR}" "${CMAKE_INSTALL_CMAKEDIR}"
) )
# Install the export set for use with the install-tree ### Miscellaneous installs
install( #
EXPORT #
CalamaresLibraryDepends
DESTINATION
"${CMAKE_INSTALL_CMAKEDIR}"
)
if( INSTALL_CONFIG ) if( INSTALL_CONFIG )
install( install(
FILES FILES settings.conf
settings.conf DESTINATIONshare/calamares
DESTINATION
share/calamares
) )
endif() endif()
if( INSTALL_POLKIT ) if( INSTALL_POLKIT )
install( install(
FILES FILES com.github.calamares.calamares.policy
com.github.calamares.calamares.policy DESTINATION "${POLKITQT-1_POLICY_FILES_INSTALL_DIR}"
DESTINATION
"${POLKITQT-1_POLICY_FILES_INSTALL_DIR}"
) )
endif() endif()
install( install(
FILES FILES calamares.desktop
calamares.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
DESTINATION
${CMAKE_INSTALL_DATADIR}/applications
) )
install( install(
FILES FILES man/calamares.8
man/calamares.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/
DESTINATION
${CMAKE_INSTALL_MANDIR}/man8/
) )
# uninstall target # uninstall target

View File

@ -93,11 +93,10 @@ function(calamares_add_library)
# add link targets # add link targets
target_link_libraries(${target} target_link_libraries(${target}
LINK_PUBLIC ${CALAMARES_LIBRARIES} LINK_PUBLIC ${Calamares_LIBRARIES}
Qt5::Core Qt5::Core
Qt5::Gui Qt5::Gui
Qt5::Widgets Qt5::Widgets
${LIBRARY_QT5_MODULES}
) )
if(LIBRARY_LINK_LIBRARIES) if(LIBRARY_LINK_LIBRARIES)
target_link_libraries(${target} LINK_PUBLIC ${LIBRARY_LINK_LIBRARIES}) target_link_libraries(${target} LINK_PUBLIC ${LIBRARY_LINK_LIBRARIES})

View File

@ -1,4 +0,0 @@
set(CALAMARES_INCLUDE_DIRS
"@PROJECT_SOURCE_DIR@/src/libcalamares"
"@PROJECT_BINARY_DIR@/src/libcalamares"
)

View File

@ -1,32 +1,78 @@
# Config file for the Calamares package # Config file for the Calamares package
# #
# It defines the following variables # The following IMPORTED targets are defined:
# CALAMARES_INCLUDE_DIRS - include directories for Calamares # - Calamares::calamares - the core library
# CALAMARES_LIBRARIES - libraries to link against # - Calamares::calamaresui - the UI (and QML) library
# CALAMARES_USE_FILE - name of a convenience include
# CALAMARES_APPLICATION_NAME - human-readable application name
#
# Typical use is:
#
# find_package(Calamares REQUIRED)
# include("${CALAMARES_USE_FILE}")
# #
# For legacy use it defines the following variables:
# - Calamares_INCLUDE_DIRS - include directories for Calamares
# - Calamares_LIB_DIRS - library directories
# - Calamares_LIBRARIES - libraries to link against
# Compute paths @PACKAGE_INIT@
get_filename_component(CALAMARES_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(EXISTS "${CALAMARES_CMAKE_DIR}/CMakeCache.txt") ### Versioning and IMPORTED targets
# In build tree #
include("${CALAMARES_CMAKE_DIR}/CalamaresBuildTreeSettings.cmake") #
else() include(${CMAKE_CURRENT_LIST_DIR}/CalamaresConfigVersion.cmake)
set(CALAMARES_INCLUDE_DIRS "${CALAMARES_CMAKE_DIR}/@CONF_REL_INCLUDE_DIR@/libcalamares") include(${CMAKE_CURRENT_LIST_DIR}/CalamaresTargets.cmake)
### Dependencies
#
# The libraries can depend on a variety of Qt and KDE Frameworks
# components, so accumulate them and find (just once).
#
macro(accumulate_deps outvar target namespace)
string(LENGTH ${namespace} _nslen)
get_target_property(_libs ${target} INTERFACE_LINK_LIBRARIES)
foreach(_lib ${_libs})
if (_lib MATCHES ^${namespace})
string(SUBSTRING ${_lib} ${_nslen} -1 _component)
list(APPEND ${outvar} ${_component})
endif()
endforeach()
endmacro()
# Qt5 infrastructure for translations is required
set(qt5_required Core Widgets LinguistTools)
accumulate_deps(qt5_required Calamares::calamares Qt5::)
accumulate_deps(qt5_required Calamares::calamaresui Qt5::)
find_package(Qt5 CONFIG REQUIRED ${qt5_required})
set(kf5_required "")
accumulate_deps(kf5_required Calamares::calamares KF5::)
accumulate_deps(kf5_required Calamares::calamaresui KF5::)
if(kf5_required)
find_package(ECM ${ECM_VERSION} NO_MODULE)
if( ECM_FOUND )
list(PREPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
find_package(KF5 REQUIRED COMPONENTS ${kf5_required})
endif()
endif() endif()
# Our library dependencies (contains definitions for IMPORTED targets) ### Legacy support
include("${CALAMARES_CMAKE_DIR}/CalamaresLibraryDepends.cmake") #
#
set(Calamares_LIB_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
set(Calamares_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set(Calamares_LIBRARIES Calamares::calamares)
# These are IMPORTED targets created by CalamaresLibraryDepends.cmake ### CMake support
set(CALAMARES_LIBRARIES calamares) #
#
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
# Convenience variables include(CalamaresAddBrandingSubdirectory)
set(CALAMARES_USE_FILE "${CALAMARES_CMAKE_DIR}/CalamaresUse.cmake") include(CalamaresAddLibrary)
set(CALAMARES_APPLICATION_NAME "Calamares") include(CalamaresAddModuleSubdirectory)
include(CalamaresAddPlugin)
# These are feature-settings that affect consumers of Calamares
# libraries as well; without Python-support in the libs, for instance,
# there's no point in having a Python plugin.
#
# This list should match the one in libcalamares/CalamaresConfig.h,
# which is the C++-language side of the same configuration.
set(Calamares_WITH_PYTHON @WITH_PYTHON@)
set(Calamares_WITH_PYTHONQT @WITH_PYTHONQT@)
set(Calamares_WITH_QML @WITH_QML@)

View File

@ -1,12 +0,0 @@
set(PACKAGE_VERSION "@CALAMARES_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

View File

@ -1,29 +0,0 @@
# A setup-cmake-things-for-Calamares module.
#
# This module handles looking for dependencies and including
# all of the Calamares macro modules, so that you can focus
# on just using the macros to build Calamares modules.
# Typical use looks like this:
#
# ```
# find_package( Calamares REQUIRED )
# include( "${CALAMARES_CMAKE_DIR}/CalamaresUse.cmake" )
# ```
#
# The first CMake command finds Calamares (which will contain
# this file), then adds the found location to the search path,
# and then includes this file. After that, you can use
# Calamares module and plugin macros.
if( NOT CALAMARES_CMAKE_DIR )
message( FATAL_ERROR "Use find_package(Calamares) first." )
endif()
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CALAMARES_CMAKE_DIR} )
find_package( Qt5 @QT_VERSION@ CONFIG REQUIRED Core Widgets LinguistTools )
include( CalamaresAddLibrary )
include( CalamaresAddModuleSubdirectory )
include( CalamaresAddPlugin )
include( CalamaresAddBrandingSubdirectory )

View File

@ -159,7 +159,7 @@ dont-chroot: false
# If this is set to true, Calamares refers to itself as a "setup program" # If this is set to true, Calamares refers to itself as a "setup program"
# rather than an "installer". Defaults to the value of dont-chroot, but # rather than an "installer". Defaults to the value of dont-chroot, but
# Calamares will complain if this is not explicitly set. # Calamares will complain if this is not explicitly set.
# oem-setup: true oem-setup: false
# If this is set to true, the "Cancel" button will be disabled entirely. # If this is set to true, the "Cancel" button will be disabled entirely.
# The button is also hidden from view. # The button is also hidden from view.

View File

@ -1,5 +1,5 @@
# === This file is part of Calamares - <https://github.com/calamares> === # === This file is part of Calamares - <https://github.com/calamares> ===
# #
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org> # SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# #
# Calamares is free software: you can redistribute it and/or modify # Calamares is free software: you can redistribute it and/or modify
@ -163,21 +163,25 @@ set_target_properties( calamares
PROPERTIES PROPERTIES
VERSION ${CALAMARES_VERSION_SHORT} VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT} SOVERSION ${CALAMARES_VERSION_SHORT}
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares
) )
calamares_automoc( calamares ) calamares_automoc( calamares )
target_link_libraries( calamares target_link_libraries( calamares
LINK_PRIVATE LINK_PRIVATE
${OPTIONAL_PRIVATE_LIBRARIES} ${OPTIONAL_PRIVATE_LIBRARIES}
LINK_PUBLIC
yamlcpp yamlcpp
LINK_PUBLIC
Qt5::Core Qt5::Core
KF5::CoreAddons KF5::CoreAddons
${OPTIONAL_PUBLIC_LIBRARIES} ${OPTIONAL_PUBLIC_LIBRARIES}
) )
### Installation
#
#
install( TARGETS calamares install( TARGETS calamares
EXPORT CalamaresLibraryDepends EXPORT Calamares
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@ -192,13 +196,18 @@ install( CODE "
# Install header files # Install header files
file( GLOB rootHeaders "*.h" ) file( GLOB rootHeaders "*.h" )
file( GLOB kdsingleapplicationguardHeaders "kdsingleapplicationguard/*.h" ) install(
file( GLOB utilsHeaders "utils/*.h" ) FILES
${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h
${rootHeaders}
DESTINATION include/libcalamares
)
# Install each subdir-worth of header files
foreach( subdir geoip locale modulesystem network partition utils )
file( GLOB subdir_headers "${subdir}/*.h" )
install( FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir} )
endforeach()
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h DESTINATION include/libcalamares )
install( FILES ${rootHeaders} DESTINATION include/libcalamares )
install( FILES ${kdsingleapplicationguardHeaders} DESTINATION include/libcalamares/kdsingleapplicationguard )
install( FILES ${utilsHeaders} DESTINATION include/libcalamares/utils )
### TESTING ### TESTING
# #

View File

@ -1,5 +1,5 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org> * SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
@ -29,7 +29,14 @@
#define CMAKE_INSTALL_FULL_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}/calamares" #define CMAKE_INSTALL_FULL_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}/calamares"
#define CMAKE_INSTALL_FULL_SYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}" #define CMAKE_INSTALL_FULL_SYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}"
//cmakedefines for CMake variables (e.g. for optdepends) go here /*
* These are feature-settings that affect consumers of Calamares
* libraries as well; without Python-support in the libs, for instance,
* there's no point in having a Python plugin.
*
* This list should match the one in CalamaresConfig.cmake
* which is the CMake-time side of the same configuration.
*/
#cmakedefine WITH_PYTHON #cmakedefine WITH_PYTHON
#cmakedefine WITH_PYTHONQT #cmakedefine WITH_PYTHONQT
#cmakedefine WITH_QML #cmakedefine WITH_QML

View File

@ -1,5 +1,5 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot <groot@kde.org> * SPDX-FileCopyrightText: 2019-2020 Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
@ -96,13 +96,16 @@ RequirementsModel::roleNames() const
void void
RequirementsModel::describe() const RequirementsModel::describe() const
{ {
cDebug() << "Requirements model has" << m_requirements.count() << "items";
bool acceptable = true; bool acceptable = true;
int count = 0; int count = 0;
for ( const auto& r : m_requirements ) for ( const auto& r : m_requirements )
{ {
cDebug() << Logger::SubEntry << "requirement" << count << r.name
<< "satisfied?" << r.satisfied
<< "mandatory?" << r.mandatory;
if ( r.mandatory && !r.satisfied ) if ( r.mandatory && !r.satisfied )
{ {
cDebug() << Logger::SubEntry << "requirement" << count << r.name << "is not satisfied.";
acceptable = false; acceptable = false;
} }
++count; ++count;

View File

@ -66,8 +66,9 @@ calamares_add_library( calamaresui
EXPORT_MACRO UIDLLEXPORT_PRO EXPORT_MACRO UIDLLEXPORT_PRO
LINK_LIBRARIES LINK_LIBRARIES
Qt5::Svg Qt5::Svg
yamlcpp
RESOURCES libcalamaresui.qrc RESOURCES libcalamaresui.qrc
EXPORT CalamaresLibraryDepends EXPORT Calamares
VERSION ${CALAMARES_VERSION_SHORT} VERSION ${CALAMARES_VERSION_SHORT}
) )
@ -82,3 +83,25 @@ endif()
if( WITH_QML ) if( WITH_QML )
target_link_libraries( calamaresui PUBLIC Qt5::QuickWidgets ) target_link_libraries( calamaresui PUBLIC Qt5::QuickWidgets )
endif() endif()
### Installation
#
#
# The library is already installed through calamares_add_library(),
# so we only need to do headers. Unlike the Calamares source tree,
# where libcalamares and libcalamaresui live in different branches,
# we're going to glom it all together in the installed headers location.
install(
FILES
Branding.h
ViewManager.h
DESTINATION include/libcalamares
)
# Install each subdir-worth of header files
foreach( subdir modulesystem utils viewpages widgets )
file( GLOB subdir_headers "${subdir}/*.h" )
install( FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir} )
endforeach()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -21,7 +21,6 @@
<file>images/timezone_10.0.png</file> <file>images/timezone_10.0.png</file>
<file>images/timezone_10.5.png</file> <file>images/timezone_10.5.png</file>
<file>images/timezone_11.0.png</file> <file>images/timezone_11.0.png</file>
<file>images/timezone_11.5.png</file>
<file>images/timezone_12.0.png</file> <file>images/timezone_12.0.png</file>
<file>images/timezone_12.75.png</file> <file>images/timezone_12.75.png</file>
<file>images/timezone_13.0.png</file> <file>images/timezone_13.0.png</file>

View File

@ -26,7 +26,7 @@
static const char* zoneNames[] static const char* zoneNames[]
= { "0.0", "1.0", "2.0", "3.0", "3.5", "4.0", "4.5", "5.0", "5.5", "5.75", "6.0", "6.5", "7.0", = { "0.0", "1.0", "2.0", "3.0", "3.5", "4.0", "4.5", "5.0", "5.5", "5.75", "6.0", "6.5", "7.0",
"8.0", "9.0", "9.5", "10.0", "10.5", "11.0", "11.5", "12.0", "12.75", "13.0", "-1.0", "-2.0", "-3.0", "8.0", "9.0", "9.5", "10.0", "10.5", "11.0", "12.0", "12.75", "13.0", "-1.0", "-2.0", "-3.0",
"-3.5", "-4.0", "-4.5", "-5.0", "-5.5", "-6.0", "-7.0", "-8.0", "-9.0", "-9.5", "-10.0", "-11.0" }; "-3.5", "-4.0", "-4.5", "-5.0", "-5.5", "-6.0", "-7.0", "-8.0", "-9.0", "-9.5", "-10.0", "-11.0" };
static_assert( TimeZoneImageList::zoneCount == ( sizeof( zoneNames ) / sizeof( zoneNames[ 0 ] ) ), static_assert( TimeZoneImageList::zoneCount == ( sizeof( zoneNames ) / sizeof( zoneNames[ 0 ] ) ),
"Incorrect number of zones" ); "Incorrect number of zones" );
@ -36,7 +36,7 @@ static_assert( TimeZoneImageList::zoneCount == ( sizeof( zoneNames ) / sizeof( z
/* static constexpr */ const int TimeZoneImageList::zoneCount; /* static constexpr */ const int TimeZoneImageList::zoneCount;
/* static constexpr */ const QSize TimeZoneImageList::imageSize; /* static constexpr */ const QSize TimeZoneImageList::imageSize;
static_assert( TimeZoneImageList::zoneCount == 38 ); static_assert( TimeZoneImageList::zoneCount == 37 );
TimeZoneImageList::TimeZoneImageList() {} TimeZoneImageList::TimeZoneImageList() {}

View File

@ -77,7 +77,7 @@ public:
QImage find( QPoint p ) const; QImage find( QPoint p ) const;
/// @brief The **expected** number of zones in the list. /// @brief The **expected** number of zones in the list.
static constexpr const int zoneCount = 38; static constexpr const int zoneCount = 37;
/// @brief The expected size of each zone image. /// @brief The expected size of each zone image.
static constexpr const QSize imageSize = QSize( 780, 340 ); static constexpr const QSize imageSize = QSize( 780, 340 );
}; };

View File

@ -52,8 +52,13 @@ def mount_partition(root_mount_point, partition, partitions):
# Ensure that the created directory has the correct SELinux context on # Ensure that the created directory has the correct SELinux context on
# SELinux-enabled systems. # SELinux-enabled systems.
os.makedirs(mount_point, exist_ok=True) os.makedirs(mount_point, exist_ok=True)
subprocess.call(['chcon', '--reference=' + raw_mount_point, try:
mount_point]) subprocess.call(['chcon', '--reference=' + raw_mount_point, mount_point])
except FileNotFoundError as e:
libcalamares.utils.warning(str(e))
except OSError:
libcalamares.utils.error("Cannot run 'chcon' normally.")
raise
fstype = partition.get("fs", "").lower() fstype = partition.get("fs", "").lower()

View File

@ -26,5 +26,6 @@ calamares_add_test(
PackageModel.cpp PackageModel.cpp
LIBRARIES LIBRARIES
Qt5::Gui Qt5::Gui
yamlcpp
) )

View File

@ -274,6 +274,20 @@ class PMApt(PackageManager):
# Doesn't need to update the system explicitly # Doesn't need to update the system explicitly
pass pass
class PMXbps(PackageManager):
backend = "xbps"
def install(self, pkgs, from_local=False):
check_target_env_call(["xbps-install", "-Sy"] + pkgs)
def remove(self, pkgs):
check_target_env_call(["xbps-remove", "-Ry", "--noconfirm"] + pkgs)
def update_db(self):
check_target_env_call(["xbps-install", "-S"])
def update_system(self):
check_target_env_call(["xbps", "-Suy"])
class PMPacman(PackageManager): class PMPacman(PackageManager):
backend = "pacman" backend = "pacman"

View File

@ -32,6 +32,7 @@
Config::Config( QObject* parent ) Config::Config( QObject* parent )
: QObject( parent ) : QObject( parent )
, m_languages( CalamaresUtils::Locale::availableTranslations() ) , m_languages( CalamaresUtils::Locale::availableTranslations() )
, m_filtermodel( std::make_unique< QSortFilterProxyModel >() )
{ {
initLanguages(); initLanguages();
@ -97,6 +98,18 @@ Config::requirementsModel() const
return Calamares::ModuleManager::instance()->requirementsModel(); return Calamares::ModuleManager::instance()->requirementsModel();
} }
QAbstractItemModel*
Config::unsatisfiedRequirements() const
{
if ( !m_filtermodel->sourceModel() )
{
m_filtermodel->setFilterRole( Calamares::RequirementsModel::Roles::Satisfied );
m_filtermodel->setFilterFixedString( QStringLiteral( "false" ) );
m_filtermodel->setSourceModel( requirementsModel() );
}
return m_filtermodel.get();
}
QString QString
Config::languageIcon() const Config::languageIcon() const
@ -336,7 +349,7 @@ setCountry( Config* config, const QString& countryCode, CalamaresUtils::GeoIP::H
} }
static inline void static inline void
setGeoIP( Config* c, const QVariantMap& configurationMap ) setGeoIP( Config* config, const QVariantMap& configurationMap )
{ {
bool ok = false; bool ok = false;
QVariantMap geoip = CalamaresUtils::getSubMap( configurationMap, "geoip", ok ); QVariantMap geoip = CalamaresUtils::getSubMap( configurationMap, "geoip", ok );
@ -350,12 +363,12 @@ setGeoIP( Config* c, const QVariantMap& configurationMap )
if ( handler->type() != CalamaresUtils::GeoIP::Handler::Type::None ) if ( handler->type() != CalamaresUtils::GeoIP::Handler::Type::None )
{ {
auto* future = new FWString(); auto* future = new FWString();
QObject::connect( future, &FWString::finished, [config = c, f = future, h = handler]() { QObject::connect( future, &FWString::finished, [config, future, handler]() {
QString countryResult = f->future().result(); QString countryResult = future->future().result();
cDebug() << "GeoIP result for welcome=" << countryResult; cDebug() << "GeoIP result for welcome=" << countryResult;
::setCountry( config, countryResult, h ); ::setCountry( config, countryResult, handler );
f->deleteLater(); future->deleteLater();
delete h; delete handler;
} ); } );
future->setFuture( handler->queryRaw() ); future->setFuture( handler->queryRaw() );
} }

View File

@ -23,13 +23,37 @@
#include "modulesystem/RequirementsModel.h" #include "modulesystem/RequirementsModel.h"
#include <QObject> #include <QObject>
#include <QSortFilterProxyModel>
#include <QUrl> #include <QUrl>
#include <memory>
class Config : public QObject class Config : public QObject
{ {
Q_OBJECT Q_OBJECT
/** @brief The languages available in Calamares.
*
* This is a list-model, with names and descriptions for the translations
* available to Calamares.
*/
Q_PROPERTY( CalamaresUtils::Locale::LabelModel* languagesModel READ languagesModel CONSTANT FINAL ) Q_PROPERTY( CalamaresUtils::Locale::LabelModel* languagesModel READ languagesModel CONSTANT FINAL )
/** @brief The requirements (from modules) and their checked-status
*
* The model grows rows over time as each module is checked and its
* requirements are taken into account. The model **as a whole**
* has properties *satisfiedRequirements* and *satisfiedMandatory*
* to say if all of the requirements held in the model have been
* satisfied. See the model documentation for details.
*/
Q_PROPERTY( Calamares::RequirementsModel* requirementsModel READ requirementsModel CONSTANT FINAL ) Q_PROPERTY( Calamares::RequirementsModel* requirementsModel READ requirementsModel CONSTANT FINAL )
/** @brief The requirements (from modules) that are **unsatisfied**
*
* This is the same as requirementsModel(), except filtered so
* that only those requirements that are not satisfied are exposed.
* Note that the type is different, so you should still use the
* requirementsModel() for overall status like *satisfiedMandatory*.
*/
Q_PROPERTY( QAbstractItemModel* unsatisfiedRequirements READ unsatisfiedRequirements CONSTANT FINAL )
Q_PROPERTY( QString languageIcon READ languageIcon CONSTANT FINAL ) Q_PROPERTY( QString languageIcon READ languageIcon CONSTANT FINAL )
@ -83,6 +107,8 @@ public slots:
///@brief The **global** requirements model, from ModuleManager ///@brief The **global** requirements model, from ModuleManager
Calamares::RequirementsModel* requirementsModel() const; Calamares::RequirementsModel* requirementsModel() const;
QAbstractItemModel* unsatisfiedRequirements() const;
signals: signals:
void countryCodeChanged( QString countryCode ); void countryCodeChanged( QString countryCode );
void localeIndexChanged( int localeIndex ); void localeIndexChanged( int localeIndex );
@ -99,7 +125,8 @@ signals:
private: private:
void initLanguages(); void initLanguages();
CalamaresUtils::Locale::LabelModel* m_languages; CalamaresUtils::Locale::LabelModel* m_languages = nullptr;
std::unique_ptr< QSortFilterProxyModel > m_filtermodel;
QString m_languageIcon; QString m_languageIcon;
QString m_countryCode; QString m_countryCode;

View File

@ -67,6 +67,14 @@ requirements:
# Also, note the analogous feature in `src/modules/locale/locale.conf`, # Also, note the analogous feature in `src/modules/locale/locale.conf`,
# which is where you will find complete documentation. # which is where you will find complete documentation.
# #
# For testing, the *style* may be set to `fixed`, any URL that
# returns data (e.g. `http://example.com`) and then *selector*
# sets the data that is actually returned (e.g. "DE" to simulate
# the machine being in Germany).
#
# NOTE: the *selector* must pick the country code from the GeoIP
# data. Timezone, city, or other data will not be recognized.
#
geoip: geoip:
style: "none" style: "none"
url: "https://geoip.kde.org/v1/ubiquity" # extended XML format url: "https://geoip.kde.org/v1/ubiquity" # extended XML format

View File

@ -17,6 +17,8 @@
* along with Calamares. If not, see <http://www.gnu.org/licenses/>. * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* THIS COMPONENT IS UNUSED -- from the default welcomeq.qml at least */
import io.calamares.core 1.0 import io.calamares.core 1.0
import io.calamares.ui 1.0 import io.calamares.ui 1.0

View File

@ -44,8 +44,12 @@ Rectangle {
activeFocusOnPress: false activeFocusOnPress: false
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("<p>This computer does not satisfy the minimum requirements for installing %1.<br/> property var requirementsText: qsTr("<p>This computer does not satisfy the minimum requirements for installing %1.<br/>
Installation cannot continue.</p>").arg(Branding.string(Branding.VersionedName)) Installation cannot continue.</p>").arg(Branding.string(Branding.VersionedName))
property var recommendationsText: qsTr("<p>This computer does not satisfy some of the recommended requirements for setting up %1.<br/>
Setup can continue, but some features might be disabled.</p>").arg(Branding.string(Branding.VersionedName))
text: config.requirementsModel.satisfiedMandatory ? recommendationsText : requirementsText
} }
Rectangle { Rectangle {
@ -61,6 +65,7 @@ Rectangle {
Item { Item {
width: 640 width: 640
height: 35 height: 35
visible: true
Column { Column {
anchors.centerIn: parent anchors.centerIn: parent
@ -68,18 +73,22 @@ Rectangle {
Rectangle { Rectangle {
implicitWidth: 640 implicitWidth: 640
implicitHeight: 35 implicitHeight: 35
border.color: mandatory ? "#228b22" : "#ff0000" // Colors and images based on the two satisfied-bools:
color: mandatory ? "#f0fff0" : "#ffc0cb" // - if satisfied, then green / ok
// - otherwise if mandatory, then red / stop
// - otherwise, then yellow / warning
border.color: satisfied ? "#228b22" : (mandatory ? "#ff0000" : "#ffa411")
color: satisfied ? "#f0fff0" : (mandatory ? "#ffc0cb" : "#ffefd5")
Image { Image {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
anchors.margins: 20 anchors.margins: 20
source: mandatory ? "qrc:/data/images/yes.svgz" : "qrc:/data/images/no.svgz" source: satisfied ? "qrc:/data/images/yes.svgz" : (mandatory ? "qrc:/data/images/no.svgz" : "qrc:/data/images/information.svgz")
} }
Text { Text {
text: mandatory ? details : negatedText text: satisfied ? details : negatedText
anchors.centerIn: parent anchors.centerIn: parent
font.pointSize: 11 font.pointSize: 11
} }
@ -89,9 +98,13 @@ Rectangle {
} }
ListView { ListView {
id: requirementsList
anchors.fill: parent anchors.fill: parent
spacing: 5 spacing: 5
model: config.requirementsModel // This uses the filtered model, so that only unsatisfied
// requirements are ever shown. You could use *requirementsModel*
// to get all of them.
model: config.unsatisfiedRequirements
delegate: requirementsDelegate delegate: requirementsDelegate
} }
} }

View File

@ -1,52 +1,24 @@
# Configuration for the welcome module. The welcome page # Configuration for the welcomeq module.
# displays some information from the branding file.
# Which parts it displays can be configured through
# the show* variables.
# #
# In addition to displaying the welcome page, this module # The configuration for welcomeq is exactly the same
# can check requirements for installation. # as the welcome module, with the one exception of
# *qmlSearch* which governs QML loading.
#
# No documentation is given here: look in the welcome module.
--- ---
# Setting for QML loading # Setting for QML loading: use QRC, branding, or both sources of files
qmlSearch: both qmlSearch: both
# Display settings for various buttons on the welcome page.
# The URLs themselves come from branding.desc is the setting # Everythin below here is documented in `welcome.conf`
# here is "true". If the setting is false, the button is hidden.
# The setting can also be a full URL which will then be used
# instead of the one from the branding file, or empty or not-set
# which will hide the button.
showSupportUrl: true showSupportUrl: true
showKnownIssuesUrl: true showKnownIssuesUrl: true
showReleaseNotesUrl: true showReleaseNotesUrl: true
# If this Url is set to something non-empty, a "donate"
# button is added to the welcome page alongside the
# others (see settings, above). Clicking the button opens
# the corresponding link. (This button has no corresponding
# branding.desc string)
#
# showDonateUrl: https://kde.org/community/donations/ # showDonateUrl: https://kde.org/community/donations/
# Requirements checking. These are general, generic, things
# that are checked. They may not match with the actual requirements
# imposed by other modules in the system.
requirements: requirements:
# Amount of available disk, in GiB. Floating-point is allowed here.
# Note that this does not account for *usable* disk, so it is possible
# to pass this requirement, yet have no space to install to.
requiredStorage: 5.5 requiredStorage: 5.5
# Amount of available RAM, in GiB. Floating-point is allowed here.
requiredRam: 1.0 requiredRam: 1.0
# To check for internet connectivity, Calamares does a HTTP GET
# on this URL; on success (e.g. HTTP code 200) internet is OK.
internetCheckUrl: http://google.com internetCheckUrl: http://google.com
# List conditions to check. Each listed condition will be
# probed in some way, and yields true or false according to
# the host system satisfying the condition.
#
# This sample file lists all the conditions that are known.
check: check:
- storage - storage
- ram - ram
@ -54,11 +26,10 @@ requirements:
- internet - internet
- root - root
- screen - screen
# List conditions that **must** be satisfied (from the list
# of conditions, above) for installation to proceed.
# If any of these conditions are not met, the user cannot
# continue past the welcome page.
required: required:
# - storage
- ram - ram
# - root
geoip:
style: "none"
url: "https://geoip.kde.org/v1/ubiquity" # extended XML format
selector: "CountryCode" # blank uses default, which is wrong

View File

@ -56,12 +56,8 @@ Page
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
Recommended {
visible: !config.requirementsModel.satisfiedRequirements
}
Requirements { Requirements {
visible: !config.requirementsModel.satisfiedMandatory visible: !config.requirementsModel.satisfiedRequirements
} }
RowLayout { RowLayout {