diff options
author | Roelof Wobben <r.wobben@home.nl> | 2014-04-13 11:19:02 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2014-04-13 11:57:12 +0200 |
commit | 0096bb677a391151c3864c927fc26f37c397d30f (patch) | |
tree | fa0ef07906a1597925514c4f2d5ced8b6e60582f | |
parent | 6989b9a3f90949f5e14bd946b7aa4e1ea658bb5f (diff) |
new package: cinnamon-settings-daemon (close #2205)
With tiny changes from @vcunat.
-rw-r--r-- | pkgs/desktops/cinnamon/automount-plugin.patch | 448 | ||||
-rw-r--r-- | pkgs/desktops/cinnamon/cinnamon-settings-daemon.nix | 52 | ||||
-rw-r--r-- | pkgs/desktops/cinnamon/dpms.patch | 30 | ||||
-rw-r--r-- | pkgs/desktops/cinnamon/keyboard.patch | 4729 | ||||
-rw-r--r-- | pkgs/desktops/cinnamon/systemd-support.patch | 536 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 |
6 files changed, 5798 insertions, 1 deletions
diff --git a/pkgs/desktops/cinnamon/automount-plugin.patch b/pkgs/desktops/cinnamon/automount-plugin.patch new file mode 100644 index 000000000000..3d90da99f088 --- /dev/null +++ b/pkgs/desktops/cinnamon/automount-plugin.patch @@ -0,0 +1,448 @@ + +diff -Naur cinnamon-settings-daemon-2.0.1.orig/data/org.cinnamon.settings-daemon.plugins.gschema.xml.in.in cinnamon-settings-daemon-2.0.1/data/org.cinnamon.settings-daemon.plugins.gschema.xml.in.in +--- cinnamon-settings-daemon-2.0.6.orig/data/org.cinnamon.settings-daemon.plugins.gschema.xml.in.in 2013-11-03 10:50:04.000000000 -0500 ++++ cinnamon-settings-daemon-2.0.6/data/org.cinnamon.settings-daemon.plugins.gschema.xml.in.in 2013-11-05 15:33:21.112912392 -0500 +@@ -2,6 +2,7 @@ + <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.cinnamon.settings-daemon.plugins" path="/org/cinnamon/settings-daemon/plugins/"> + <child name="a11y-keyboard" schema="org.cinnamon.settings-daemon.plugins.a11y-keyboard"/> + <child name="a11y-settings" schema="org.cinnamon.settings-daemon.plugins.a11y-settings"/> ++ <child name="automount" schema="org.cinnamon.settings-daemon.plugins.automount"/> + <child name="clipboard" schema="org.cinnamon.settings-daemon.plugins.clipboard"/> + <child name="color" schema="org.cinnamon.settings-daemon.plugins.color"/> + <child name="cursor" schema="org.cinnamon.settings-daemon.plugins.cursor"/> +@@ -42,6 +43,18 @@ + <_summary>Priority to use for this plugin</_summary> + <_description>Priority to use for this plugin in cinnamon-settings-daemon startup queue</_description> + </key> ++ </schema> ++ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.cinnamon.settings-daemon.plugins.automount" path="/org/cinnamon/settings-daemon/plugins/automount/"> ++ <key name="active" type="b"> ++ <default>true</default> ++ <_summary>Activation of this plugin</_summary> ++ <_description>Whether this plugin would be activated by cinnamon-settings-daemon or not</_description> ++ </key> ++ <key name="priority" type="i"> ++ <default>97</default> ++ <_summary>Priority to use for this plugin</_summary> ++ <_description>Priority to use for this plugin in cinnamon-settings-daemon startup queue</_description> ++ </key> + </schema> + <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.cinnamon.settings-daemon.plugins.clipboard" path="/org/cinnamon/settings-daemon/plugins/clipboard/"> + <key name="active" type="b"> +diff -Naur cinnamon-settings-daemon-2.0.1.orig/plugins/automount/automount.cinnamon-settings-plugin.in cinnamon-settings-daemon-2.0.1/plugins/automount/automount.cinnamon-settings-plugin.in +--- cinnamon-settings-daemon-2.0.1.orig/plugins/automount/automount.cinnamon-settings-plugin.in 1970-01-01 01:00:00.000000000 +0100 ++++ cinnamon-settings-daemon-2.0.1/plugins/automount/automount.cinnamon-settings-plugin.in 2013-10-08 22:35:10.771472456 +0200 +@@ -0,0 +1,8 @@ ++[Cinnamon Settings Plugin] ++Module=automount ++IAge=0 ++_Name=Automount ++_Description=Automounter plugin ++Authors=Tomas Bzatek ++Copyright=Copyright © 2010 Red Hat, Inc. ++Website= +diff -Naur cinnamon-settings-daemon-2.0.1.orig/plugins/automount/cinnamon-fallback-mount-helper.c cinnamon-settings-daemon-2.0.1/plugins/automount/cinnamon-fallback-mount-helper.c +--- cinnamon-settings-daemon-2.0.1.orig/plugins/automount/cinnamon-fallback-mount-helper.c 2013-10-02 16:13:56.000000000 +0200 ++++ cinnamon-settings-daemon-2.0.1/plugins/automount/cinnamon-fallback-mount-helper.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,65 +0,0 @@ +-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- +- * +- * Copyright (C) 2010 Red Hat, Inc. +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA +- * +- * Author: Tomas Bzatek <tbzatek@redhat.com> +- */ +- +-#include "config.h" +- +-#include <glib.h> +-#include <glib/gi18n.h> +-#include <unistd.h> +-#include <gtk/gtk.h> +- +-#include "csd-automount-manager.h" +- +-int +-main (int argc, +- char **argv) +-{ +- GMainLoop *loop; +- CsdAutomountManager *manager; +- GError *error = NULL; +- +- g_type_init (); +- gtk_init (&argc, &argv); +- +- bindtextdomain (GETTEXT_PACKAGE, CINNAMON_SETTINGS_LOCALEDIR); +- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +- textdomain (GETTEXT_PACKAGE); +- +- loop = g_main_loop_new (NULL, FALSE); +- manager = csd_automount_manager_new (); +- +- csd_automount_manager_start (manager, &error); +- +- if (error != NULL) { +- g_printerr ("Unable to start the mount manager: %s", +- error->message); +- +- g_error_free (error); +- _exit (1); +- } +- +- g_main_loop_run (loop); +- +- csd_automount_manager_stop (manager); +- g_main_loop_unref (loop); +- +- return 0; +-} +diff -Naur cinnamon-settings-daemon-2.0.1.orig/plugins/automount/cinnamon-fallback-mount-helper.desktop.in.in cinnamon-settings-daemon-2.0.1/plugins/automount/cinnamon-fallback-mount-helper.desktop.in.in +--- cinnamon-settings-daemon-2.0.1.orig/plugins/automount/cinnamon-fallback-mount-helper.desktop.in.in 2013-10-02 16:13:56.000000000 +0200 ++++ cinnamon-settings-daemon-2.0.1/plugins/automount/cinnamon-fallback-mount-helper.desktop.in.in 1970-01-01 01:00:00.000000000 +0100 +@@ -1,12 +0,0 @@ +-[Desktop Entry] +-_Name=Mount Helper +-_Comment=Automount and autorun plugged devices +-Exec=@LIBEXECDIR@/cinnamon-fallback-mount-helper +-Icon=drive-optical +-Terminal=false +-Type=Application +-Categories= +-NoDisplay=true +-OnlyShowIn=GNOME; +-X-GNOME-Autostart-Notify=true +- +diff -Naur cinnamon-settings-daemon-2.0.1.orig/plugins/automount/csd-automount-plugin.c cinnamon-settings-daemon-2.0.1/plugins/automount/csd-automount-plugin.c +--- cinnamon-settings-daemon-2.0.1.orig/plugins/automount/csd-automount-plugin.c 1970-01-01 01:00:00.000000000 +0100 ++++ cinnamon-settings-daemon-2.0.1/plugins/automount/csd-automount-plugin.c 2013-10-08 22:35:10.771472456 +0200 +@@ -0,0 +1,106 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2010 Red Hat, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Author: Tomas Bzatek <tbzatek@redhat.com> ++ */ ++ ++#include "config.h" ++ ++#include <glib/gi18n-lib.h> ++#include <gmodule.h> ++ ++#include "cinnamon-settings-plugin.h" ++#include "csd-automount-plugin.h" ++#include "csd-automount-manager.h" ++ ++struct CsdAutomountPluginPrivate { ++ CsdAutomountManager *manager; ++}; ++ ++#define CSD_AUTOMOUNT_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), CSD_TYPE_AUTOMOUNT_PLUGIN, CsdAutomountPluginPrivate)) ++ ++CINNAMON_SETTINGS_PLUGIN_REGISTER (CsdAutomountPlugin, csd_automount_plugin) ++ ++static void ++csd_automount_plugin_init (CsdAutomountPlugin *plugin) ++{ ++ plugin->priv = CSD_AUTOMOUNT_PLUGIN_GET_PRIVATE (plugin); ++ ++ g_debug ("Automount plugin initializing"); ++ ++ plugin->priv->manager = csd_automount_manager_new (); ++} ++ ++static void ++csd_automount_plugin_finalize (GObject *object) ++{ ++ CsdAutomountPlugin *plugin; ++ ++ g_return_if_fail (object != NULL); ++ g_return_if_fail (CSD_IS_AUTOMOUNT_PLUGIN (object)); ++ ++ g_debug ("Automount plugin finalizing"); ++ ++ plugin = CSD_AUTOMOUNT_PLUGIN (object); ++ ++ g_return_if_fail (plugin->priv != NULL); ++ ++ if (plugin->priv->manager != NULL) { ++ g_object_unref (plugin->priv->manager); ++ } ++ ++ G_OBJECT_CLASS (csd_automount_plugin_parent_class)->finalize (object); ++} ++ ++static void ++impl_activate (CinnamonSettingsPlugin *plugin) ++{ ++ gboolean res; ++ GError *error; ++ ++ g_debug ("Activating automount plugin"); ++ ++ error = NULL; ++ res = csd_automount_manager_start (CSD_AUTOMOUNT_PLUGIN (plugin)->priv->manager, &error); ++ if (! res) { ++ g_warning ("Unable to start automount manager: %s", error->message); ++ g_error_free (error); ++ } ++} ++ ++static void ++impl_deactivate (CinnamonSettingsPlugin *plugin) ++{ ++ g_debug ("Deactivating automount plugin"); ++ csd_automount_manager_stop (CSD_AUTOMOUNT_PLUGIN (plugin)->priv->manager); ++} ++ ++static void ++csd_automount_plugin_class_init (CsdAutomountPluginClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ CinnamonSettingsPluginClass *plugin_class = CINNAMON_SETTINGS_PLUGIN_CLASS (klass); ++ ++ object_class->finalize = csd_automount_plugin_finalize; ++ ++ plugin_class->activate = impl_activate; ++ plugin_class->deactivate = impl_deactivate; ++ ++ g_type_class_add_private (klass, sizeof (CsdAutomountPluginPrivate)); ++} ++ +diff -Naur cinnamon-settings-daemon-2.0.1.orig/plugins/automount/csd-automount-plugin.h cinnamon-settings-daemon-2.0.1/plugins/automount/csd-automount-plugin.h +--- cinnamon-settings-daemon-2.0.1.orig/plugins/automount/csd-automount-plugin.h 1970-01-01 01:00:00.000000000 +0100 ++++ cinnamon-settings-daemon-2.0.1/plugins/automount/csd-automount-plugin.h 2013-10-08 22:35:10.771472456 +0200 +@@ -0,0 +1,60 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2010 Red Hat, Inc. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Author: Tomas Bzatek <tbzatek@redhat.com> ++ */ ++ ++#ifndef __CSD_AUTOMOUNT_PLUGIN_H__ ++#define __CSD_AUTOMOUNT_PLUGIN_H__ ++ ++#include <glib.h> ++#include <glib-object.h> ++#include <gmodule.h> ++ ++#include "cinnamon-settings-plugin.h" ++ ++G_BEGIN_DECLS ++ ++#define CSD_TYPE_AUTOMOUNT_PLUGIN (csd_automount_plugin_get_type ()) ++#define CSD_AUTOMOUNT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CSD_TYPE_AUTOMOUNT_PLUGIN, CsdAutomountPlugin)) ++#define CSD_AUTOMOUNT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CSD_TYPE_AUTOMOUNT_PLUGIN, CsdAutomountPluginClass)) ++#define CSD_IS_AUTOMOUNT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CSD_TYPE_AUTOMOUNT_PLUGIN)) ++#define CSD_IS_AUTOMOUNT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CSD_TYPE_AUTOMOUNT_PLUGIN)) ++#define CSD_AUTOMOUNT_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CSD_TYPE_AUTOMOUNT_PLUGIN, CsdAutomountPluginClass)) ++ ++typedef struct CsdAutomountPluginPrivate CsdAutomountPluginPrivate; ++ ++typedef struct ++{ ++ CinnamonSettingsPlugin parent; ++ CsdAutomountPluginPrivate *priv; ++} CsdAutomountPlugin; ++ ++typedef struct ++{ ++ CinnamonSettingsPluginClass parent_class; ++} CsdAutomountPluginClass; ++ ++GType csd_automount_plugin_get_type (void) G_GNUC_CONST; ++ ++/* All the plugins must implement this function */ ++G_MODULE_EXPORT GType register_cinnamon_settings_plugin (GTypeModule *module); ++ ++G_END_DECLS ++ ++#endif /* __CSD_AUTOMOUNT_PLUGIN_H__ */ +diff -Naur cinnamon-settings-daemon-2.0.1.orig/plugins/automount/Makefile.am cinnamon-settings-daemon-2.0.1/plugins/automount/Makefile.am +--- cinnamon-settings-daemon-2.0.1.orig/plugins/automount/Makefile.am 2013-10-02 16:13:56.000000000 +0200 ++++ cinnamon-settings-daemon-2.0.1/plugins/automount/Makefile.am 2013-10-08 22:48:19.240865461 +0200 +@@ -1,38 +1,87 @@ +-libexec_PROGRAMS = cinnamon-fallback-mount-helper ++NULL = + +-cinnamon_fallback_mount_helper_SOURCES = \ +- cinnamon-fallback-mount-helper.c \ +- csd-automount-manager.c \ +- csd-automount-manager.h \ +- csd-autorun.c \ +- csd-autorun.h ++plugin_name = automount + +-cinnamon_fallback_mount_helper_CPPFLAGS = \ ++libexec_PROGRAMS = csd-test-automount ++ ++csd_test_automount_SOURCES = \ ++ test-automount.c \ ++ csd-automount-manager.h \ ++ csd-automount-manager.c \ ++ csd-autorun.c \ ++ csd-autorun.h \ ++ $(NULL) ++ ++csd_test_automount_CPPFLAGS = \ + -I$(top_srcdir)/cinnamon-settings-daemon \ ++ -I$(top_srcdir)/plugins/common \ + -DCINNAMON_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \ + $(AM_CPPFLAGS) + +-cinnamon_fallback_mount_helper_CFLAGS = \ ++csd_test_automount_CFLAGS = \ ++ $(PLUGIN_CFLAGS) \ + $(SETTINGS_PLUGIN_CFLAGS) \ + $(SYSTEMD_CFLAGS) \ + $(AUTOMOUNT_CFLAGS) ++ $(AM_CFLAGS) ++ ++csd_test_automount_LDADD = \ ++ $(top_builddir)/cinnamon-settings-daemon/libcsd.la \ ++ $(SETTINGS_PLUGIN_LIBS) \ ++ $(SYSTEMD_LIBS) \ ++ $(AUTOMOUNT_LIBS) \ ++ $(NULL) ++ ++plugin_LTLIBRARIES = \ ++ libautomount.la \ ++ $(NULL) ++ ++libautomount_la_SOURCES = \ ++ csd-automount-plugin.h \ ++ csd-automount-plugin.c \ ++ csd-automount-manager.h \ ++ csd-automount-manager.c \ ++ csd-autorun.c \ ++ csd-autorun.h \ ++ $(NULL) ++ ++libautomount_la_CPPFLAGS = \ ++ -I$(top_srcdir)/cinnamon-settings-daemon \ ++ -DCINNAMON_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \ ++ $(AM_CPPFLAGS) ++ ++libautomount_la_CFLAGS = \ ++ $(SETTINGS_PLUGIN_CFLAGS) \ ++ $(SYSTEMD_CFLAGS) \ ++ $(AUTOMOUNT_CFLAGS) \ ++ $(AM_CFLAGS) ++ ++libautomount_la_LDFLAGS = \ ++ $(CSD_PLUGIN_LDFLAGS) \ ++ $(NULL) + +-cinnamon_fallback_mount_helper_LDADD = \ ++libautomount_la_LIBADD = \ + $(SETTINGS_PLUGIN_LIBS) \ + $(SYSTEMD_LIBS) \ + $(AUTOMOUNT_LIBS) \ +- $(top_builddir)/cinnamon-settings-daemon/libcsd.la ++ $(NULL) + +-autostartdir = $(datadir)/applications +-autostart_in_files = cinnamon-fallback-mount-helper.desktop.in +-autostart_in_in_files = cinnamon-fallback-mount-helper.desktop.in.in +-autostart_DATA = $(autostart_in_files:.desktop.in=.desktop) ++plugin_in_files = \ ++ automount.cinnamon-settings-plugin.in \ ++ $(NULL) + +-$(autostart_in_files): $(autostart_in_in_files) +- @sed -e "s|\@LIBEXECDIR\@|$(libexecdir)|" $< > $@ ++plugin_DATA = $(plugin_in_files:.cinnamon-settings-plugin.in=.cinnamon-settings-plugin) + +-@INTLTOOL_DESKTOP_RULE@ ++EXTRA_DIST = \ ++ $(plugin_in_files) \ ++ $(NULL) + +-EXTRA_DIST = $(autostart_in_in_files) ++CLEANFILES = \ ++ $(plugin_DATA) \ ++ $(NULL) + +-CLEANFILES = $(autostart_DATA) $(autostart_in_files) ++DISTCLEANFILES = \ ++ $(plugin_DATA) \ ++ $(NULL) ++ ++@CSD_INTLTOOL_PLUGIN_RULE@ +diff -Naur cinnamon-settings-daemon-2.0.1.orig/plugins/automount/test-automount.c cinnamon-settings-daemon-2.0.1/plugins/automount/test-automount.c +--- cinnamon-settings-daemon-2.0.1.orig/plugins/automount/test-automount.c 1970-01-01 01:00:00.000000000 +0100 ++++ cinnamon-settings-daemon-2.0.1/plugins/automount/test-automount.c 2013-10-08 22:42:53.759486525 +0200 +@@ -0,0 +1,7 @@ ++#define NEW csd_automount_manager_new ++#define START csd_automount_manager_start ++#define STOP csd_automount_manager_stop ++#define MANAGER CsdAutomountManager ++#include "csd-automount-manager.h" ++ ++#include "test-plugin.h" +diff -Naur cinnamon-settings-daemon-2.0.1.orig/po/POTFILES.in cinnamon-settings-daemon-2.0.1/po/POTFILES.in +--- cinnamon-settings-daemon-2.0.1.orig/po/POTFILES.in 2013-10-02 16:13:56.000000000 +0200 ++++ cinnamon-settings-daemon-2.0.1/po/POTFILES.in 2013-10-08 22:35:10.771472456 +0200 +@@ -18,8 +18,9 @@ + plugins/a11y-keyboard/csd-a11y-preferences-dialog.c + [type: gettext/glade]plugins/a11y-keyboard/csd-a11y-preferences-dialog.ui + [type: gettext/ini]plugins/a11y-settings/a11y-settings.cinnamon-settings-plugin.in +-plugins/automount/cinnamon-fallback-mount-helper.desktop.in.in ++[type: gettext/ini]plugins/automount/automount.cinnamon-settings-plugin.in + plugins/automount/csd-automount-manager.c ++plugins/automount/csd-automount-plugin.c + plugins/automount/csd-autorun.c + [type: gettext/ini]plugins/background/background.cinnamon-settings-plugin.in + [type: gettext/ini]plugins/clipboard/clipboard.cinnamon-settings-plugin.in +diff -Naur cinnamon-settings-daemon-2.0.1.orig/po/POTFILES.skip cinnamon-settings-daemon-2.0.1/po/POTFILES.skip +--- cinnamon-settings-daemon-2.0.1.orig/po/POTFILES.skip 2013-10-02 16:13:56.000000000 +0200 ++++ cinnamon-settings-daemon-2.0.1/po/POTFILES.skip 2013-10-08 22:37:20.224645009 +0200 +@@ -20,6 +20,5 @@ + data/org.cinnamon.settings-daemon.plugins.updates.gschema.xml.in + data/org.cinnamon.settings-daemon.plugins.xrandr.gschema.xml.in + data/org.cinnamon.settings-daemon.plugins.xsettings.gschema.xml.in +-plugins/automount/gnome-fallback-mount-helper.desktop.in + plugins/power/org.cinnamon.settings-daemon.plugins.power.policy.in + plugins/wacom/org.cinnamon.settings-daemon.plugins.wacom.policy.in diff --git a/pkgs/desktops/cinnamon/cinnamon-settings-daemon.nix b/pkgs/desktops/cinnamon/cinnamon-settings-daemon.nix new file mode 100644 index 000000000000..c397a9758e2c --- /dev/null +++ b/pkgs/desktops/cinnamon/cinnamon-settings-daemon.nix @@ -0,0 +1,52 @@ + +{ stdenv, fetchurl, pkgconfig, autoreconfHook, glib, gettext, gnome_common, cinnamon-desktop, intltool, gtk3, +libnotify, lcms2, libxklavier, libgnomekbd, libcanberra, pulseaudio, upower, libcanberra_gtk3, colord, +systemd, libxslt, docbook_xsl, makeWrapper, gsettings_desktop_schemas}: + +let + version = "2.0.10"; +in +stdenv.mkDerivation { + name = "cinnamon-settings-daemon-${version}"; + + src = fetchurl { + url = "http://github.com/linuxmint/cinnamon-settings-daemon/archive/${version}.tar.gz"; + sha256 = "10r75xsngb7ipv9fy07dyfb256bqybzcxbwny60sgjhrksk3v9mg"; + }; + + NIX_CFLAGS_COMPILE = "-I${glib}/include/gio-unix-2.0"; + + configureFlags = "--enable-systemd" ; + + patches = [ ./systemd-support.patch ./automount-plugin.patch ./dpms.patch]; + + buildInputs = [ + pkgconfig autoreconfHook + glib gettext gnome_common + intltool gtk3 libnotify lcms2 + libgnomekbd libxklavier colord + libcanberra pulseaudio upower + libcanberra_gtk3 cinnamon-desktop + systemd libxslt docbook_xsl makeWrapper + gsettings_desktop_schemas + ]; + + preBuild = "patchShebangs ./scripts"; + + #ToDo: missing org.cinnamon.gschema.xml, probably not packaged yet + postFixup = '' + for f in "$out"/libexec/*; do + wrapProgram "$f" --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" + done + ''; + + + meta = { + homepage = "http://cinnamon.linuxmint.com"; + description = "The cinnamon session files" ; + + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.roelof ]; + }; +} + diff --git a/pkgs/desktops/cinnamon/dpms.patch b/pkgs/desktops/cinnamon/dpms.patch new file mode 100644 index 000000000000..a73f33dc6182 --- /dev/null +++ b/pkgs/desktops/cinnamon/dpms.patch @@ -0,0 +1,30 @@ + +-- a/plugins/power/csd-power-manager.c ++++ b/plugins/power/csd-power-manager.c +@@ -33,6 +33,8 @@ + #include <libnotify/notify.h> + #include <canberra-gtk.h> + ++#include <X11/extensions/dpms.h> ++ + #define GNOME_DESKTOP_USE_UNSTABLE_API + #include <libcinnamon-desktop/gnome-rr.h> + +@@ -3967,6 +3790,17 @@ csd_power_manager_start (CsdPowerManager + /* set the initial dim time that can adapt for the user */ + refresh_idle_dim_settings (manager); + ++ /* Make sure that Xorg's DPMS extension never gets in our way. The defaults seem to have changed in Xorg 1.14 ++ * being "0" by default to being "600" by default ++ * https://bugzilla.gnome.org/show_bug.cgi?id=709114 ++ */ ++ gdk_error_trap_push (); ++ int dummy; ++ if (DPMSQueryExtension(GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &dummy, &dummy)) { ++ DPMSSetTimeouts (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 0, 0, 0); ++ } ++ gdk_error_trap_pop_ignored (); ++ + manager->priv->xscreensaver_watchdog_timer_id = g_timeout_add_seconds (XSCREENSAVER_WATCHDOG_TIMEOUT, + disable_builtin_screensaver, + NULL); diff --git a/pkgs/desktops/cinnamon/keyboard.patch b/pkgs/desktops/cinnamon/keyboard.patch new file mode 100644 index 000000000000..f67d961ff58f --- /dev/null +++ b/pkgs/desktops/cinnamon/keyboard.patch @@ -0,0 +1,4729 @@ + +diff -uNrp a/cinnamon-settings-daemon/main.c b/cinnamon-settings-daemon/main.c +--- a/cinnamon-settings-daemon/main.c 2013-08-24 18:04:31.000000000 +0100 ++++ b/cinnamon-settings-daemon/main.c 2013-08-25 16:36:02.000000000 +0100 +@@ -319,6 +319,29 @@ set_legacy_ibus_env_vars (GDBusProxy *pr + } + #endif + ++static void ++got_session_proxy (GObject *source_object, ++ GAsyncResult *res, ++ gpointer user_data) ++{ ++ GDBusProxy *proxy; ++ GError *error = NULL; ++ ++ proxy = g_dbus_proxy_new_finish (res, &error); ++ if (proxy == NULL) { ++ g_debug ("Could not connect to the Session manager: %s", error->message); ++ g_error_free (error); ++ } else { ++ set_locale (proxy); ++#ifdef HAVE_IBUS ++ /* This will register with cinnamon-session after calling Setenv. */ ++ set_legacy_ibus_env_vars (proxy); ++#else ++ register_with_gnome_session (proxy); ++#endif ++ } ++} ++ + static gboolean + on_term_signal_pipe_closed (GIOChannel *source, + GIOCondition condition, +@@ -368,6 +391,16 @@ set_session_over_handler (GDBusConnectio + { + g_assert (bus != NULL); + ++ g_dbus_proxy_new (bus, ++ G_DBUS_PROXY_FLAGS_NONE, ++ NULL, ++ GNOME_SESSION_DBUS_NAME, ++ GNOME_SESSION_DBUS_OBJECT, ++ GNOME_SESSION_DBUS_INTERFACE, ++ NULL, ++ (GAsyncReadyCallback) got_session_proxy, ++ NULL); ++ + watch_for_term_signal (manager); + } + +@@ -390,56 +423,6 @@ name_lost_handler (GDBusConnection *conn + gtk_main_quit (); + } + +-static gboolean +-do_register_client (gpointer user_data) +-{ +- GDBusProxy *proxy = (GDBusProxy *) user_data; +- g_assert (proxy != NULL); +- +- const char *startup_id = g_getenv ("DESKTOP_AUTOSTART_ID"); +- g_dbus_proxy_call (proxy, +- "RegisterClient", +- g_variant_new ("(ss)", "cinnamon-settings-daemon", startup_id ? startup_id : ""), +- G_DBUS_CALL_FLAGS_NONE, +- -1, +- NULL, +- (GAsyncReadyCallback) on_client_registered, +- manager); +- +- return FALSE; +-} +- +-static void +-queue_register_client (void) +-{ +- GDBusConnection *bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL); +- if (!bus) +- return; +- +- GError *error = NULL; +- GDBusProxy *proxy = g_dbus_proxy_new_sync (bus, +- G_DBUS_PROXY_FLAGS_NONE, +- NULL, +- GNOME_SESSION_DBUS_NAME, +- GNOME_SESSION_DBUS_OBJECT, +- GNOME_SESSION_DBUS_INTERFACE, +- NULL, +- &error); +- g_object_unref (bus); +- +- if (proxy == NULL) { +- g_debug ("Could not connect to the Session manager: %s", error->message); +- g_error_free (error); +- return; +- } +- +- /* Register the daemon with cinnamon-session */ +- g_signal_connect (G_OBJECT (proxy), "g-signal", +- G_CALLBACK (on_session_over), NULL); +- +- g_idle_add_full (G_PRIORITY_DEFAULT, do_register_client, proxy, NULL); +-} +- + static void + bus_register (void) + { +@@ -541,8 +524,6 @@ main (int argc, char *argv[]) + + notify_init ("cinnamon-settings-daemon"); + +- queue_register_client (); +- + bus_register (); + + cinnamon_settings_profile_start ("cinnamon_settings_manager_new"); +diff -uNrp a/configure.ac b/configure.ac +--- a/configure.ac 2013-08-24 18:04:31.000000000 +0100 ++++ b/configure.ac 2013-08-25 16:36:02.000000000 +0100 +@@ -53,6 +53,7 @@ UPOWER_GLIB_REQUIRED_VERSION=0.9.1 + PA_REQUIRED_VERSION=0.9.16 + UPOWER_REQUIRED_VERSION=0.9.11 + GTK_XINPUT_2_3_VERSION=3.7.8 ++IBUS_REQUIRED_VERSION=1.4.2 + + #EXTRA_COMPILE_WARNINGS(yes) + +@@ -199,8 +200,21 @@ dnl ------------------------------------ + dnl - Keyboard plugin stuff + dnl --------------------------------------------------------------------------- + +-LIBGNOMEKBD_REQUIRED=2.91.1 +-PKG_CHECK_MODULES(KEYBOARD, [libgnomekbdui >= $LIBGNOMEKBD_REQUIRED libgnomekbd >= $LIBGNOMEKBD_REQUIRED libxklavier >= 5.0 kbproto]) ++AC_ARG_ENABLE(ibus, ++ AS_HELP_STRING([--disable-ibus], ++ [Disable IBus support]), ++ enable_ibus=$enableval, ++ enable_ibus=yes) ++ ++if test "x$enable_ibus" = "xyes" ; then ++ IBUS_MODULE="ibus-1.0 >= $IBUS_REQUIRED_VERSION" ++ AC_DEFINE(HAVE_IBUS, 1, [Defined if IBus support is enabled]) ++else ++ IBUS_MODULE= ++fi ++AM_CONDITIONAL(HAVE_IBUS, test "x$enable_ibus" == "xyes") ++ ++PKG_CHECK_MODULES(KEYBOARD, xkbfile $IBUS_MODULE cinnamon-desktop >= $CINNAMON_DESKTOP_REQUIRED_VERSION) + + dnl --------------------------------------------------------------------------- + dnl - Housekeeping plugin stuff +diff -uNrp a/data/org.cinnamon.settings-daemon.plugins.media-keys.gschema.xml.in.in b/data/org.cinnamon.settings-daemon.plugins.media-keys.gschema.xml.in.in +--- a/data/org.cinnamon.settings-daemon.plugins.media-keys.gschema.xml.in.in 2013-08-24 18:04:31.000000000 +0100 ++++ b/data/org.cinnamon.settings-daemon.plugins.media-keys.gschema.xml.in.in 2013-08-25 16:36:02.000000000 +0100 +@@ -175,6 +175,15 @@ + <_summary>Magnifier zoom out</_summary> + <_description>Binding for the magnifier to zoom out</_description> + </key> ++ <key name="switch-input-source" type="s"> ++ <default>''</default> ++ <_summary>Switch input source</_summary> ++ <_description>Binding to select the next input source</_description> ++ </key> ++ <key name="switch-input-source-backward" type="s"> ++ <default>''</default> ++ <_summary>Switch input source backward</_summary> ++ <_description>Binding to select the previous input source</_description> ++ </key> + </schema> +- +-</schemalist> ++</schemalist> +\ No newline at end of file +diff -uNrp a/plugins/keyboard/csd-keyboard-manager.c b/plugins/keyboard/csd-keyboard-manager.c +--- a/plugins/keyboard/csd-keyboard-manager.c 2013-08-24 18:04:31.000000000 +0100 ++++ b/plugins/keyboard/csd-keyboard-manager.c 2013-08-25 16:36:02.000000000 +0100 +@@ -40,19 +40,22 @@ + + #include <X11/XKBlib.h> + #include <X11/keysym.h> ++#include <X11/extensions/XKBrules.h> ++ ++#define GNOME_DESKTOP_USE_UNSTABLE_API ++#include <libcinnamon-desktop/gnome-xkb-info.h> ++ ++#ifdef HAVE_IBUS ++#include <ibus.h> ++#endif + + #include "cinnamon-settings-profile.h" + #include "csd-keyboard-manager.h" ++#include "csd-input-helper.h" + #include "csd-enums.h" + +-#include "csd-keyboard-xkb.h" +- + #define CSD_KEYBOARD_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CSD_TYPE_KEYBOARD_MANAGER, CsdKeyboardManagerPrivate)) + +-#ifndef HOST_NAME_MAX +-# define HOST_NAME_MAX 255 +-#endif +- + #define CSD_KEYBOARD_DIR "org.cinnamon.settings-daemon.peripherals.keyboard" + + #define KEY_REPEAT "repeat" +@@ -60,6 +63,7 @@ + #define KEY_INTERVAL "repeat-interval" + #define KEY_DELAY "delay" + #define KEY_CLICK_VOLUME "click-volume" ++#define KEY_REMEMBER_NUMLOCK_STATE "remember-numlock-state" + #define KEY_NUMLOCK_STATE "numlock-state" + + #define KEY_BELL_VOLUME "bell-volume" +@@ -67,27 +71,560 @@ + #define KEY_BELL_DURATION "bell-duration" + #define KEY_BELL_MODE "bell-mode" + +-#define LIBGNOMEKBD_KEYBOARD_DIR "org.gnome.libgnomekbd.keyboard" +-#define LIBGNOMEKBD_KEY_LAYOUTS "layouts" ++#define KEY_SWITCHER "input-sources-switcher" ++ ++#define GNOME_DESKTOP_INTERFACE_DIR "org.cinnamon.desktop.interface" ++ ++#define KEY_GTK_IM_MODULE "gtk-im-module" ++#define GTK_IM_MODULE_SIMPLE "gtk-im-context-simple" ++#define GTK_IM_MODULE_IBUS "ibus" ++ ++#define GNOME_DESKTOP_INPUT_SOURCES_DIR "org.cinnamon.desktop.input-sources" ++ ++#define KEY_CURRENT_INPUT_SOURCE "current" ++#define KEY_INPUT_SOURCES "sources" ++#define KEY_KEYBOARD_OPTIONS "xkb-options" ++ ++#define INPUT_SOURCE_TYPE_XKB "xkb" ++#define INPUT_SOURCE_TYPE_IBUS "ibus" ++ ++#define DEFAULT_LANGUAGE "en_US" + + struct CsdKeyboardManagerPrivate + { + guint start_idle_id; + GSettings *settings; +- GSettings *libgnomekbd_settings; +- gboolean have_xkb; ++ GSettings *input_sources_settings; ++ GSettings *interface_settings; ++ GnomeXkbInfo *xkb_info; ++#ifdef HAVE_IBUS ++ IBusBus *ibus; ++ GHashTable *ibus_engines; ++ GHashTable *ibus_xkb_engines; ++ GCancellable *ibus_cancellable; ++ gboolean session_is_fallback; ++#endif + gint xkb_event_base; + CsdNumLockState old_state; ++ GdkDeviceManager *device_manager; ++ guint device_added_id; ++ guint device_removed_id; ++ ++ gboolean input_sources_switcher_spawned; ++ GPid input_sources_switcher_pid; + }; + + static void csd_keyboard_manager_class_init (CsdKeyboardManagerClass *klass); + static void csd_keyboard_manager_init (CsdKeyboardManager *keyboard_manager); + static void csd_keyboard_manager_finalize (GObject *object); ++static gboolean apply_input_sources_settings (GSettings *settings, ++ gpointer keys, ++ gint n_keys, ++ CsdKeyboardManager *manager); ++static void set_gtk_im_module (CsdKeyboardManager *manager, ++ const gchar *new_module); + + G_DEFINE_TYPE (CsdKeyboardManager, csd_keyboard_manager, G_TYPE_OBJECT) + + static gpointer manager_object = NULL; + ++static void ++init_builder_with_sources (GVariantBuilder *builder, ++ GSettings *settings) ++{ ++ const gchar *type; ++ const gchar *id; ++ GVariantIter iter; ++ GVariant *sources; ++ ++ sources = g_settings_get_value (settings, KEY_INPUT_SOURCES); ++ ++ g_variant_builder_init (builder, G_VARIANT_TYPE ("a(ss)")); ++ ++ g_variant_iter_init (&iter, sources); ++ while (g_variant_iter_next (&iter, "(&s&s)", &type, &id)) ++ g_variant_builder_add (builder, "(ss)", type, id); ++ ++ g_variant_unref (sources); ++} ++ ++static gboolean ++schema_is_installed (const gchar *name) ++{ ++ const gchar * const *schemas; ++ const gchar * const *s; ++ ++ schemas = g_settings_list_schemas (); ++ for (s = schemas; *s; ++s) ++ if (g_str_equal (*s, name)) ++ return TRUE; ++ ++ return FALSE; ++} ++ ++#ifdef HAVE_IBUS ++static void ++clear_ibus (CsdKeyboardManager *manager) ++{ ++ CsdKeyboardManagerPrivate *priv = manager->priv; ++ ++ g_cancellable_cancel (priv->ibus_cancellable); ++ g_clear_object (&priv->ibus_cancellable); ++ g_clear_pointer (&priv->ibus_engines, g_hash_table_destroy); ++ g_clear_pointer (&priv->ibus_xkb_engines, g_hash_table_destroy); ++ g_clear_object (&priv->ibus); ++} ++ ++static gchar * ++make_xkb_source_id (const gchar *engine_id) ++{ ++ gchar *id; ++ gchar *p; ++ gint n_colons = 0; ++ ++ /* engine_id is like "xkb:layout:variant:lang" where ++ * 'variant' and 'lang' might be empty */ ++ ++ engine_id += 4; ++ ++ for (p = (gchar *)engine_id; *p; ++p) ++ if (*p |