Khurshid Alam has proposed merging 
lp:~khurshid-alam/unity-settings-daemon/fix-build-focal into 
lp:unity-settings-daemon.

Commit message:
Move gnome-update-wallpaper-cache into plugins/background so we can link 
libraries properly.

Requested reviews:
  Sebastien Bacher (seb128)

For more details, see:
https://code.launchpad.net/~khurshid-alam/unity-settings-daemon/fix-build-focal/+merge/379919
-- 
Your team Unity Settings Daemon Development Team is subscribed to branch 
lp:unity-settings-daemon.
=== modified file 'debian/rules'
--- debian/rules	2018-02-21 21:19:43 +0000
+++ debian/rules	2020-02-26 19:17:27 +0000
@@ -10,8 +10,6 @@
 DEB_CONFIGURE_SCRIPT := ./autogen.sh
 DEB_CONFIGURE_EXTRA_FLAGS = --disable-packagekit --enable-ibus --enable-fcitx --enable-network-manager
 
-build/unity-settings-daemon::
-	gcc -o gnome-settings-daemon/gnome-update-wallpaper-cache debian/gnome-update-wallpaper-cache.c `pkg-config --cflags --libs glib-2.0 gdk-3.0 gdk-x11-3.0 gio-2.0 gnome-desktop-3.0`
 
 # don't configure with --libdir, but move the files manually, because
 # other files in /usr/lib/ should not change
@@ -21,7 +19,6 @@
 		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
 
 install/unity-settings-daemon::
-	/usr/bin/install -c gnome-settings-daemon/gnome-update-wallpaper-cache 'debian/tmp/usr/lib/unity-settings-daemon'
 	install -m 644 -D debian/unity-settings-daemon.user-session.upstart debian/unity-settings-daemon/usr/share/upstart/sessions/unity-settings-daemon.conf
 	install -m 644 -D debian/unity-settings-daemon.user-session.desktop debian/unity-settings-daemon/usr/share/upstart/xdg/autostart/unity-settings-daemon.desktop
 
@@ -34,5 +31,3 @@
 
 common-binary-post-install-arch:: list-missing
 
-clean::
-	rm -f gnome-settings-daemon/gnome-update-wallpaper-cache

=== modified file 'plugins/background/Makefile.am'
--- plugins/background/Makefile.am	2020-02-23 15:03:25 +0000
+++ plugins/background/Makefile.am	2020-02-26 19:17:27 +0000
@@ -29,6 +29,29 @@
 	$(BACKGROUND_LIBS)				\
 	$(NULL)
 
+libexec_PROGRAMS += gnome-update-wallpaper-cache
+
+gnome_update_wallpaper_cache_SOURCES =		\
+	gnome-update-wallpaper-cache.c		\
+	$(NULL)
+
+gnome_update_wallpaper_cache_CPPFLAGS = \
+	-I$(top_srcdir)/gnome-settings-daemon		\
+	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
+	$(AM_CPPFLAGS)
+
+gnome_update_wallpaper_cache_CFLAGS = \
+	$(SETTINGS_PLUGIN_CFLAGS)	\
+	$(BACKGROUND_CFLAGS)		\
+	$(AM_CFLAGS)
+
+gnome_update_wallpaper_cache_LDADD =				\
+	$(top_builddir)/gnome-settings-daemon/libgsd.la	\
+	$(top_builddir)/gnome-settings-daemon/libunity-settings-daemon.la	\
+	$(SETTINGS_PLUGIN_LIBS)				\
+	$(BACKGROUND_LIBS)				\
+	$(NULL)
+
 plugin_LTLIBRARIES = \
 	libbackground.la		\
 	$(NULL)

=== added file 'plugins/background/gnome-update-wallpaper-cache.c'
--- plugins/background/gnome-update-wallpaper-cache.c	1970-01-01 00:00:00 +0000
+++ plugins/background/gnome-update-wallpaper-cache.c	2020-02-26 19:17:27 +0000
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Canonical, Ltd.
+ *
+ * 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 3 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 version 3.0 for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authored by Didier Roche <didro...@ubuntu.com>
+ * 
+ * Bug: https://bugs.launchpad.net/bugs/530024
+ */
+
+#include "config.h"
+
+#include <glib.h>
+#include <gdk/gdk.h>
+
+#include "gsd-bg.h"
+
+static GOptionEntry entries[] =
+{
+  { NULL }
+};
+
+main (int argc, char *argv[])
+{
+    GOptionContext *context = NULL;
+    GError         *error = NULL;
+
+    GdkScreen *screen;
+    GdkRectangle rect;
+    GsdBG *bg;
+    GSettings *settings;
+    GdkPixbuf *pixbuf;
+
+    gdk_init (&argc, &argv);
+
+    context = g_option_context_new ("- refresh wallpaper cache");
+    g_option_context_add_main_entries (context, entries, NULL);
+    if (!g_option_context_parse (context, &argc, &argv, &error)) {
+        g_printerr ("option parsing failed: %s\n", error->message);
+        g_option_context_free(context);
+        g_error_free (error);
+        return (1);
+    }
+    if (context)
+        g_option_context_free (context);
+
+    /* cache only the first monitor */
+    screen = gdk_screen_get_default ();
+    gdk_screen_get_monitor_geometry (screen, 0, &rect);
+
+    bg = gsd_bg_new ();
+    settings = g_settings_new ("org.gnome.desktop.background");
+    gsd_bg_load_from_preferences (bg, settings);
+
+    pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, rect.width, rect.height);
+    gsd_bg_draw (bg, pixbuf, screen, FALSE);
+
+    g_object_unref (settings);
+
+    return (0);
+}

-- 
ubuntu-desktop mailing list
ubuntu-desktop@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop

Reply via email to