glib: add an update script combinator to patch gsettings schema paths

and use it in evolution-data-server and evolution-ews as a proof of
concept

+225 -92
+33 -3
pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix
··· 14 , json-glib 15 , libmspack 16 , webkitgtk_4_1 17 }: 18 19 stdenv.mkDerivation rec { ··· 24 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 25 sha256 = "p5Jp7wnoqAuo8My8ZDMl0rsFc0158G8x8lAehWfLjb0="; 26 }; 27 28 nativeBuildInputs = [ 29 cmake ··· 50 ]; 51 52 passthru = { 53 - updateScript = gnome.updateScript { 54 - packageName = "evolution-ews"; 55 - versionPolicy = "odd-unstable"; 56 }; 57 }; 58 59 meta = with lib; {
··· 14 , json-glib 15 , libmspack 16 , webkitgtk_4_1 17 + , substituteAll 18 + , _experimental-update-script-combinators 19 + , glib 20 }: 21 22 stdenv.mkDerivation rec { ··· 27 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 28 sha256 = "p5Jp7wnoqAuo8My8ZDMl0rsFc0158G8x8lAehWfLjb0="; 29 }; 30 + 31 + patches = [ 32 + # evolution-ews contains .so files loaded by evolution-data-server refering 33 + # schemas from evolution. evolution-data-server is not wrapped with 34 + # evolution's schemas because it would be a circular dependency with 35 + # evolution. 36 + (substituteAll { 37 + src = ./hardcode-gsettings.patch; 38 + evo = glib.makeSchemaPath evolution evolution.name; 39 + }) 40 + ]; 41 42 nativeBuildInputs = [ 43 cmake ··· 64 ]; 65 66 passthru = { 67 + hardcodeGsettingsPatch = glib.mkHardcodeGsettingsPatch { 68 + inherit src; 69 + glib-schema-to-var = { 70 + "org.gnome.evolution.mail" = "evo"; 71 + "org.gnome.evolution.calendar" = "evo"; 72 + }; 73 }; 74 + 75 + updateScript = 76 + let 77 + updateSource = gnome.updateScript { 78 + packageName = "evolution-ews"; 79 + versionPolicy = "odd-unstable"; 80 + }; 81 + updatePatch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-ews.hardcodeGsettingsPatch" ./hardcode-gsettings.patch; 82 + in 83 + _experimental-update-script-combinators.sequence [ 84 + updateSource 85 + updatePatch 86 + ]; 87 }; 88 89 meta = with lib; {
+72
pkgs/applications/networking/mailreaders/evolution/evolution-ews/hardcode-gsettings.patch
···
··· 1 + diff --git a/src/EWS/camel/camel-ews-utils.c b/src/EWS/camel/camel-ews-utils.c 2 + index 0707f72..1e71954 100644 3 + --- a/src/EWS/camel/camel-ews-utils.c 4 + +++ b/src/EWS/camel/camel-ews-utils.c 5 + @@ -1552,7 +1552,18 @@ ews_utils_save_category_changes (GHashTable *old_categories, /* gchar *guid ~> C 6 + 7 + evo_labels = g_ptr_array_new_full (5, g_free); 8 + 9 + - settings = g_settings_new ("org.gnome.evolution.mail"); 10 + + { 11 + + g_autoptr(GSettingsSchemaSource) schema_source; 12 + + g_autoptr(GSettingsSchema) schema; 13 + + schema_source = g_settings_schema_source_new_from_directory("@evo@", 14 + + g_settings_schema_source_get_default(), 15 + + TRUE, 16 + + NULL); 17 + + schema = g_settings_schema_source_lookup(schema_source, 18 + + "org.gnome.evolution.mail", 19 + + FALSE); 20 + + settings = g_settings_new_full(schema, NULL, NULL); 21 + + } 22 + strv = g_settings_get_strv (settings, "labels"); 23 + 24 + for (ii = 0; strv && strv[ii]; ii++) { 25 + diff --git a/src/EWS/common/e-ews-calendar-utils.c b/src/EWS/common/e-ews-calendar-utils.c 26 + index 6deda60..9b44cc7 100644 27 + --- a/src/EWS/common/e-ews-calendar-utils.c 28 + +++ b/src/EWS/common/e-ews-calendar-utils.c 29 + @@ -413,7 +413,18 @@ ews_get_configured_icaltimezone (void) 30 + gchar *location; 31 + ICalTimezone *zone = NULL; 32 + 33 + - settings = g_settings_new ("org.gnome.evolution.calendar"); 34 + + { 35 + + g_autoptr(GSettingsSchemaSource) schema_source; 36 + + g_autoptr(GSettingsSchema) schema; 37 + + schema_source = g_settings_schema_source_new_from_directory("@evo@", 38 + + g_settings_schema_source_get_default(), 39 + + TRUE, 40 + + NULL); 41 + + schema = g_settings_schema_source_lookup(schema_source, 42 + + "org.gnome.evolution.calendar", 43 + + FALSE); 44 + + settings = g_settings_new_full(schema, NULL, NULL); 45 + + } 46 + location = g_settings_get_string (settings, "timezone"); 47 + if (location) { 48 + zone = i_cal_timezone_get_builtin_timezone (location); 49 + diff --git a/src/Microsoft365/camel/camel-m365-store.c b/src/Microsoft365/camel/camel-m365-store.c 50 + index ff1b8e3..4f876c0 100644 51 + --- a/src/Microsoft365/camel/camel-m365-store.c 52 + +++ b/src/Microsoft365/camel/camel-m365-store.c 53 + @@ -309,7 +309,18 @@ m365_store_save_category_changes (GHashTable *old_categories, /* gchar *id ~> Ca 54 + 55 + evo_labels = g_ptr_array_new_full (5, g_free); 56 + 57 + - settings = g_settings_new ("org.gnome.evolution.mail"); 58 + + { 59 + + g_autoptr(GSettingsSchemaSource) schema_source; 60 + + g_autoptr(GSettingsSchema) schema; 61 + + schema_source = g_settings_schema_source_new_from_directory("@evo@", 62 + + g_settings_schema_source_get_default(), 63 + + TRUE, 64 + + NULL); 65 + + schema = g_settings_schema_source_lookup(schema_source, 66 + + "org.gnome.evolution.mail", 67 + + FALSE); 68 + + settings = g_settings_new_full(schema, NULL, NULL); 69 + + } 70 + strv = g_settings_get_strv (settings, "labels"); 71 + 72 + for (ii = 0; strv && strv[ii]; ii++) {
+13 -28
pkgs/desktops/gnome/core/evolution-data-server/default.nix
··· 2 , lib 3 , fetchurl 4 , substituteAll 5 - , runCommand 6 - , git 7 - , coccinelle 8 , pkg-config 9 , gnome 10 , _experimental-update-script-combinators ··· 70 71 prePatch = '' 72 substitute ${./hardcode-gsettings.patch} hardcode-gsettings.patch \ 73 - --subst-var-by EDS_GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"} 74 patches="$patches $PWD/hardcode-gsettings.patch" 75 ''; 76 ··· 153 ''; 154 155 passthru = { 156 - # In order for GNOME not to depend on OCaml through Coccinelle, 157 - # we materialize the SmPL patch into a unified diff-style patch. 158 - hardcodeGsettingsPatch = 159 - runCommand 160 - "hardcode-gsettings.patch" 161 - { 162 - inherit src; 163 - nativeBuildInputs = [ 164 - git 165 - coccinelle 166 - python3 # For patch script 167 - ]; 168 - } 169 - '' 170 - unpackPhase 171 - cd "''${sourceRoot:-.}" 172 - git init 173 - git add -A 174 - spatch --sp-file "${./hardcode-gsettings.cocci}" --dir . --in-place 175 - git diff > "$out" 176 - ''; 177 178 updateScript = 179 let 180 updateSource = gnome.updateScript { 181 packageName = "evolution-data-server"; 182 versionPolicy = "odd-unstable"; 183 }; 184 - 185 - updateGsettingsPatch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-data-server.hardcodeGsettingsPatch" ./hardcode-gsettings.patch; 186 in 187 _experimental-update-script-combinators.sequence [ 188 updateSource 189 - updateGsettingsPatch 190 ]; 191 }; 192
··· 2 , lib 3 , fetchurl 4 , substituteAll 5 , pkg-config 6 , gnome 7 , _experimental-update-script-combinators ··· 67 68 prePatch = '' 69 substitute ${./hardcode-gsettings.patch} hardcode-gsettings.patch \ 70 + --subst-var-by EDS ${glib.makeSchemaPath "$out" "${pname}-${version}"} 71 patches="$patches $PWD/hardcode-gsettings.patch" 72 ''; 73 ··· 150 ''; 151 152 passthru = { 153 + hardcodeGsettingsPatch = glib.mkHardcodeGsettingsPatch { 154 + glib-schema-to-var = { 155 + "org.gnome.Evolution.DefaultSources" = "EDS"; 156 + "org.gnome.evolution.shell.network-config" = "EDS"; 157 + "org.gnome.evolution-data-server.addressbook" = "EDS"; 158 + "org.gnome.evolution-data-server.calendar" = "EDS"; 159 + "org.gnome.evolution-data-server" = "EDS"; 160 161 + }; 162 + inherit src; 163 + }; 164 updateScript = 165 let 166 updateSource = gnome.updateScript { 167 packageName = "evolution-data-server"; 168 versionPolicy = "odd-unstable"; 169 }; 170 + updatePatch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-data-server.hardcodeGsettingsPatch" ./hardcode-gsettings.patch; 171 in 172 _experimental-update-script-combinators.sequence [ 173 updateSource 174 + updatePatch 175 ]; 176 }; 177
+10 -15
pkgs/desktops/gnome/core/evolution-data-server/hardcode-gsettings.cocci pkgs/development/libraries/glib/hardcode-gsettings.cocci
··· 3 * where GSettings system could look for schemas, we need to point the software to a correct location somehow. 4 * For executables, we handle this using wrappers but this is not an option for libraries like e-d-s. 5 * Instead, we hardcode the schema path when creating the settings. 6 */ 7 8 @initialize:python@ 9 @@ 10 11 cpp_constants = {} 12 ··· 16 def resolve_cpp_constant(const_name): 17 return cpp_constants.get(const_name, const_name) 18 19 - e_s_d_schema_constants = [ 20 - # The following are actually part of e-d-s, despite the name. 21 - # We rename the old ambiguos constant name in ./prepare-for-gsettings-patching.patch 22 - "\"org.gnome.Evolution.DefaultSources\"", 23 - "\"org.gnome.evolution.shell.network-config\"", 24 - ] 25 - 26 - g_d_s_schema_constants = [ 27 - ] 28 29 def get_schema_directory(schema_path): 30 # Sometimes the schema id is referenced using C preprocessor #define constant in the same file 31 # let’s try to resolve it first. 32 - schema_path = resolve_cpp_constant(schema_path.strip()) 33 - if schema_path.startswith("\"org.gnome.evolution-data-server") or schema_path in e_s_d_schema_constants: 34 - return "\"@EDS_GSETTINGS_PATH@\"" 35 - elif schema_path in g_d_s_schema_constants: 36 - return "\"@GDS_GSETTINGS_PATH@\"" 37 - raise Exception(f"Unknown schema path {schema_path}") 38 39 40 @find_cpp_constants@
··· 3 * where GSettings system could look for schemas, we need to point the software to a correct location somehow. 4 * For executables, we handle this using wrappers but this is not an option for libraries like e-d-s. 5 * Instead, we hardcode the schema path when creating the settings. 6 + * A schema path (ie org.gnome.evolution) can be replaced by @EVOLUTION_SCHEMA_PATH@ 7 + * which is then replaced at build time by substituteAll. 8 + * The mapping is provided in a json file ./glib-schema-to-var.json 9 */ 10 11 @initialize:python@ 12 @@ 13 + import json 14 15 cpp_constants = {} 16 ··· 20 def resolve_cpp_constant(const_name): 21 return cpp_constants.get(const_name, const_name) 22 23 + with open("./glib-schema-to-var.json") as mapping_file: 24 + schema_to_var = json.load(mapping_file); 25 26 def get_schema_directory(schema_path): 27 # Sometimes the schema id is referenced using C preprocessor #define constant in the same file 28 # let’s try to resolve it first. 29 + schema_path = resolve_cpp_constant(schema_path.strip()).strip('"') 30 + if schema_path in schema_to_var: 31 + return f'"@{schema_to_var[schema_path]}@"' 32 + raise Exception(f"Unknown schema path {schema_path!r}, please add it to ./glib-schema-to-var.json") 33 34 35 @find_cpp_constants@
+46 -46
pkgs/desktops/gnome/core/evolution-data-server/hardcode-gsettings.patch
··· 1 diff --git a/src/addressbook/libebook/e-book-client.c b/src/addressbook/libebook/e-book-client.c 2 - index 7888e69..c3b695c 100644 3 --- a/src/addressbook/libebook/e-book-client.c 4 +++ b/src/addressbook/libebook/e-book-client.c 5 @@ -1983,7 +1983,18 @@ e_book_client_get_self (ESourceRegistry *registry, ··· 10 + { 11 + g_autoptr(GSettingsSchemaSource) schema_source; 12 + g_autoptr(GSettingsSchema) schema; 13 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 14 + g_settings_schema_source_get_default(), 15 + TRUE, 16 + NULL); ··· 30 + { 31 + g_autoptr(GSettingsSchemaSource) schema_source; 32 + g_autoptr(GSettingsSchema) schema; 33 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 34 + g_settings_schema_source_get_default(), 35 + TRUE, 36 + NULL); ··· 51 + if (!settings) { 52 + g_autoptr(GSettingsSchemaSource) schema_source; 53 + g_autoptr(GSettingsSchema) schema; 54 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 55 + g_settings_schema_source_get_default(), 56 + TRUE, 57 + NULL); ··· 64 g_mutex_unlock (&mutex); 65 66 diff --git a/src/addressbook/libebook/e-book.c b/src/addressbook/libebook/e-book.c 67 - index 8dfff6d..cd88392 100644 68 --- a/src/addressbook/libebook/e-book.c 69 +++ b/src/addressbook/libebook/e-book.c 70 @@ -2587,7 +2587,18 @@ e_book_get_self (ESourceRegistry *registry, ··· 75 + { 76 + g_autoptr(GSettingsSchemaSource) schema_source; 77 + g_autoptr(GSettingsSchema) schema; 78 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 79 + g_settings_schema_source_get_default(), 80 + TRUE, 81 + NULL); ··· 95 + { 96 + g_autoptr(GSettingsSchemaSource) schema_source; 97 + g_autoptr(GSettingsSchema) schema; 98 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 99 + g_settings_schema_source_get_default(), 100 + TRUE, 101 + NULL); ··· 115 + { 116 + g_autoptr(GSettingsSchemaSource) schema_source; 117 + g_autoptr(GSettingsSchema) schema; 118 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 119 + g_settings_schema_source_get_default(), 120 + TRUE, 121 + NULL); ··· 128 g_object_unref (settings); 129 130 diff --git a/src/addressbook/libedata-book/e-book-meta-backend.c b/src/addressbook/libedata-book/e-book-meta-backend.c 131 - index d3f130e..9e8edd4 100644 132 --- a/src/addressbook/libedata-book/e-book-meta-backend.c 133 +++ b/src/addressbook/libedata-book/e-book-meta-backend.c 134 @@ -135,7 +135,18 @@ ebmb_is_power_saver_enabled (void) ··· 139 + { 140 + g_autoptr(GSettingsSchemaSource) schema_source; 141 + g_autoptr(GSettingsSchema) schema; 142 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 143 + g_settings_schema_source_get_default(), 144 + TRUE, 145 + NULL); ··· 152 if (g_settings_get_boolean (settings, "limit-operations-in-power-saver-mode")) { 153 GPowerProfileMonitor *power_monitor; 154 diff --git a/src/calendar/backends/contacts/e-cal-backend-contacts.c b/src/calendar/backends/contacts/e-cal-backend-contacts.c 155 - index 42f3457..faac410 100644 156 --- a/src/calendar/backends/contacts/e-cal-backend-contacts.c 157 +++ b/src/calendar/backends/contacts/e-cal-backend-contacts.c 158 @@ -1387,7 +1387,18 @@ e_cal_backend_contacts_init (ECalBackendContacts *cbc) ··· 163 + { 164 + g_autoptr(GSettingsSchemaSource) schema_source; 165 + g_autoptr(GSettingsSchema) schema; 166 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 167 + g_settings_schema_source_get_default(), 168 + TRUE, 169 + NULL); ··· 176 cbc->priv->update_alarms_id = 0; 177 cbc->priv->alarm_enabled = FALSE; 178 diff --git a/src/calendar/libecal/e-reminder-watcher.c b/src/calendar/libecal/e-reminder-watcher.c 179 - index 52095a4..e839991 100644 180 --- a/src/calendar/libecal/e-reminder-watcher.c 181 +++ b/src/calendar/libecal/e-reminder-watcher.c 182 @@ -2555,7 +2555,19 @@ e_reminder_watcher_init (EReminderWatcher *watcher) ··· 187 + { 188 + g_autoptr(GSettingsSchemaSource) schema_source; 189 + g_autoptr(GSettingsSchema) schema; 190 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 191 + g_settings_schema_source_get_default(), 192 + TRUE, 193 + NULL); ··· 201 watcher->priv->default_zone = e_cal_util_copy_timezone (zone); 202 watcher->priv->timers_enabled = TRUE; 203 diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.c b/src/calendar/libedata-cal/e-cal-meta-backend.c 204 - index 94a875f..1f914a9 100644 205 --- a/src/calendar/libedata-cal/e-cal-meta-backend.c 206 +++ b/src/calendar/libedata-cal/e-cal-meta-backend.c 207 @@ -149,7 +149,18 @@ ecmb_is_power_saver_enabled (void) ··· 212 + { 213 + g_autoptr(GSettingsSchemaSource) schema_source; 214 + g_autoptr(GSettingsSchema) schema; 215 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 216 + g_settings_schema_source_get_default(), 217 + TRUE, 218 + NULL); ··· 225 if (g_settings_get_boolean (settings, "limit-operations-in-power-saver-mode")) { 226 GPowerProfileMonitor *power_monitor; 227 diff --git a/src/camel/camel-cipher-context.c b/src/camel/camel-cipher-context.c 228 - index 8013ba7..ba74769 100644 229 --- a/src/camel/camel-cipher-context.c 230 +++ b/src/camel/camel-cipher-context.c 231 @@ -1625,7 +1625,18 @@ camel_cipher_can_load_photos (void) ··· 236 + { 237 + g_autoptr(GSettingsSchemaSource) schema_source; 238 + g_autoptr(GSettingsSchema) schema; 239 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 240 + g_settings_schema_source_get_default(), 241 + TRUE, 242 + NULL); ··· 249 g_clear_object (&settings); 250 251 diff --git a/src/camel/camel-gpg-context.c b/src/camel/camel-gpg-context.c 252 - index 205372e..2023704 100644 253 --- a/src/camel/camel-gpg-context.c 254 +++ b/src/camel/camel-gpg-context.c 255 @@ -582,7 +582,18 @@ gpg_ctx_get_executable_name (void) ··· 260 + { 261 + g_autoptr(GSettingsSchemaSource) schema_source; 262 + g_autoptr(GSettingsSchema) schema; 263 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 264 + g_settings_schema_source_get_default(), 265 + TRUE, 266 + NULL); ··· 273 g_clear_object (&settings); 274 275 diff --git a/src/camel/camel-utils.c b/src/camel/camel-utils.c 276 - index e61160c..d17871a 100644 277 --- a/src/camel/camel-utils.c 278 +++ b/src/camel/camel-utils.c 279 @@ -362,7 +362,19 @@ void ··· 284 + { 285 + g_autoptr(GSettingsSchemaSource) schema_source; 286 + g_autoptr(GSettingsSchema) schema; 287 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 288 + g_settings_schema_source_get_default(), 289 + TRUE, 290 + NULL); ··· 298 G_CALLBACK (mi_user_headers_settings_changed_cb), NULL); 299 G_UNLOCK (mi_user_headers); 300 diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c 301 - index e5645e2..170a0be 100644 302 --- a/src/camel/providers/imapx/camel-imapx-server.c 303 +++ b/src/camel/providers/imapx/camel-imapx-server.c 304 @@ -5573,7 +5573,18 @@ camel_imapx_server_skip_old_flags_update (CamelStore *store) ··· 309 + { 310 + g_autoptr(GSettingsSchemaSource) schema_source; 311 + g_autoptr(GSettingsSchema) schema; 312 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 313 + g_settings_schema_source_get_default(), 314 + TRUE, 315 + NULL); ··· 322 if (g_settings_get_boolean (eds_settings, "limit-operations-in-power-saver-mode")) { 323 GPowerProfileMonitor *power_monitor; 324 diff --git a/src/camel/providers/smtp/camel-smtp-transport.c b/src/camel/providers/smtp/camel-smtp-transport.c 325 - index f535ad6..30130b9 100644 326 --- a/src/camel/providers/smtp/camel-smtp-transport.c 327 +++ b/src/camel/providers/smtp/camel-smtp-transport.c 328 @@ -1458,7 +1458,18 @@ smtp_helo (CamelSmtpTransport *transport, ··· 333 + { 334 + g_autoptr(GSettingsSchemaSource) schema_source; 335 + g_autoptr(GSettingsSchema) schema; 336 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 337 + g_settings_schema_source_get_default(), 338 + TRUE, 339 + NULL); ··· 346 g_clear_object (&settings); 347 348 diff --git a/src/libedataserver/e-network-monitor.c b/src/libedataserver/e-network-monitor.c 349 - index 188f276..7c4db94 100644 350 --- a/src/libedataserver/e-network-monitor.c 351 +++ b/src/libedataserver/e-network-monitor.c 352 @@ -256,7 +256,18 @@ e_network_monitor_constructed (GObject *object) ··· 357 + { 358 + g_autoptr(GSettingsSchemaSource) schema_source; 359 + g_autoptr(GSettingsSchema) schema; 360 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 361 + g_settings_schema_source_get_default(), 362 + TRUE, 363 + NULL); ··· 370 settings, "network-monitor-gio-name", 371 object, "gio-name", 372 diff --git a/src/libedataserver/e-oauth2-service-google.c b/src/libedataserver/e-oauth2-service-google.c 373 - index f215388..3b67126 100644 374 --- a/src/libedataserver/e-oauth2-service-google.c 375 +++ b/src/libedataserver/e-oauth2-service-google.c 376 @@ -71,7 +71,18 @@ eos_google_read_settings (EOAuth2Service *service, ··· 381 + { 382 + g_autoptr(GSettingsSchemaSource) schema_source; 383 + g_autoptr(GSettingsSchema) schema; 384 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 385 + g_settings_schema_source_get_default(), 386 + TRUE, 387 + NULL); ··· 394 g_object_unref (settings); 395 396 diff --git a/src/libedataserver/e-oauth2-service-outlook.c b/src/libedataserver/e-oauth2-service-outlook.c 397 - index 9cff0d0..fd95f0b 100644 398 --- a/src/libedataserver/e-oauth2-service-outlook.c 399 +++ b/src/libedataserver/e-oauth2-service-outlook.c 400 @@ -71,7 +71,18 @@ eos_outlook_read_settings (EOAuth2Service *service, ··· 405 + { 406 + g_autoptr(GSettingsSchemaSource) schema_source; 407 + g_autoptr(GSettingsSchema) schema; 408 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 409 + g_settings_schema_source_get_default(), 410 + TRUE, 411 + NULL); ··· 418 g_object_unref (settings); 419 420 diff --git a/src/libedataserver/e-oauth2-service-yahoo.c b/src/libedataserver/e-oauth2-service-yahoo.c 421 - index 8e4ee81..bb8f8f7 100644 422 --- a/src/libedataserver/e-oauth2-service-yahoo.c 423 +++ b/src/libedataserver/e-oauth2-service-yahoo.c 424 @@ -67,7 +67,18 @@ eos_yahoo_read_settings (EOAuth2Service *service, ··· 429 + { 430 + g_autoptr(GSettingsSchemaSource) schema_source; 431 + g_autoptr(GSettingsSchema) schema; 432 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 433 + g_settings_schema_source_get_default(), 434 + TRUE, 435 + NULL); ··· 442 g_object_unref (settings); 443 444 diff --git a/src/libedataserver/e-oauth2-service.c b/src/libedataserver/e-oauth2-service.c 445 - index 7783781..6fb22cb 100644 446 --- a/src/libedataserver/e-oauth2-service.c 447 +++ b/src/libedataserver/e-oauth2-service.c 448 @@ -90,7 +90,18 @@ eos_default_guess_can_process (EOAuth2Service *service, ··· 453 + { 454 + g_autoptr(GSettingsSchemaSource) schema_source; 455 + g_autoptr(GSettingsSchema) schema; 456 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 457 + g_settings_schema_source_get_default(), 458 + TRUE, 459 + NULL); ··· 466 g_object_unref (settings); 467 468 diff --git a/src/libedataserver/e-source-registry.c b/src/libedataserver/e-source-registry.c 469 - index 6701a3a..6b8ee33 100644 470 --- a/src/libedataserver/e-source-registry.c 471 +++ b/src/libedataserver/e-source-registry.c 472 @@ -1764,7 +1764,19 @@ e_source_registry_init (ESourceRegistry *registry) ··· 477 + { 478 + g_autoptr(GSettingsSchemaSource) schema_source; 479 + g_autoptr(GSettingsSchema) schema; 480 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 481 + g_settings_schema_source_get_default(), 482 + TRUE, 483 + NULL); ··· 491 g_signal_connect ( 492 registry->priv->settings, "changed", 493 diff --git a/src/libedataserverui/e-reminders-widget.c b/src/libedataserverui/e-reminders-widget.c 494 - index 14b6481..6dc55bb 100644 495 --- a/src/libedataserverui/e-reminders-widget.c 496 +++ b/src/libedataserverui/e-reminders-widget.c 497 @@ -1986,7 +1986,19 @@ static void ··· 502 + { 503 + g_autoptr(GSettingsSchemaSource) schema_source; 504 + g_autoptr(GSettingsSchema) schema; 505 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 506 + g_settings_schema_source_get_default(), 507 + TRUE, 508 + NULL); ··· 516 reminders->priv->is_empty = TRUE; 517 reminders->priv->is_mapped = FALSE; 518 diff --git a/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c b/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c 519 - index 6f03053..127c92e 100644 520 --- a/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c 521 +++ b/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c 522 @@ -706,7 +706,18 @@ evolution_source_registry_merge_autoconfig_sources (ESourceRegistryServer *serve ··· 527 + { 528 + g_autoptr(GSettingsSchemaSource) schema_source; 529 + g_autoptr(GSettingsSchema) schema; 530 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 531 + g_settings_schema_source_get_default(), 532 + TRUE, 533 + NULL); ··· 540 autoconfig_sources = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, e_autoconfig_free_merge_source_data); 541 542 diff --git a/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c b/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c 543 - index d531cb9..3d8807c 100644 544 --- a/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c 545 +++ b/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c 546 @@ -61,7 +61,18 @@ evolution_source_registry_migrate_proxies (ESourceRegistryServer *server) ··· 551 + { 552 + g_autoptr(GSettingsSchemaSource) schema_source; 553 + g_autoptr(GSettingsSchema) schema; 554 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 555 + g_settings_schema_source_get_default(), 556 + TRUE, 557 + NULL); ··· 564 switch (g_settings_get_int (settings, "proxy-type")) { 565 case 1: 566 diff --git a/src/services/evolution-source-registry/evolution-source-registry.c b/src/services/evolution-source-registry/evolution-source-registry.c 567 - index 1c0a113..d26b059 100644 568 --- a/src/services/evolution-source-registry/evolution-source-registry.c 569 +++ b/src/services/evolution-source-registry/evolution-source-registry.c 570 @@ -181,7 +181,18 @@ main (gint argc, ··· 575 + { 576 + g_autoptr(GSettingsSchemaSource) schema_source; 577 + g_autoptr(GSettingsSchema) schema; 578 - + schema_source = g_settings_schema_source_new_from_directory("@EDS_GSETTINGS_PATH@", 579 + g_settings_schema_source_get_default(), 580 + TRUE, 581 + NULL);
··· 1 diff --git a/src/addressbook/libebook/e-book-client.c b/src/addressbook/libebook/e-book-client.c 2 + index 7888e69..27215e4 100644 3 --- a/src/addressbook/libebook/e-book-client.c 4 +++ b/src/addressbook/libebook/e-book-client.c 5 @@ -1983,7 +1983,18 @@ e_book_client_get_self (ESourceRegistry *registry, ··· 10 + { 11 + g_autoptr(GSettingsSchemaSource) schema_source; 12 + g_autoptr(GSettingsSchema) schema; 13 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 14 + g_settings_schema_source_get_default(), 15 + TRUE, 16 + NULL); ··· 30 + { 31 + g_autoptr(GSettingsSchemaSource) schema_source; 32 + g_autoptr(GSettingsSchema) schema; 33 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 34 + g_settings_schema_source_get_default(), 35 + TRUE, 36 + NULL); ··· 51 + if (!settings) { 52 + g_autoptr(GSettingsSchemaSource) schema_source; 53 + g_autoptr(GSettingsSchema) schema; 54 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 55 + g_settings_schema_source_get_default(), 56 + TRUE, 57 + NULL); ··· 64 g_mutex_unlock (&mutex); 65 66 diff --git a/src/addressbook/libebook/e-book.c b/src/addressbook/libebook/e-book.c 67 + index 8dfff6d..fb4434b 100644 68 --- a/src/addressbook/libebook/e-book.c 69 +++ b/src/addressbook/libebook/e-book.c 70 @@ -2587,7 +2587,18 @@ e_book_get_self (ESourceRegistry *registry, ··· 75 + { 76 + g_autoptr(GSettingsSchemaSource) schema_source; 77 + g_autoptr(GSettingsSchema) schema; 78 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 79 + g_settings_schema_source_get_default(), 80 + TRUE, 81 + NULL); ··· 95 + { 96 + g_autoptr(GSettingsSchemaSource) schema_source; 97 + g_autoptr(GSettingsSchema) schema; 98 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 99 + g_settings_schema_source_get_default(), 100 + TRUE, 101 + NULL); ··· 115 + { 116 + g_autoptr(GSettingsSchemaSource) schema_source; 117 + g_autoptr(GSettingsSchema) schema; 118 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 119 + g_settings_schema_source_get_default(), 120 + TRUE, 121 + NULL); ··· 128 g_object_unref (settings); 129 130 diff --git a/src/addressbook/libedata-book/e-book-meta-backend.c b/src/addressbook/libedata-book/e-book-meta-backend.c 131 + index d3f130e..bc820e9 100644 132 --- a/src/addressbook/libedata-book/e-book-meta-backend.c 133 +++ b/src/addressbook/libedata-book/e-book-meta-backend.c 134 @@ -135,7 +135,18 @@ ebmb_is_power_saver_enabled (void) ··· 139 + { 140 + g_autoptr(GSettingsSchemaSource) schema_source; 141 + g_autoptr(GSettingsSchema) schema; 142 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 143 + g_settings_schema_source_get_default(), 144 + TRUE, 145 + NULL); ··· 152 if (g_settings_get_boolean (settings, "limit-operations-in-power-saver-mode")) { 153 GPowerProfileMonitor *power_monitor; 154 diff --git a/src/calendar/backends/contacts/e-cal-backend-contacts.c b/src/calendar/backends/contacts/e-cal-backend-contacts.c 155 + index 42f3457..b4926af 100644 156 --- a/src/calendar/backends/contacts/e-cal-backend-contacts.c 157 +++ b/src/calendar/backends/contacts/e-cal-backend-contacts.c 158 @@ -1387,7 +1387,18 @@ e_cal_backend_contacts_init (ECalBackendContacts *cbc) ··· 163 + { 164 + g_autoptr(GSettingsSchemaSource) schema_source; 165 + g_autoptr(GSettingsSchema) schema; 166 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 167 + g_settings_schema_source_get_default(), 168 + TRUE, 169 + NULL); ··· 176 cbc->priv->update_alarms_id = 0; 177 cbc->priv->alarm_enabled = FALSE; 178 diff --git a/src/calendar/libecal/e-reminder-watcher.c b/src/calendar/libecal/e-reminder-watcher.c 179 + index 52095a4..184b657 100644 180 --- a/src/calendar/libecal/e-reminder-watcher.c 181 +++ b/src/calendar/libecal/e-reminder-watcher.c 182 @@ -2555,7 +2555,19 @@ e_reminder_watcher_init (EReminderWatcher *watcher) ··· 187 + { 188 + g_autoptr(GSettingsSchemaSource) schema_source; 189 + g_autoptr(GSettingsSchema) schema; 190 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 191 + g_settings_schema_source_get_default(), 192 + TRUE, 193 + NULL); ··· 201 watcher->priv->default_zone = e_cal_util_copy_timezone (zone); 202 watcher->priv->timers_enabled = TRUE; 203 diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.c b/src/calendar/libedata-cal/e-cal-meta-backend.c 204 + index 94a875f..1d2ed92 100644 205 --- a/src/calendar/libedata-cal/e-cal-meta-backend.c 206 +++ b/src/calendar/libedata-cal/e-cal-meta-backend.c 207 @@ -149,7 +149,18 @@ ecmb_is_power_saver_enabled (void) ··· 212 + { 213 + g_autoptr(GSettingsSchemaSource) schema_source; 214 + g_autoptr(GSettingsSchema) schema; 215 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 216 + g_settings_schema_source_get_default(), 217 + TRUE, 218 + NULL); ··· 225 if (g_settings_get_boolean (settings, "limit-operations-in-power-saver-mode")) { 226 GPowerProfileMonitor *power_monitor; 227 diff --git a/src/camel/camel-cipher-context.c b/src/camel/camel-cipher-context.c 228 + index 8013ba7..1bba6d1 100644 229 --- a/src/camel/camel-cipher-context.c 230 +++ b/src/camel/camel-cipher-context.c 231 @@ -1625,7 +1625,18 @@ camel_cipher_can_load_photos (void) ··· 236 + { 237 + g_autoptr(GSettingsSchemaSource) schema_source; 238 + g_autoptr(GSettingsSchema) schema; 239 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 240 + g_settings_schema_source_get_default(), 241 + TRUE, 242 + NULL); ··· 249 g_clear_object (&settings); 250 251 diff --git a/src/camel/camel-gpg-context.c b/src/camel/camel-gpg-context.c 252 + index 205372e..f75a88e 100644 253 --- a/src/camel/camel-gpg-context.c 254 +++ b/src/camel/camel-gpg-context.c 255 @@ -582,7 +582,18 @@ gpg_ctx_get_executable_name (void) ··· 260 + { 261 + g_autoptr(GSettingsSchemaSource) schema_source; 262 + g_autoptr(GSettingsSchema) schema; 263 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 264 + g_settings_schema_source_get_default(), 265 + TRUE, 266 + NULL); ··· 273 g_clear_object (&settings); 274 275 diff --git a/src/camel/camel-utils.c b/src/camel/camel-utils.c 276 + index e61160c..b6553a4 100644 277 --- a/src/camel/camel-utils.c 278 +++ b/src/camel/camel-utils.c 279 @@ -362,7 +362,19 @@ void ··· 284 + { 285 + g_autoptr(GSettingsSchemaSource) schema_source; 286 + g_autoptr(GSettingsSchema) schema; 287 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 288 + g_settings_schema_source_get_default(), 289 + TRUE, 290 + NULL); ··· 298 G_CALLBACK (mi_user_headers_settings_changed_cb), NULL); 299 G_UNLOCK (mi_user_headers); 300 diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c 301 + index e5645e2..96a1ce3 100644 302 --- a/src/camel/providers/imapx/camel-imapx-server.c 303 +++ b/src/camel/providers/imapx/camel-imapx-server.c 304 @@ -5573,7 +5573,18 @@ camel_imapx_server_skip_old_flags_update (CamelStore *store) ··· 309 + { 310 + g_autoptr(GSettingsSchemaSource) schema_source; 311 + g_autoptr(GSettingsSchema) schema; 312 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 313 + g_settings_schema_source_get_default(), 314 + TRUE, 315 + NULL); ··· 322 if (g_settings_get_boolean (eds_settings, "limit-operations-in-power-saver-mode")) { 323 GPowerProfileMonitor *power_monitor; 324 diff --git a/src/camel/providers/smtp/camel-smtp-transport.c b/src/camel/providers/smtp/camel-smtp-transport.c 325 + index f535ad6..918975d 100644 326 --- a/src/camel/providers/smtp/camel-smtp-transport.c 327 +++ b/src/camel/providers/smtp/camel-smtp-transport.c 328 @@ -1458,7 +1458,18 @@ smtp_helo (CamelSmtpTransport *transport, ··· 333 + { 334 + g_autoptr(GSettingsSchemaSource) schema_source; 335 + g_autoptr(GSettingsSchema) schema; 336 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 337 + g_settings_schema_source_get_default(), 338 + TRUE, 339 + NULL); ··· 346 g_clear_object (&settings); 347 348 diff --git a/src/libedataserver/e-network-monitor.c b/src/libedataserver/e-network-monitor.c 349 + index 188f276..939f89b 100644 350 --- a/src/libedataserver/e-network-monitor.c 351 +++ b/src/libedataserver/e-network-monitor.c 352 @@ -256,7 +256,18 @@ e_network_monitor_constructed (GObject *object) ··· 357 + { 358 + g_autoptr(GSettingsSchemaSource) schema_source; 359 + g_autoptr(GSettingsSchema) schema; 360 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 361 + g_settings_schema_source_get_default(), 362 + TRUE, 363 + NULL); ··· 370 settings, "network-monitor-gio-name", 371 object, "gio-name", 372 diff --git a/src/libedataserver/e-oauth2-service-google.c b/src/libedataserver/e-oauth2-service-google.c 373 + index f215388..501222e 100644 374 --- a/src/libedataserver/e-oauth2-service-google.c 375 +++ b/src/libedataserver/e-oauth2-service-google.c 376 @@ -71,7 +71,18 @@ eos_google_read_settings (EOAuth2Service *service, ··· 381 + { 382 + g_autoptr(GSettingsSchemaSource) schema_source; 383 + g_autoptr(GSettingsSchema) schema; 384 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 385 + g_settings_schema_source_get_default(), 386 + TRUE, 387 + NULL); ··· 394 g_object_unref (settings); 395 396 diff --git a/src/libedataserver/e-oauth2-service-outlook.c b/src/libedataserver/e-oauth2-service-outlook.c 397 + index 9cff0d0..4c9a203 100644 398 --- a/src/libedataserver/e-oauth2-service-outlook.c 399 +++ b/src/libedataserver/e-oauth2-service-outlook.c 400 @@ -71,7 +71,18 @@ eos_outlook_read_settings (EOAuth2Service *service, ··· 405 + { 406 + g_autoptr(GSettingsSchemaSource) schema_source; 407 + g_autoptr(GSettingsSchema) schema; 408 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 409 + g_settings_schema_source_get_default(), 410 + TRUE, 411 + NULL); ··· 418 g_object_unref (settings); 419 420 diff --git a/src/libedataserver/e-oauth2-service-yahoo.c b/src/libedataserver/e-oauth2-service-yahoo.c 421 + index 8e4ee81..cc94026 100644 422 --- a/src/libedataserver/e-oauth2-service-yahoo.c 423 +++ b/src/libedataserver/e-oauth2-service-yahoo.c 424 @@ -67,7 +67,18 @@ eos_yahoo_read_settings (EOAuth2Service *service, ··· 429 + { 430 + g_autoptr(GSettingsSchemaSource) schema_source; 431 + g_autoptr(GSettingsSchema) schema; 432 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 433 + g_settings_schema_source_get_default(), 434 + TRUE, 435 + NULL); ··· 442 g_object_unref (settings); 443 444 diff --git a/src/libedataserver/e-oauth2-service.c b/src/libedataserver/e-oauth2-service.c 445 + index 7783781..6a2db01 100644 446 --- a/src/libedataserver/e-oauth2-service.c 447 +++ b/src/libedataserver/e-oauth2-service.c 448 @@ -90,7 +90,18 @@ eos_default_guess_can_process (EOAuth2Service *service, ··· 453 + { 454 + g_autoptr(GSettingsSchemaSource) schema_source; 455 + g_autoptr(GSettingsSchema) schema; 456 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 457 + g_settings_schema_source_get_default(), 458 + TRUE, 459 + NULL); ··· 466 g_object_unref (settings); 467 468 diff --git a/src/libedataserver/e-source-registry.c b/src/libedataserver/e-source-registry.c 469 + index 6701a3a..f497263 100644 470 --- a/src/libedataserver/e-source-registry.c 471 +++ b/src/libedataserver/e-source-registry.c 472 @@ -1764,7 +1764,19 @@ e_source_registry_init (ESourceRegistry *registry) ··· 477 + { 478 + g_autoptr(GSettingsSchemaSource) schema_source; 479 + g_autoptr(GSettingsSchema) schema; 480 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 481 + g_settings_schema_source_get_default(), 482 + TRUE, 483 + NULL); ··· 491 g_signal_connect ( 492 registry->priv->settings, "changed", 493 diff --git a/src/libedataserverui/e-reminders-widget.c b/src/libedataserverui/e-reminders-widget.c 494 + index 14b6481..7149b74 100644 495 --- a/src/libedataserverui/e-reminders-widget.c 496 +++ b/src/libedataserverui/e-reminders-widget.c 497 @@ -1986,7 +1986,19 @@ static void ··· 502 + { 503 + g_autoptr(GSettingsSchemaSource) schema_source; 504 + g_autoptr(GSettingsSchema) schema; 505 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 506 + g_settings_schema_source_get_default(), 507 + TRUE, 508 + NULL); ··· 516 reminders->priv->is_empty = TRUE; 517 reminders->priv->is_mapped = FALSE; 518 diff --git a/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c b/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c 519 + index 6f03053..b5db6b2 100644 520 --- a/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c 521 +++ b/src/services/evolution-source-registry/evolution-source-registry-autoconfig.c 522 @@ -706,7 +706,18 @@ evolution_source_registry_merge_autoconfig_sources (ESourceRegistryServer *serve ··· 527 + { 528 + g_autoptr(GSettingsSchemaSource) schema_source; 529 + g_autoptr(GSettingsSchema) schema; 530 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 531 + g_settings_schema_source_get_default(), 532 + TRUE, 533 + NULL); ··· 540 autoconfig_sources = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, e_autoconfig_free_merge_source_data); 541 542 diff --git a/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c b/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c 543 + index d531cb9..c96f1d5 100644 544 --- a/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c 545 +++ b/src/services/evolution-source-registry/evolution-source-registry-migrate-proxies.c 546 @@ -61,7 +61,18 @@ evolution_source_registry_migrate_proxies (ESourceRegistryServer *server) ··· 551 + { 552 + g_autoptr(GSettingsSchemaSource) schema_source; 553 + g_autoptr(GSettingsSchema) schema; 554 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 555 + g_settings_schema_source_get_default(), 556 + TRUE, 557 + NULL); ··· 564 switch (g_settings_get_int (settings, "proxy-type")) { 565 case 1: 566 diff --git a/src/services/evolution-source-registry/evolution-source-registry.c b/src/services/evolution-source-registry/evolution-source-registry.c 567 + index 1c0a113..6b41423 100644 568 --- a/src/services/evolution-source-registry/evolution-source-registry.c 569 +++ b/src/services/evolution-source-registry/evolution-source-registry.c 570 @@ -181,7 +181,18 @@ main (gint argc, ··· 575 + { 576 + g_autoptr(GSettingsSchemaSource) schema_source; 577 + g_autoptr(GSettingsSchema) schema; 578 + + schema_source = g_settings_schema_source_new_from_directory("@EDS@", 579 + g_settings_schema_source_get_default(), 580 + TRUE, 581 + NULL);
+51
pkgs/development/libraries/glib/default.nix
··· 8 , coreutils, dbus, libxml2, tzdata 9 , desktop-file-utils, shared-mime-info 10 , darwin 11 }: 12 13 assert stdenv.isLinux -> util-linuxMinimal != null; ··· 246 packageName = "glib"; 247 versionPolicy = "odd-unstable"; 248 }; 249 }; 250 251 meta = with lib; {
··· 8 , coreutils, dbus, libxml2, tzdata 9 , desktop-file-utils, shared-mime-info 10 , darwin 11 + # update script 12 + , runCommand, git, coccinelle 13 }: 14 15 assert stdenv.isLinux -> util-linuxMinimal != null; ··· 248 packageName = "glib"; 249 versionPolicy = "odd-unstable"; 250 }; 251 + /* 252 + can be used as part of an update script to automatically create a patch 253 + hardcoding the path of all gsettings schemas in C code. 254 + For example: 255 + passthru = { 256 + hardcodeGsettingsPatch = glib.mkHardcodeGsettingsPatch { 257 + inherit src; 258 + glib-schema-to-var = { 259 + ... 260 + }; 261 + }; 262 + 263 + updateScript = 264 + let 265 + updateSource = ...; 266 + patch = _experimental-update-script-combinators.copyAttrOutputToFile "evolution-ews.hardcodeGsettingsPatch" ./hardcode-gsettings.patch; 267 + in 268 + _experimental-update-script-combinators.sequence [ 269 + updateSource 270 + patch 271 + ]; 272 + }; 273 + } 274 + takes as input a mapping from schema path to variable name. 275 + For example `{ "org.gnome.evolution" = "EVOLUTION_SCHEMA_PATH"; }` 276 + hardcodes looking for `org.gnome.evolution` into `@EVOLUTION_SCHEMA_PATH@`. 277 + All schemas must be listed. 278 + */ 279 + mkHardcodeGsettingsPatch = { src, glib-schema-to-var }: 280 + runCommand 281 + "hardcode-gsettings.patch" 282 + { 283 + inherit src; 284 + nativeBuildInputs = [ 285 + git 286 + coccinelle 287 + python3 # For patch script 288 + ]; 289 + } 290 + '' 291 + unpackPhase 292 + cd "''${sourceRoot:-.}" 293 + set -x 294 + cp ${builtins.toFile "glib-schema-to-var.json" (builtins.toJSON glib-schema-to-var)} ./glib-schema-to-var.json 295 + git init 296 + git add -A 297 + spatch --sp-file "${./hardcode-gsettings.cocci}" --dir . --in-place 298 + git diff > "$out" 299 + ''; 300 }; 301 302 meta = with lib; {