diff --git a/CHANGES-3.3 b/CHANGES-3.3 index c7226a03b6..d805c74f21 100644 --- a/CHANGES-3.3 +++ b/CHANGES-3.3 @@ -36,6 +36,11 @@ This release contains contributions from (alphabetically by first name): enabled, even the ones with no translations at all. - The logging format in the `session.log` file and on-screen is now more similar, although the file contains a lot more per-line information. + - The INSTALL_CONFIG option has been restored. It is still a terrible + idea to fork the repository to modify the config files, and you + probably should have a calamares-config package with those files + instead, there are packaging workflows that can usefully patch-and- + install configuration files. The option defaults to OFF. ## Modules ## - All QML modules now have a Qt6-compatible set of QML files as well. (thanks Anke) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95a8352434..e80679e5c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,7 @@ set(CALAMARES_SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") # option(INSTALL_POLKIT "Install Polkit configuration" ON) option(INSTALL_COMPLETION "Install shell completions" OFF) +option(INSTALL_CONFIG "Install configuration files" OFF) # When adding WITH_* that affects the ABI offered by libcalamares, # also update libcalamares/CalamaresConfig.h.in option(WITH_PYBIND11 "Use bundled pybind11 instead o Boost::Python" ON) @@ -682,6 +683,10 @@ install(FILES calamares.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/application install(FILES man/calamares.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8/) +if(INSTALL_CONFIG) + install(FILES settings.conf DESTINATION share/calamares) +endif() + ### Uninstall # # diff --git a/CMakeModules/CalamaresAddModuleSubdirectory.cmake b/CMakeModules/CalamaresAddModuleSubdirectory.cmake index 55cf440ce8..61f3a11540 100644 --- a/CMakeModules/CalamaresAddModuleSubdirectory.cmake +++ b/CMakeModules/CalamaresAddModuleSubdirectory.cmake @@ -167,7 +167,14 @@ function( _calamares_add_module_subdirectory_impl ) message( " ${Green}TYPE:${ColorReset} jobmodule" ) message( " ${Green}MODULE_DESTINATION:${ColorReset} ${MODULE_DESTINATION}" ) if( MODULE_CONFIG_FILES ) - message( " ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory only]" ) + if (INSTALL_CONFIG) + message(" ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory and ${MODULE_DATA_DESTINATION}]") + foreach(_cf ${MODULE_CONFIG_FILES}) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/${_cf} DESTINATION ${MODULE_DESTINATION}) + endforeach() + else() + message(" ${Green}CONFIGURATION_FILES:${ColorReset} ${MODULE_CONFIG_FILES} => [Build directory only]") + endif() endif() message( "" ) # We copy over the lang directory, if any diff --git a/CMakeModules/CalamaresAddPlugin.cmake b/CMakeModules/CalamaresAddPlugin.cmake index a86ee6e715..34ade2bd6e 100644 --- a/CMakeModules/CalamaresAddPlugin.cmake +++ b/CMakeModules/CalamaresAddPlugin.cmake @@ -104,7 +104,9 @@ function( calamares_add_plugin ) message( FATAL_ERROR "${Red}NO_CONFIG${ColorReset} is set, with configuration ${Red}${PLUGIN_CONFIG_FILES}${ColorReset}" ) endif() set( _destination "(unknown)" ) - if( NOT PLUGIN_NO_INSTALL ) + if(INSTALL_CONFIG AND NOT PLUGIN_NO_INSTALL) + set(_destination "${PLUGIN_DATA_DESTINATION}") + elseif( NOT PLUGIN_NO_INSTALL ) set( _destination "[Build directory only]" ) else() set( _destination "[Skipping installation]" ) @@ -213,6 +215,9 @@ function( calamares_add_plugin ) message( " ${BoldYellow}Not updating${ColorReset} ${PLUGIN_CONFIG_FILE}" ) set( _warned_config ON ) endif() + if(INSTALL_CONFIG) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PLUGIN_CONFIG_FILE} DESTINATION ${PLUGIN_DATA_DESTINATION}) + endif() endforeach() if ( _warned_config ) message( "" )