--- /dev/null
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+GNOME2_LA_PUNT="yes"
+
+inherit autotools eutils gnome2 virtualx
+
+DESCRIPTION="Cinnamon's settings daemon"
+HOMEPAGE="http://cinnamon.linuxmint.com/"
+SRC_URI="https://github.com/linuxmint/cinnamon-settings-daemon/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+colord cups input_devices_wacom smartcard systemd"
+
+# udev is non-optional since lots of plugins, not just gudev, pull it in
+RDEPEND="
+ >=dev-libs/glib-2.38:2
+ >=gnome-base/libgnomekbd-3.6
+ >=gnome-base/librsvg-2.36.2
+ >=gnome-extra/cinnamon-desktop-2.8.0:0=
+ media-libs/fontconfig
+ >=media-libs/lcms-2.2:2
+ media-libs/libcanberra:0=[gtk3]
+ sys-apps/dbus
+ >=sys-auth/polkit-0.97
+ x11-libs/gdk-pixbuf:2
+ >=x11-libs/gtk+-3.9.10:3
+ >=x11-libs/libnotify-0.7.3:0=
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXi
+ x11-libs/libxklavier
+ virtual/libgudev:=
+
+ colord? ( >=x11-misc/colord-0.1.27:= )
+ cups? ( >=net-print/cups-1.4[dbus] )
+ input_devices_wacom? (
+ >=dev-libs/libwacom-0.7
+ x11-drivers/xf86-input-wacom
+ x11-libs/libXtst )
+ smartcard? ( >=dev-libs/nss-3.11.2 )
+ systemd? (
+ sys-apps/systemd:0=
+ >=sys-power/upower-0.9.11:= )
+ !systemd? (
+ sys-auth/consolekit:0=
+ || ( >=sys-power/upower-0.9.11 sys-power/upower-pm-utils ) )
+"
+DEPEND="${RDEPEND}
+ dev-libs/libxml2:2
+ >=dev-util/intltool-0.37.1
+ x11-proto/kbproto
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # make colord and wacom optional
+ eapply "${FILESDIR}"/${PN}-3.0.1-optional.patch
+
+ # Disable broken test
+ sed -e '/g_test_add_func ("\/color\/edid/d' \
+ -i plugins/color/gcm-self-test.c || die
+
+ eautoreconf
+ gnome2_src_prepare
+}
+
+src_configure() {
+ # no point in disabling gudev since other plugins pull it in
+ gnome2_src_configure \
+ --disable-static \
+ --enable-gudev \
+ --enable-man \
+ --enable-polkit \
+ $(use_enable colord color) \
+ $(use_enable cups) \
+ $(use_enable smartcard smartcard-support) \
+ $(use_enable systemd logind) \
+ $(use_enable input_devices_wacom wacom)
+}
+
+src_test() {
+ virtx emake check
+}
--- /dev/null
+--- a/configure.ac~ 2016-05-10 17:30:40.000000000 +0200
++++ b/configure.ac 2016-06-25 17:43:46.554279197 +0200
+@@ -259,14 +259,28 @@
+ dnl - color
+ dnl ---------------------------------------------------------------------------
+
+-PKG_CHECK_MODULES(COLOR, [colord >= 0.1.27 cinnamon-desktop >= $CINNAMON_DESKTOP_REQUIRED_VERSION libcanberra-gtk3])
++AC_ARG_ENABLE(color,
++ AS_HELP_STRING([--disable-color], [disable Colord support (default: enabled)]),,
++ enable_color=yes)
++build_color=false
++if test x"$enable_color" != x"no" ; then
++ PKG_CHECK_MODULES(COLOR, [colord >= 0.1.27 cinnamon-desktop >= $CINNAMON_DESKTOP_REQUIRED_VERSION libcanberra-gtk3])
++ build_color=true
++fi
++
++AM_CONDITIONAL(BUILD_COLOR, [test "x$build_color" = "xtrue"])
+
+ dnl ---------------------------------------------------------------------------
+ dnl - wacom
+ dnl ---------------------------------------------------------------------------
++AC_ARG_ENABLE(wacom,
++ AS_HELP_STRING([--disable-wacom], [disable Wacom support (default: auto)]),,
++ enable_wacom=auto)
+ build_wacom=false
+-PKG_CHECK_MODULES(WACOM, [libwacom >= $LIBWACOM_REQUIRED_VERSION x11 xi xtst gudev-1.0 cinnamon-desktop xorg-wacom librsvg-2.0 >= $LIBRSVG_REQUIRED_VERSION gtk+-3.0 >= 3.8.0],
+- [build_wacom="true" AC_DEFINE(HAVE_WACOM, 1, [Define if wacom is being build])], [build_wacom="false"])
++if test x"$enable_wacom" != x"no" ; then
++ PKG_CHECK_MODULES(WACOM, [libwacom >= $LIBWACOM_REQUIRED_VERSION x11 xi xtst gudev-1.0 cinnamon-desktop xorg-wacom librsvg-2.0 >= $LIBRSVG_REQUIRED_VERSION gtk+-3.0 >= 3.8.0],
++ [build_wacom="true" AC_DEFINE(HAVE_WACOM, 1, [Define if wacom is being build])], [build_wacom="false"])
++fi
+
+ AM_CONDITIONAL(BUILD_WACOM, test "x$build_wacom" = "xtrue")
+
+@@ -372,9 +386,15 @@
+ dnl Check for logind
+ dnl ====================================================================
+
+-PKG_CHECK_MODULES(LOGIND, [libsystemd-login], [have_logind=yes], [
+- PKG_CHECK_MODULES(LOGIND, [libsystemd], [have_logind=yes], [have_logind=no])
+-])
++AC_ARG_ENABLE([logind],
++ AS_HELP_STRING([--disable-logind], [Do not check for logind]),
++ [enable_logind=$enableval],
++ [enable_logind=auto])
++
++have_logind=no
++if test x$enable_logind != xno ; then
++ PKG_CHECK_MODULES(LOGIND, [libsystemd-login], [have_logind=yes], [have_logind=no])
++fi
+
+ if test x$have_logind = xyes; then
+ AC_DEFINE(HAVE_LOGIND, 1, [Define if logind is supported])
+@@ -595,6 +615,7 @@
+ LCMS DICT support: ${have_new_lcms}
+ Libnotify support: ${have_libnotify}
+
++ Colord support: ${build_color}
+ Wacom support: ${build_wacom}
+
+ Smartcard support: ${have_smartcard_support}
+--- a/plugins/Makefile.am~ 2016-05-10 17:30:40.000000000 +0200
++++ b/plugins/Makefile.am 2016-06-25 17:44:30.021307677 +0200
+@@ -6,7 +6,6 @@
+ automount \
+ background \
+ clipboard \
+- color \
+ cursor \
+ dummy \
+ datetime \
+@@ -23,6 +22,12 @@
+
+ disabled_plugins = $(NULL)
+
++if BUILD_COLOR
++enabled_plugins += color
++else
++disabled_plugins += color
++endif
++
+ if BUILD_WACOM
+ enabled_plugins += wacom
+ else