Kaydet (Commit) ecc617e7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

configmgr: support reading from a dconf layer (WIP)

Work in progress to allow integration of LO with
<https://wiki.gnome.org/Projects/FleetCommander>.

During configuration, dconf support is implicitly enabled when available on the
host (which is presumably only available on Linux).  It is explicitly disabled
for TDF Linux builds for now, though, to avoid accidental dependencies of the
distributed installation sets on system dconf libraries.

A dconf layer is represented in the CONFIGURATION_LAYERS bootstrap variable with
type "dconf" and an empty URL.  See the comment at the top of
configmgr/source/readdconflayer.cxx for the encoding of component-data in dconf.

All of this is still subject to change.

Change-Id: I2d08d81c8ea43ba4a99040a8882ae75b91bcfdb9
Reviewed-on: https://gerrit.libreoffice.org/16848Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 8caef148
......@@ -3584,6 +3584,11 @@ endif # ENABLE_COLLADA
endif # ENABLE_GLTF
define gb_LinkTarget__use_dconf
$(call gb_LinkTarget_add_defs,$(1),$(DCONF_CFLAGS))
$(call gb_LinkTarget_add_libs,$(1),$(DCONF_LIBS))
endef
### Jars ############################################################
ifneq ($(SYSTEM_HSQLDB),)
......
......@@ -91,6 +91,8 @@ export DBUSMENUGTK_CFLAGS=$(gb_SPACE)@DBUSMENUGTK_CFLAGS@
export DBUSMENUGTK_LIBS=$(gb_SPACE)@DBUSMENUGTK_LIBS@
export DBUS_CFLAGS=$(gb_SPACE)@DBUS_CFLAGS@
export DBUS_LIBS=$(gb_SPACE)@DBUS_LIBS@
export DCONF_CFLAGS=@DCONF_CFLAGS@
export DCONF_LIBS=@DCONF_LIBS@
export DEFAULT_BRAND_IMAGES=@DEFAULT_BRAND_IMAGES@
export DIAGRAM_EXTENSION_PACK=@DIAGRAM_EXTENSION_PACK@
export DICT_SYSTEM_DIR=@DICT_SYSTEM_DIR@
......@@ -122,6 +124,7 @@ export ENABLE_CUPS=@ENABLE_CUPS@
export ENABLE_CURL=@ENABLE_CURL@
export ENABLE_DBGUTIL=@ENABLE_DBGUTIL@
export ENABLE_DBUS=@ENABLE_DBUS@
export ENABLE_DCONF=@ENABLE_DCONF@
export ENABLE_DEBUG=@ENABLE_DEBUG@
export ENABLE_DEBUGINFO_FOR=@ENABLE_DEBUGINFO_FOR@
export ENABLE_DIRECTX=@ENABLE_DIRECTX@
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_CONFIG_DCONF_H
#define INCLUDED_CONFIG_DCONF_H
#define ENABLE_DCONF 0
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -49,5 +49,6 @@ $(eval $(call gb_CppunitTest_use_components,configmgr_unit,\
$(eval $(call gb_CppunitTest_use_externals,configmgr_unit,\
boost_headers \
dconf \
icu_headers \
))
......@@ -38,15 +38,19 @@ $(eval $(call gb_Library_add_exception_objects,configmgr, \
configmgr/source/type \
configmgr/source/update \
configmgr/source/valueparser \
$(if $(filter $(OS),WNT), configmgr/source/winreg ) \
configmgr/source/writemodfile \
configmgr/source/xcdparser \
configmgr/source/xcsparser \
configmgr/source/xcuparser \
configmgr/source/xmldata \
$(if $(ENABLE_DCONF),configmgr/source/readdconflayer) \
$(if $(filter $(OS),WNT),configmgr/source/winreg) \
))
$(eval $(call gb_Library_use_external,configmgr,boost_headers))
$(eval $(call gb_Library_use_externals,configmgr, \
boost_headers \
dconf \
))
$(eval $(call gb_Library_use_sdk_api,configmgr))
......
......@@ -36,6 +36,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <config_dconf.h>
#include <config_folders.h>
#include <osl/conditn.hxx>
#include <osl/file.hxx>
......@@ -64,6 +65,10 @@
#include "xcuparser.hxx"
#include "xcsparser.hxx"
#if ENABLE_DCONF
#include <readdconflayer.hxx>
#endif
#if defined WNT
#include "winreg.hxx"
#endif
......@@ -522,6 +527,15 @@ Components::Components(
parseResLayer(layer, url);
SAL_INFO("configmgr", "parseResLayer() took " << (osl_getGlobalTimer() - nStartTime) << " ms");
++layer; //TODO: overflow
#if ENABLE_DCONF
} else if (type == "dconf") {
if (!url.isEmpty()) {
throw css::uno::RuntimeException(
"CONFIGURATION_LAYERS: non-empty \"dconf\" URL");
}
readDconfLayer(data_, layer);
++layer; //TODO: overflow
#endif
#if defined WNT
} else if (type == "winreg") {
if (!url.isEmpty()) {
......
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_CONFIGMGR_SOURCE_READDCONFLAYER_HXX
#define INCLUDED_CONFIGMGR_SOURCE_READDCONFLAYER_HXX
#include <sal/config.h>
namespace configmgr { struct Data; }
namespace configmgr {
void readDconfLayer(Data & data, int layer);
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1475,6 +1475,11 @@ AC_ARG_ENABLE(collada,
AS_HELP_STRING([--disable-collada],
[Disable collada support (Rendering 3D models stored in *.dae and *.kmz format).]))
AC_ARG_ENABLE(dconf,
AS_HELP_STRING([--disable-dconf],
[Disable the dconf configuration backend (enabled by default where
available).]))
dnl ===================================================================
dnl Optional Packages (--with/without-)
dnl ===================================================================
......@@ -10493,6 +10498,29 @@ AC_SUBST([COLLADA2GLTF_CFLAGS])
AC_SUBST([COLLADA2GLTF_LIBS])
AC_SUBST([SYSTEM_COLLADA2GLTF])
if test "$enable_dconf" != no; then
PKG_CHECK_MODULES([DCONF], [dconf], [], [
if test "$enable_dconf" = yes; then
AC_MSG_ERROR([dconf not found])
else
enable_dconf=no
fi])
fi
AC_MSG_CHECKING([whether to enable dconf])
if test "$enable_dconf" = no; then
DCONF_CFLAGS=
DCONF_LIBS=
ENABLE_DCONF=
AC_MSG_RESULT([no])
else
ENABLE_DCONF=TRUE
AC_DEFINE(ENABLE_DCONF)
AC_MSG_RESULT([yes])
fi
AC_SUBST([DCONF_CFLAGS])
AC_SUBST([DCONF_LIBS])
AC_SUBST([ENABLE_DCONF])
# pdf import?
AC_MSG_CHECKING([whether to build the PDF import feature])
ENABLE_PDFIMPORT=
......@@ -13112,6 +13140,7 @@ AC_CONFIG_FILES([config_host.mk
ios/lo.xcconfig])
AC_CONFIG_HEADERS([config_host/config_buildid.h])
AC_CONFIG_HEADERS([config_host/config_clang.h])
AC_CONFIG_HEADERS([config_host/config_dconf.h])
AC_CONFIG_HEADERS([config_host/config_eot.h])
AC_CONFIG_HEADERS([config_host/config_extension_update.h])
AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
......
......@@ -33,6 +33,7 @@
--enable-epm
--enable-python=internal
--enable-online-update
--disable-dconf
--disable-gio
--disable-randr-link
--disable-kde4
......
......@@ -491,6 +491,7 @@ certain functionality.
@li @c basebmp
@li @c binaryurp
@li @c configmgr
@li @c configmgr.dconf
@li @c cppcanvas
@li @c cppcanvas.emf
@li @c drawinglayer
......
......@@ -48,7 +48,7 @@ $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_
&& echo 'BRAND_BASE_DIR=$${ORIGIN}/..' \
&& echo 'BRAND_INI_DIR=$${ORIGIN}' \
&& echo 'BRAND_SHARE_SUBDIR=$(LIBO_SHARE_FOLDER)' \
&& echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry res:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry $(if $(filter WNT,$(OS)),winreg: )bundledext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/registrymodifications.xcu' \
&& echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry res:$${BRAND_BASE_DIR}/$(LIBO_SHARE_FOLDER)/registry $(if $(ENABLE_DCONF),dconf: )$(if $(filter WNT,$(OS)),winreg: )bundledext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:$${$${BRAND_BASE_DIR}/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,louno):UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:$${$$BRAND_BASE_DIR/$(LIBO_ETC_FOLDER)/$(call gb_Helper_get_rcfile,bootstrap):UserInstallation}/user/registrymodifications.xcu' \
&& echo 'LO_JAVA_DIR=$${BRAND_BASE_DIR}/$(LIBO_SHARE_JAVA_FOLDER)' \
&& echo 'LO_LIB_DIR=$${BRAND_BASE_DIR}/$(LIBO_LIB_FOLDER)' \
&& echo 'BAK_EXTENSIONS=$${$$ORIGIN/$(call gb_Helper_get_rcfile,louno):TMP_EXTENSIONS}' \
......
......@@ -29,6 +29,7 @@
#include "AutoInstall/brand"
#include "config_dconf.h"
#include "config_folders.h"
Module gid_Module_Root_Brand
......@@ -1117,17 +1118,25 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Ure_Bin_Dir
Value = "${BRAND_BASE_DIR}/" LIBO_URE_BIN_FOLDER;
End
#if ENABLE_DCONF
#define CONFIGURATION_LAYERS_DCONF " dconf:"
#else
#define CONFIGURATION_LAYERS_DCONF
#endif
#if defined WNT
#define CONFIGURATION_LAYERS_WINREG " winreg:"
#else
#define CONFIGURATION_LAYERS_WINREG
#endif
ProfileItem gid_Brand_Profileitem_Fundamental_Configuration_Layers
ProfileID = gid_Brand_Profile_Fundamental_Ini;
ModuleID = gid_Module_Root_Brand;
Section = "Bootstrap";
Key = "CONFIGURATION_LAYERS";
#if defined WNT
Value = "xcsxcu:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry winreg: bundledext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" PROFILENAME(bootstrap) ":UserInstallation}/user/registrymodifications.xcu";
#else
Value = "xcsxcu:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry bundledext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" PROFILENAME(bootstrap) ":UserInstallation}/user/registrymodifications.xcu";
#endif
Value = "xcsxcu:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry res:${BRAND_BASE_DIR}/" LIBO_SHARE_FOLDER "/registry" CONFIGURATION_LAYERS_WINREG " bundledext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini userext:${${BRAND_BASE_DIR}/" LIBO_ETC_FOLDER "/" PROFILENAME(louno) ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" PROFILENAME(bootstrap) ":UserInstallation}/user/registrymodifications.xcu";
End
#undef CONFIGURATION_LAYERS_DCONF
#undef CONFIGURATION_LAYERS_WINREG
#if !defined MACOSX
ProfileItem gid_Brand_Profileitem_Redirect_Ure_Bootstrap
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment