Source: uim
Version: 1:1.8.6+gh20161003.0.d63dadd-2
Severity: important
Tags: patch
Forwarded: https://github.com/uim/uim/pull/99

Uim FTBFS with gnome-panel 3.22 / 3.24, because support for out-of-process
applets has been dropped there [1].

The attached patch is based on upstream commits [2] and [3] and ports
the code to be an in-process applet. Please apply it to make your package
build with the new gnome-panel versions (it should work with 3.20 too).

With this patch, you also need to update your uim-applet-gnome.install:

--- a/debian/uim-applet-gnome.install
+++ b/debian/uim-applet-gnome.install
@@ -1,4 +1,3 @@
-usr/lib/*/uim/uim-toolbar-applet-gnome3
-usr/share/dbus-1/services/org.gnome.panel.applet.UimAppletFactory.service
-usr/share/gnome-panel/5.0/applets/UimApplet.panel-applet
+usr/lib/*/uim/libuim-toolbar-applet-gnome3.so
+usr/share/gnome-panel/applets/UimApplet.panel-applet
 usr/share/uim/ui/uim-applet-menu.xml

While I am at it, you may also want to consider backporting
https://github.com/uim/uim/pull/108 which will be useful for upcoming
Qt 5.9 transition.

[1]: 
https://mail.gnome.org/archives/gnome-flashback-list/2016-July/msg00000.html
[2]: https://github.com/uim/uim/commit/77253cd439b9ef3c
[3]: https://github.com/uim/uim/commit/f883892ef6cb8375

--
Dmitry Shachnev
Description: make the GNOME Panel applet compatible with libpanel-applet2
 * Port from out-of-process applet to in-process applet.
 * Get the applets directory from pkg-config instead of using the
   hard-coded path.
Origin: upstream, commits:
 https://github.com/uim/uim/commit/77253cd439b9ef3c
 https://github.com/uim/uim/commit/f883892ef6cb8375
Last-Update: 2017-06-29

--- a/configure.ac
+++ b/configure.ac
@@ -861,6 +861,14 @@
 
 AM_CONDITIONAL(GNOME3_APPLET, test "x$enable_gnome3_applet" = xyes)
 
