mate.caja-extensions: 1.26.1 -> 1.28.0

https://github.com/mate-desktop/caja-extensions/compare/v1.26.1...v1.28.0

Also removes hardcode-gsettings.patch:

* caja-with-extensions should handle this fine.
* We don't set CAJA_EXTENSION_DIR using sessionVariables now.
This commit is contained in:
Bobby Rong 2024-02-22 12:41:28 +00:00
parent 650cbb520a
commit 39efd9dbbc
No known key found for this signature in database
2 changed files with 13 additions and 192 deletions

View File

@ -3,23 +3,24 @@
, fetchurl
, pkg-config
, gettext
, caja
, glib
, gst_all_1
, gtk3
, gupnp
, mate
, imagemagick
, mate-desktop
, wrapGAppsHook
, mateUpdateScript
, glib
, substituteAll
}:
stdenv.mkDerivation rec {
pname = "caja-extensions";
version = "1.26.1";
version = "1.28.0";
src = fetchurl {
url = "https://pub.mate-desktop.org/releases/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "WJwZ4/oQJC1iOaXMuVhVmENqVuvpTS6ypQtZUMzh1SA=";
sha256 = "0phsXgdAg1/icc+9WCPu6vAyka8XYyA/RwCruBCeMXU=";
};
nativeBuildInputs = [
@ -29,31 +30,20 @@ stdenv.mkDerivation rec {
];
buildInputs = [
caja
glib
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gtk3
gupnp
mate.caja
mate.mate-desktop
imagemagick
];
patches = [
(substituteAll {
src = ./hardcode-gsettings.patch;
caja_gsetttings_path = glib.getSchemaPath mate.caja;
desktop_gsetttings_path = glib.getSchemaPath mate.mate-desktop;
})
mate-desktop
];
postPatch = ''
substituteInPlace open-terminal/caja-open-terminal.c --subst-var-by \
GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"}
substituteInPlace sendto/caja-sendto-command.c --subst-var-by \
GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"}
substituteInPlace wallpaper/caja-wallpaper-extension.c --subst-var-by \
GSETTINGS_PATH ${glib.makeSchemaPath "$out" "${pname}-${version}"}
for f in image-converter/caja-image-{resizer,rotator}.c; do
substituteInPlace $f --replace "/usr/bin/convert" "${imagemagick}/bin/convert"
substituteInPlace $f --replace-fail 'argv[0] = "convert"' 'argv[0] = "${imagemagick}/bin/convert"'
done
'';

View File

@ -1,169 +0,0 @@
diff --git a/open-terminal/caja-open-terminal.c b/open-terminal/caja-open-terminal.c
index e14a9bf..691afab 100644
--- a/open-terminal/caja-open-terminal.c
+++ b/open-terminal/caja-open-terminal.c
@@ -135,8 +135,18 @@ desktop_opens_home_dir (void)
{
gboolean result;
GSettings* settings;
-
- settings = g_settings_new (COT_SCHEMA);
+ GSettingsSchemaSource* schema_source;
+ GSettingsSchema* schema;
+
+ schema_source = g_settings_schema_source_new_from_directory("@GSETTINGS_PATH@",
+ g_settings_schema_source_get_default(),
+ TRUE, NULL);
+ schema = g_settings_schema_source_lookup(schema_source,
+ COT_SCHEMA,
+ FALSE);
+ settings = g_settings_new_full(schema, NULL, NULL);
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
result = g_settings_get_boolean (settings, COT_DESKTOP_KEY);
g_object_unref (settings);
return result;
@@ -147,8 +157,18 @@ set_desktop_opens_home_dir (gboolean val)
{
gboolean result;
GSettings* settings;
-
- settings = g_settings_new (COT_SCHEMA);
+ GSettingsSchemaSource* schema_source;
+ GSettingsSchema* schema;
+
+ schema_source = g_settings_schema_source_new_from_directory("@GSETTINGS_PATH@",
+ g_settings_schema_source_get_default(),
+ TRUE, NULL);
+ schema = g_settings_schema_source_lookup(schema_source,
+ COT_SCHEMA,
+ FALSE);
+ settings = g_settings_new_full(schema, NULL, NULL);
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
result = g_settings_set_boolean (settings, COT_DESKTOP_KEY, val);
g_object_unref (settings);
return result;
@@ -159,8 +179,18 @@ desktop_is_home_dir (void)
{
gboolean result;
GSettings* settings;
-
- settings = g_settings_new (CAJA_SCHEMA);
+ GSettingsSchemaSource* schema_source;
+ GSettingsSchema* schema;
+
+ schema_source = g_settings_schema_source_new_from_directory("@caja_gsetttings_path@",
+ g_settings_schema_source_get_default(),
+ TRUE, NULL);
+ schema = g_settings_schema_source_lookup(schema_source,
+ CAJA_SCHEMA,
+ FALSE);
+ settings = g_settings_new_full(schema, NULL, NULL);
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
result = g_settings_get_boolean (settings, CAJA_DESKTOP_KEY);
g_object_unref (settings);
return result;
@@ -171,8 +201,18 @@ default_terminal_application (void)
{
gchar *result;
GSettings* settings;
-
- settings = g_settings_new (TERM_SCHEMA);
+ GSettingsSchemaSource* schema_source;
+ GSettingsSchema* schema;
+
+ schema_source = g_settings_schema_source_new_from_directory("@desktop_gsetttings_path@",
+ g_settings_schema_source_get_default(),
+ TRUE, NULL);
+ schema = g_settings_schema_source_lookup(schema_source,
+ TERM_SCHEMA,
+ FALSE);
+ settings = g_settings_new_full(schema, NULL, NULL);
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
result = g_settings_get_string (settings, TERM_EXEC_KEY);
g_object_unref (settings);
@@ -189,8 +229,18 @@ set_default_terminal_application (const gchar* exec)
{
gboolean result;
GSettings* settings;
-
- settings = g_settings_new (TERM_SCHEMA);
+ GSettingsSchemaSource* schema_source;
+ GSettingsSchema* schema;
+
+ schema_source = g_settings_schema_source_new_from_directory("@desktop_gsetttings_path@",
+ g_settings_schema_source_get_default(),
+ TRUE, NULL);
+ schema = g_settings_schema_source_lookup(schema_source,
+ TERM_SCHEMA,
+ FALSE);
+ settings = g_settings_new_full(schema, NULL, NULL);
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
result = g_settings_set_string (settings, TERM_EXEC_KEY, exec);
g_object_unref (settings);
return result;
diff --git a/sendto/caja-sendto-command.c b/sendto/caja-sendto-command.c
index 8181db6..579dc81 100644
--- a/sendto/caja-sendto-command.c
+++ b/sendto/caja-sendto-command.c
@@ -801,6 +801,8 @@ caja_sendto_init (void)
int main (int argc, char **argv)
{
GOptionContext *context;
+ GSettingsSchemaSource* schema_source;
+ GSettingsSchema* schema;
GError *error = NULL;
#ifdef ENABLE_NLS
@@ -818,7 +820,15 @@ int main (int argc, char **argv)
return 1;
}
- settings = g_settings_new ("org.mate.Caja.Sendto");
+ schema_source = g_settings_schema_source_new_from_directory("@GSETTINGS_PATH@",
+ g_settings_schema_source_get_default(),
+ TRUE, NULL);
+ schema = g_settings_schema_source_lookup(schema_source,
+ "org.mate.Caja.Sendto",
+ FALSE);
+ settings = g_settings_new_full(schema, NULL, NULL);
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
caja_sendto_init ();
if (caja_sendto_plugin_init () == FALSE) {
GtkWidget *error_dialog;
diff --git a/wallpaper/caja-wallpaper-extension.c b/wallpaper/caja-wallpaper-extension.c
index 3119e9f..4f80c88 100644
--- a/wallpaper/caja-wallpaper-extension.c
+++ b/wallpaper/caja-wallpaper-extension.c
@@ -47,6 +47,8 @@ set_wallpaper_callback (CajaMenuItem *item,
{
GList *files;
GSettings *settings;
+ GSettingsSchemaSource* schema_source;
+ GSettingsSchema* schema;
CajaFileInfo *file;
gchar *uri;
gchar *filename;
@@ -57,7 +59,15 @@ set_wallpaper_callback (CajaMenuItem *item,
uri = caja_file_info_get_uri (file);
filename = g_filename_from_uri(uri, NULL, NULL);
- settings = g_settings_new (WP_SCHEMA);
+ schema_source = g_settings_schema_source_new_from_directory("@desktop_gsetttings_path@",
+ g_settings_schema_source_get_default(),
+ TRUE, NULL);
+ schema = g_settings_schema_source_lookup(schema_source,
+ WP_SCHEMA,
+ FALSE);
+ settings = g_settings_new_full(schema, NULL, NULL);
+ g_settings_schema_source_unref(schema_source);
+ g_settings_schema_unref(schema);
g_settings_set_string (settings, WP_FILE_KEY, filename);