Skip to content

Commit

Permalink
CMake: restore INSTALL_CONFIG
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaandegroot committed Nov 9, 2023
1 parent 1e12ad3 commit 2b0c416
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES-3.3
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
#
#
Expand Down
9 changes: 8 additions & 1 deletion CMakeModules/CalamaresAddModuleSubdirectory.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion CMakeModules/CalamaresAddPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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]" )
Expand Down Expand Up @@ -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( "" )
Expand Down

0 comments on commit 2b0c416

Please sign in to comment.