+if test "x$enable_gnome3_applet" = xyes; then
+  AC_ARG_WITH([libpanel-applet-dir], [], [LIBPANEL_APPLET_DIR=$withval], [LIBPANEL_APPLET_DIR=""])
+  if test "$LIBPANEL_APPLET_DIR" == ""; then
+    LIBPANEL_APPLET_DIR=`$PKG_CONFIG --variable=libpanel_applet_dir libpanel-applet`
+  fi
+  AC_SUBST(LIBPANEL_APPLET_DIR)
+fi
+
 AC_ARG_ENABLE(debug,
   AC_HELP_STRING([--enable-debug],
     [enable debugging]),
--- a/gtk3/toolbar/Makefile.am
+++ b/gtk3/toolbar/Makefile.am
@@ -1,51 +1,47 @@
 EXTRA_DIST = UimApplet.panel-applet.in.in \
-	     uim-applet-menu.xml \
-	     org.gnome.panel.applet.UimAppletFactory.service.in
+	     uim-applet-menu.xml
 
 if GNOME3_APPLET
 helper_defs = -DUIM_DATADIR=\""$(datadir)/@PACKAGE@"\"
 
-libexec_PROGRAMS = uim-toolbar-applet-gnome3
+uim_toolbar_applet_gnome3_libdir = $(pkglibdir)
+uim_toolbar_applet_gnome3_lib_LTLIBRARIES = libuim-toolbar-applet-gnome3.la
 
 xmluidir = $(pkgdatadir)/ui
 xmlui_DATA = uim-applet-menu.xml
 
-uim_toolbar_applet_gnome3_LDADD = @GTK3_LIBS@ @GNOME3_APPLET_LIBS@ \
+libuim_toolbar_applet_gnome3_la_LIBADD = @GTK3_LIBS@ @GNOME3_APPLET_LIBS@ \
 			   $(top_builddir)/uim/libuim-scm.la \
 			   $(top_builddir)/uim/libuim.la \
 			   $(top_builddir)/uim/libuim-custom.la
-uim_toolbar_applet_gnome3_CPPFLAGS = \
+libuim_toolbar_applet_gnome3_la_CPPFLAGS = \
 			   -DUIM_UIDATADIR="\"${xmluidir}\"" \
 			   $(helper_defs) -I$(top_srcdir) -I$(top_builddir)
-									 
-uim_toolbar_applet_gnome3_CFLAGS = @GTK3_CFLAGS@ @GNOME3_APPLET_CFLAGS@
+libuim_toolbar_applet_gnome3_la_LDFLAGS = \
+			   -module -avoid-version
 
-uim_toolbar_applet_gnome3_SOURCES = applet-gnome3.c \
+libuim_toolbar_applet_gnome3_la_CFLAGS = @GTK3_CFLAGS@ @GNOME3_APPLET_CFLAGS@
+
+libuim_toolbar_applet_gnome3_la_SOURCES = applet-gnome3.c \
 			       ../../gtk2/toolbar/common-gtk.c
 
-appletdir = $(datadir)/gnome-panel/5.0/applets
+APPLET_LOCATION = $(pkglibdir)/libuim-toolbar-applet-gnome3.so
+
+appletdir = $(LIBPANEL_APPLET_DIR)
 applet_DATA = UimApplet.panel-applet
 applet_in_files = $(applet_DATA:=.in)
 applet_in_in_files = $(applet_in_files:=.in)
 
 $(applet_in_files): $(applet_in_in_files) Makefile
-	$(SED) s,@LIBEXECDIR@,$(libexecdir),g <$< >[email protected]
+	$(SED) s,@APPLET_LOCATION@,$(APPLET_LOCATION),g <$< >[email protected]
 	$(SED) s,@UIM_PIXMAPSDIR@,$(uim_pixmapsdir),g <[email protected] >$@
 
 po_files = $(wildcard $(top_srcdir)/po/*.po)
 $(applet_DATA): $(applet_in_files) $(INTLTOOL_MERGE) $(po_files)
 	LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@ 
 
-servicedir = $(datadir)/dbus-1/services
-service_DATA = org.gnome.panel.applet.UimAppletFactory.service
-service_in_files = $(service_DATA:=.in)
-
-$(service_DATA): $(service_in_files) Makefile
-	sed s,@LIBEXECDIR@,$(libexecdir),g <$< >$@
-
 DISTCLEANFILES = UimApplet.panel-applet.in UimApplet.panel-applet \
-		 UimApplet.panel-applet.in.tmp \
-		 org.gnome.panel.applet.UimAppletFactory.service
+		 UimApplet.panel-applet.in.tmp
 endif
 
 if GTK3
--- a/gtk3/toolbar/UimApplet.panel-applet.in.in
+++ b/gtk3/toolbar/UimApplet.panel-applet.in.in
@@ -1,6 +1,7 @@
 [Applet Factory]
 Id=UimAppletFactory
-Location=@LIBEXECDIR@/uim-toolbar-applet-gnome3
+InProcess=true
+Location=@APPLET_LOCATION@
 _Name=uim Applet Factory
 _Description=uim applet factory
 
--- a/gtk3/toolbar/applet-gnome3.c
+++ b/gtk3/toolbar/applet-gnome3.c
@@ -168,7 +168,7 @@
 
 
 
-PANEL_APPLET_OUT_PROCESS_FACTORY("UimAppletFactory",
+PANEL_APPLET_IN_PROCESS_FACTORY("UimAppletFactory",
                             PANEL_TYPE_APPLET,
                             (PanelAppletFactoryCallback)uim_applet_new,
                             NULL)
--- a/gtk3/toolbar/org.gnome.panel.applet.UimAppletFactory.service.in
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.gnome.panel.applet.UimAppletFactory
-Exec=@LIBEXECDIR@/uim-toolbar-applet-gnome3

Attachment: signature.asc
Description: PGP signature

Reply via email to