From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabian Harfert Subject: [PATCH] gnu: Add libunique. Date: Fri, 19 Feb 2016 20:14:40 +0100 Message-ID: <1455909280-23875-1-git-send-email-fhmgufs@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWr7F-0004KK-NY for guix-devel@gnu.org; Fri, 19 Feb 2016 14:53:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWr7B-0002bV-Oi for guix-devel@gnu.org; Fri, 19 Feb 2016 14:53:25 -0500 Received: from p4fd24c1b.dip0.t-ipconnect.de ([79.210.76.27]:41952 helo=default-desktop) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWr7B-0002bI-4o for guix-devel@gnu.org; Fri, 19 Feb 2016 14:53:21 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * gnu/packages/glib.scm (libunique): New variable. * gnu/packages/patches/libunique-gdbus.patch: New file. * gnu/packages/patches/libunique-remove-G_CONST_RETURN.patch: New file. --- gnu/packages/glib.scm | 32 ++ gnu/packages/patches/libunique-gdbus.patch | 529 +++++++++++++++= ++++++ .../patches/libunique-remove-G_CONST_RETURN.patch | 117 +++++ 3 files changed, 678 insertions(+) create mode 100644 gnu/packages/patches/libunique-gdbus.patch create mode 100644 gnu/packages/patches/libunique-remove-G_CONST_RETURN.= patch diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index f8e1541..259a744 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -4,6 +4,7 @@ ;;; Copyright =C2=A9 2013 Nikita Karetnikov ;;; Copyright =C2=A9 2014, 2015, 2016 Mark H Weaver ;;; Copyright =C2=A9 2016 Efraim Flashner +;;; Copyright =C2=A9 2016 Fabian Harfert ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +28,7 @@ #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system python) + #:use-module (guix build-system glib-or-gtk) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages bison) @@ -611,3 +613,33 @@ many applications simultaneously. =20 This package provides the library for GLib applications.") (license license:lgpl2.1+))) + +(define-public libunique + (package + (name "libunique") + (version "1.1.6") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/libunique/" + (version-major+minor version) "/" + name "-" version ".tar.bz2")) + (sha256 + (base32 + "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75")) + (patches + (list (search-patch "libunique-gdbus.patch") + (search-patch "libunique-remove-G_CONST_RETURN.patch"))))) + (build-system glib-or-gtk-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("gobject-introspection" ,gobject-introspection) + ("glib:bin" ,glib "bin"))) + (propagated-inputs + `(("gtk+" ,gtk+-2))) + (home-page "https://wiki.gnome.org/Attic/LibUnique") + (synopsis "Library for writing single instance application") + (description + "Libunique is library providing a mechanism to allow only one runni= ng +instance of an application.") + (license license:lgpl2.1+))) diff --git a/gnu/packages/patches/libunique-gdbus.patch b/gnu/packages/pa= tches/libunique-gdbus.patch new file mode 100644 index 0000000..880c0c0 --- /dev/null +++ b/gnu/packages/patches/libunique-gdbus.patch @@ -0,0 +1,529 @@ +From 01066039529c0181f231325476bb4823c16a2aea Mon Sep 17 00:00:00 2001 +From: Christian Persch +Date: Sat, 15 May 2010 17:47:45 +0000 +Subject: Add GDBus backend + +Add backend using GDBus, the new D-BUS binding in GIO 2.25. + +Bug #618723. +--- +diff --git a/configure.ac b/configure.ac +index bc3163a..b6a4221 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -116,6 +116,19 @@ AS_IF([test "x$have_dbus" =3D "xyes"], +=20 + AM_CONDITIONAL([HAVE_DBUS], [test "x$have_dbus" =3D "xyes"]) +=20 ++dnl GDBus backend ++dnl This is the default backend if GIO is recent enough ++m4_define([gdbus_gio_required],[2.25.7]) ++PKG_CHECK_MODULES([GDBUS],[gio-2.0 >=3D gdbus_gio_required],[have_gdbus= =3Dyes],[have_gdbus=3Dno]) ++ ++AS_IF([test "x$have_gdbus" =3D "xyes"], ++ [ ++ AC_DEFINE([HAVE_GDBUS],[1],[Define if GDBus backend is enabled]) ++ ] ++ ) ++ ++AM_CONDITIONAL([HAVE_GDBUS],[test "$have_gdbus" =3D "yes"]) ++ + dnl Bacon backend + dnl This is the fallback backend, so we *need* these headers and functi= ons + dnl even if we end up using D-Bus +@@ -146,7 +159,13 @@ AM_CONDITIONAL([HAVE_BACON], [test "x$have_bacon" =3D= "xyes"]) +=20 + dnl Choose the default backend + AC_MSG_CHECKING([for default IPC mechanism]) +-AS_IF([test "x$have_dbus" =3D "xyes"], ++AS_IF([test "x$have_gdbus" =3D "xyes"], ++ [ ++ UNIQUE_DEFAULT_BACKEND=3Dgdbus ++ AC_MSG_RESULT([GDBus]) ++ ], ++ ++ [test "x$have_dbus" =3D "xyes"], + [ + UNIQUE_DEFAULT_BACKEND=3Ddbus + AC_MSG_RESULT([D-Bus]) +@@ -243,6 +262,7 @@ AC_CONFIG_FILES([ + unique/uniqueversion.h + unique/bacon/Makefile + unique/dbus/Makefile ++ unique/gdbus/Makefile + tests/Makefile + po/Makefile.in + ]) +@@ -261,6 +281,7 @@ Configuration: + Backends: + Unix Domain Socket: $have_bacon + D-BUS: $have_dbus ++ GDBus: $have_gdbus +=20 + Default backend: $UNIQUE_DEFAULT_BACKEND + " +diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am +index 3172588..2c1dbf4 100644 +--- a/doc/reference/Makefile.am ++++ b/doc/reference/Makefile.am +@@ -50,7 +50,8 @@ IGNORE_HFILES =3D \ + uniquemarshal.h \ + stamp-uniquemarshal.h \ + bacon \ +- dbus=20 ++ dbus \ ++ gdbus +=20 + EXTRA_HFILES =3D +=20 +diff --git a/unique/Makefile.am b/unique/Makefile.am +index 6475a87..8f0b7ba 100644 +--- a/unique/Makefile.am ++++ b/unique/Makefile.am +@@ -12,7 +12,11 @@ if HAVE_DBUS + SUBDIRS +=3D dbus + endif +=20 +-DIST_SUBDIRS =3D bacon dbus ++if HAVE_GDBUS ++SUBDIRS +=3D gdbus ++endif ++ ++DIST_SUBDIRS =3D bacon dbus gdbus +=20 + INCLUDES =3D -I$(top_srcdir) +=20 +@@ -72,6 +76,10 @@ if HAVE_DBUS + unique_backend_libs +=3D $(top_builddir)/unique/dbus/libunique-dbus.la + endif +=20 ++if HAVE_GDBUS ++unique_backend_libs +=3D $(top_builddir)/unique/gdbus/libunique-gdbus.l= a ++endif ++ + uniquedir =3D $(includedir)/unique-1.0/unique + unique_HEADERS =3D \ + $(unique_sources_h) \ +diff --git a/unique/gdbus/.gitignore b/unique/gdbus/.gitignore +new file mode 100644 +index 0000000..c7e22c3 +--- /dev/null ++++ b/unique/gdbus/.gitignore +@@ -0,0 +1,2 @@ ++libunique_gdbus_la-uniquebackend-gdbus.lo ++libunique-gdbus.la +diff --git a/unique/gdbus/Makefile.am b/unique/gdbus/Makefile.am +new file mode 100644 +index 0000000..e10637d +--- /dev/null ++++ b/unique/gdbus/Makefile.am +@@ -0,0 +1,24 @@ ++include $(top_srcdir)/build/autotools/Makefile.am.silent ++ ++noinst_LTLIBRARIES =3D libunique-gdbus.la ++ ++libunique_gdbus_la_SOURCES =3D \ ++ uniquebackend-gdbus.h \ ++ uniquebackend-gdbus.c ++ ++libunique_gdbus_la_PPCFLAGS =3D \ ++ -DG_LOG_DOMAIN=3D\"Unique-GDBus\" \ ++ -DG_DISABLE_SINGLE_INCLUDES \ ++ -I$(top_srcdir) \ ++ $(AM_CPPFLAGS) ++ ++libunique_gdbus_la_CFLAGS =3D \ ++ $(UNIQUE_CFLAGS) \ ++ $(UNIQUE_DEBUG_CFLAGS) \ ++ $(MAINTAINER_CFLAGS) \ ++ $(GDBUS_CFLAGS) \ ++ $(AM_CFLAGS) ++ ++libunique_gdbus_la_LIBADD =3D \ ++ $(UNIQUE_LIBS) \ ++ $(GDBUS_LIBS) +diff --git a/unique/gdbus/uniquebackend-gdbus.c b/unique/gdbus/uniquebac= kend-gdbus.c +new file mode 100644 +index 0000000..14d54a9 +--- /dev/null ++++ b/unique/gdbus/uniquebackend-gdbus.c +@@ -0,0 +1,303 @@ ++/* Unique - Single Instance application library ++ * uniquebackend-gdbus.c: GDBus implementation of UniqueBackend ++ * ++ * Copyright (C) 2007 Emmanuele Bassi ++ * Copyright =C2=A9 2010 Christian Persch ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include ++#include ++ ++#include "../uniqueinternals.h" ++#include "uniquebackend-gdbus.h" ++ ++struct _UniqueBackendGDBus ++{ ++ UniqueBackend parent_instance; ++ ++ GDBusConnection *connection; ++ guint registration_id; ++ guint owner_id; ++ gboolean owns_name; ++ GMainLoop *loop; ++}; ++ ++struct _UniqueBackendGDBusClass ++{ ++ UniqueBackendClass parent_class; ++ GDBusNodeInfo *introspection_data; ++}; ++ ++G_DEFINE_TYPE (UniqueBackendGDBus, unique_backend_gdbus, UNIQUE_TYPE_BA= CKEND); ++ ++static const char introspection_xml[] =3D ++ "" ++ "" ++ "" ++ "" ++ "" ++ "" ++ "" ++ "" ++ "" ++ ""; ++ ++static void ++method_call_cb (GDBusConnection *connection, ++ const gchar *sender, ++ const gchar *object_path, ++ const gchar *interface_name, ++ const gchar *method_name, ++ GVariant *parameters, ++ GDBusMethodInvocation *invocation, ++ gpointer user_data) ++{ ++ if (g_strcmp0 (interface_name, "org.gtk.UniqueApp") !=3D 0 || ++ g_strcmp0 (object_path, "/Factory") !=3D 0) ++ return; ++ ++ if (g_strcmp0 (method_name, "SendMessage") =3D=3D 0) ++ { ++ UniqueBackend *backend =3D UNIQUE_BACKEND (user_data); ++ const gchar *command_str, *data, *startup_id; ++ guint len, screen_num, workspace, time_; ++ UniqueMessageData message_data; ++ gint command; ++ UniqueResponse response; ++ GdkDisplay *display; ++ ++ g_variant_get (parameters, ++ "(&s(&suuu&s)u)", ++ &command_str, ++ &data, &len, &screen_num, &workspace, &startup_id, ++ &time_); ++ ++ command =3D unique_command_from_string (backend->parent, command_= str); ++ if (command =3D=3D 0) ++ { ++ g_dbus_method_invocation_return_error (invocation, ++ G_DBUS_ERROR, ++ G_DBUS_ERROR_INVALID_A= RGS, ++ "Invalid command `%s' = received", ++ command_str); ++ return; ++ } ++ ++ display =3D gdk_display_get_default (); ++ ++ message_data.data =3D len > 0 ? (guchar *) data : NULL; ++ message_data.length =3D (gint) len; ++ message_data.workspace =3D workspace; ++ message_data.startup_id =3D (char *) startup_id; ++ if (screen_num >=3D 0 && screen_num < gdk_display_get_n_screens (= display)) ++ message_data.screen =3D gdk_display_get_screen (display, screen= _num); ++ else ++ message_data.screen =3D gdk_screen_get_default (); ++ ++ response =3D unique_app_emit_message_received (backend->parent, c= ommand, &message_data, time_); ++ ++ g_dbus_method_invocation_return_value (invocation, ++ g_variant_new ("(s)", uniq= ue_response_to_string (response))); ++ return; ++ } ++} ++ ++static void ++name_acquired_cb (GDBusConnection *connection, ++ const gchar *name, ++ gpointer user_data) ++{ ++ UniqueBackendGDBus *backend_gdbus =3D UNIQUE_BACKEND_GDBUS (user_data= ); ++ ++ backend_gdbus->owns_name =3D TRUE; ++ if (backend_gdbus->loop && g_main_loop_is_running (backend_gdbus->loo= p)) ++ g_main_loop_quit (backend_gdbus->loop); ++} ++ ++static void ++name_lost_cb (GDBusConnection *connection, ++ const gchar *name, ++ gpointer user_data) ++{ ++ UniqueBackendGDBus *backend_gdbus =3D UNIQUE_BACKEND_GDBUS (user_data= ); ++ ++ backend_gdbus->owns_name =3D FALSE; ++ if (backend_gdbus->loop && g_main_loop_is_running (backend_gdbus->loo= p)) ++ g_main_loop_quit (backend_gdbus->loop); ++} ++ ++static const GDBusInterfaceVTable interface_vtable =3D { ++ method_call_cb, ++ NULL, ++ NULL ++}; ++ ++static gboolean ++unique_backend_gdbus_request_name (UniqueBackend *backend) ++{ ++ UniqueBackendGDBus *backend_gdbus =3D UNIQUE_BACKEND_GDBUS (backend); ++ UniqueBackendGDBusClass *klass =3D UNIQUE_BACKEND_GDBUS_GET_CLASS (ba= ckend); ++ GError *error; ++ ++ error =3D NULL; ++ backend_gdbus->connection =3D g_bus_get_sync (G_BUS_TYPE_SESSION, NUL= L, &error); ++ if (!backend_gdbus->connection) ++ { ++ g_warning ("Unable to open a connection to the session bus: %s", ++ error->message); ++ g_error_free (error); ++ ++ return FALSE; ++ } ++ ++ backend_gdbus->registration_id =3D ++ g_dbus_connection_register_object (backend_gdbus->connection, ++ "/Factory", ++ klass->introspection_data->int= erfaces[0], ++ &interface_vtable, ++ backend, NULL, ++ &error); ++ if (backend_gdbus->registration_id =3D=3D 0) ++ { ++ g_warning ("Unable to register object with the session bus: %s", ++ error->message); ++ g_error_free (error); ++ ++ return FALSE; ++ } ++ ++ backend_gdbus->owns_name =3D FALSE; ++ ++ backend_gdbus->owner_id =3D ++ g_bus_own_name_on_connection (backend_gdbus->connection, ++ unique_backend_get_name (backend), ++ G_BUS_NAME_OWNER_FLAGS_NONE, ++ name_acquired_cb, ++ name_lost_cb, ++ backend, NULL); ++ ++ backend_gdbus->loop =3D g_main_loop_new (NULL, FALSE); ++ g_main_loop_run (backend_gdbus->loop); ++ g_main_loop_unref (backend_gdbus->loop); ++ backend_gdbus->loop =3D NULL; ++ ++ return backend_gdbus->owns_name; ++} ++ ++static UniqueResponse ++unique_backend_gdbus_send_message (UniqueBackend *backend, ++ gint command, ++ UniqueMessageData *message_data, ++ guint time_) ++{ ++ UniqueBackendGDBus *backend_gdbus =3D UNIQUE_BACKEND_GDBUS (backend); ++ GVariantBuilder builder; ++ GVariant *result; ++ const gchar *command_str, *resp; ++ UniqueResponse response; ++ GError *error; ++ ++ command_str =3D unique_command_to_string (backend->parent, command); ++ ++ g_variant_builder_init (&builder, G_VARIANT_TYPE ("(s(suuus)u)")); ++ g_variant_builder_add (&builder, "s", command_str ? command_str : "")= ; ++ g_variant_builder_open (&builder, G_VARIANT_TYPE ("(suuus)")); ++ g_variant_builder_add (&builder, "s", message_data->data ? (char *) m= essage_data->data : ""); ++ g_variant_builder_add (&builder, "u", (guint) message_data->length); ++ g_variant_builder_add (&builder, "u", (guint) gdk_screen_get_number (= message_data->screen)); ++ g_variant_builder_add (&builder, "u", (guint) message_data->workspace= ); ++ g_variant_builder_add (&builder, "s", message_data->startup_id ? mess= age_data->startup_id : ""); ++ g_variant_builder_close (&builder); ++ g_variant_builder_add (&builder, "u", time_); ++ ++ error =3D NULL; ++ result =3D g_dbus_connection_call_sync (backend_gdbus->connection, ++ unique_backend_get_name (backen= d), ++ "/Factory", ++ "org.gtk.UniqueApp", ++ "SendMessage", ++ g_variant_builder_end (&builder= ), ++ G_VARIANT_TYPE ("(s)"), ++ G_DBUS_CALL_FLAGS_NO_AUTO_START= , ++ -1, ++ NULL, ++ &error); ++ if (error) ++ { ++ g_warning ("Error while sending message: %s", error->message); ++ g_error_free (error); ++ =20 ++ return UNIQUE_RESPONSE_INVALID; ++ } ++ ++ g_variant_get (result, "(&s)", &resp); ++ response =3D unique_response_from_string (resp); ++ g_variant_unref (result); ++ ++ return response; ++} ++ ++static void ++unique_backend_gdbus_dispose (GObject *gobject) ++{ ++ UniqueBackendGDBus *backend_gdbus =3D UNIQUE_BACKEND_GDBUS (gobject); ++ ++ if (backend_gdbus->owner_id !=3D 0) ++ { ++ g_bus_unown_name (backend_gdbus->owner_id); ++ backend_gdbus->owner_id =3D 0; ++ } ++ if (backend_gdbus->registration_id !=3D 0) ++ { ++ g_assert (backend_gdbus->connection !=3D NULL); ++ g_dbus_connection_unregister_object (backend_gdbus->connection, ++ backend_gdbus->registration_= id); ++ backend_gdbus->registration_id =3D 0; ++ } ++ if (backend_gdbus->connection) ++ { ++ g_object_unref (backend_gdbus->connection); ++ backend_gdbus->connection =3D NULL; ++ } ++ ++ G_OBJECT_CLASS (unique_backend_gdbus_parent_class)->dispose (gobject)= ; ++} ++ ++static void ++unique_backend_gdbus_class_init (UniqueBackendGDBusClass *klass) ++{ ++ GObjectClass *gobject_class =3D G_OBJECT_CLASS (klass); ++ UniqueBackendClass *backend_class =3D UNIQUE_BACKEND_CLASS (klass); ++ ++ gobject_class->dispose =3D unique_backend_gdbus_dispose; ++ ++ backend_class->request_name =3D unique_backend_gdbus_request_name; ++ backend_class->send_message =3D unique_backend_gdbus_send_message; ++ ++ klass->introspection_data =3D g_dbus_node_info_new_for_xml (introspec= tion_xml, NULL); ++ g_assert (klass->introspection_data !=3D NULL); ++} ++ ++static void ++unique_backend_gdbus_init (UniqueBackendGDBus *backend) ++{ ++} +diff --git a/unique/gdbus/uniquebackend-gdbus.h b/unique/gdbus/uniquebac= kend-gdbus.h +new file mode 100644 +index 0000000..41eb6e5 +--- /dev/null ++++ b/unique/gdbus/uniquebackend-gdbus.h +@@ -0,0 +1,43 @@ ++/* Unique - Single Instance application library ++ * uniquebackend-gdbus.c: GDBus implementation of UniqueBackend ++ * ++ * Copyright (C) 2007 Emmanuele Bassi ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library 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 ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ */ ++ ++#ifndef __UNIQUE_BACKEND_GDBUS_H__ ++#define __UNIQUE_BACKEND_GDBUS_H__ ++ ++#include ++ ++G_BEGIN_DECLS ++ ++#define UNIQUE_TYPE_BACKEND_GDBUS (unique_backend_gdbus_= get_type ()) ++#define UNIQUE_BACKEND_GDBUS(obj) (G_TYPE_CHECK_INSTANCE= _CAST ((obj), UNIQUE_TYPE_BACKEND_GDBUS, UniqueBackendGDBus)) ++#define UNIQUE_IS_BACKEND_GDBUS(obj) (G_TYPE_CHECK_INSTANCE= _TYPE ((obj), UNIQUE_TYPE_BACKEND_GDBUS)) ++#define UNIQUE_BACKEND_GDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CA= ST ((klass), UNIQUE_TYPE_BACKEND_GDBUS, UniqueBackendGDBusClass)) ++#define UNIQUE_IS_BACKEND_GDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TY= PE ((klass), UNIQUE_TYPE_BACKEND_GDBUS)) ++#define UNIQUE_BACKEND_GDBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_C= LASS ((obj), UNIQUE_TYPE_BACKEND_GDBUS, UniqueBackendGDBusClass)) ++ ++typedef struct _UniqueBackendGDBus UniqueBackendGDBus; ++typedef struct _UniqueBackendGDBusClass UniqueBackendGDBusClass; ++ ++GType unique_backend_gdbus_get_type (void) G_GNUC_CONST; ++ ++G_END_DECLS ++ ++#endif /* __UNIQUE_BACKEND_GDBUS_H__ */ +diff --git a/unique/uniquebackend.c b/unique/uniquebackend.c +index 18a0c45..a76e42e 100644 +--- a/unique/uniquebackend.c ++++ b/unique/uniquebackend.c +@@ -298,6 +298,9 @@ unique_backend_send_message (UniqueBackend *back= end, + #ifdef HAVE_DBUS + #include "dbus/uniquebackend-dbus.h" + #endif ++#ifdef HAVE_GDBUS ++#include "gdbus/uniquebackend-gdbus.h" ++#endif +=20 + /** + * unique_backend_create: +@@ -329,6 +332,10 @@ unique_backend_create (void) + if (strcmp (backend_name, "dbus") =3D=3D 0) + backend_gtype =3D unique_backend_dbus_get_type (); + #endif /* HAVE_DBUS */ ++#ifdef HAVE_GDBUS ++ if (strcmp (backend_name, "gdbus") =3D=3D 0) ++ backend_gtype =3D unique_backend_gdbus_get_type (); ++#endif /* HAVE_GDBUS */ + #if !defined(HAVE_BACON) && !defined(HAVE_DBUS) + #error Need either bacon or dbus + #endif=20 +-- +cgit v0.8.3.1 diff --git a/gnu/packages/patches/libunique-remove-G_CONST_RETURN.patch b= /gnu/packages/patches/libunique-remove-G_CONST_RETURN.patch new file mode 100644 index 0000000..7c70ba0 --- /dev/null +++ b/gnu/packages/patches/libunique-remove-G_CONST_RETURN.patch @@ -0,0 +1,117 @@ +diff -Nur libunique-1.1.6.orig/unique/uniqueapp.c libunique-1.1.6/unique= /uniqueapp.c +--- libunique-1.1.6.orig/unique/uniqueapp.c 2011-12-01 07:38:17.74812229= 8 +0000 ++++ libunique-1.1.6/unique/uniqueapp.c 2011-12-01 07:39:59.132319788 +00= 00 +@@ -781,7 +781,7 @@ + } +=20 +=20 +-G_CONST_RETURN gchar * ++const gchar * + unique_command_to_string (UniqueApp *app, + gint command) + { +@@ -863,7 +863,7 @@ + return retval; + } +=20 +-G_CONST_RETURN gchar * ++const gchar * + unique_response_to_string (UniqueResponse response) + { + GEnumClass *enum_class; +diff -Nur libunique-1.1.6.orig/unique/uniquebackend.c libunique-1.1.6/un= ique/uniquebackend.c +--- libunique-1.1.6.orig/unique/uniquebackend.c 2011-12-01 07:38:17.7481= 22298 +0000 ++++ libunique-1.1.6/unique/uniquebackend.c 2011-12-01 07:39:24.418677950= +0000 +@@ -111,7 +111,7 @@ + * + * Return value: FIXME + */ +-G_CONST_RETURN gchar * ++const gchar * + unique_backend_get_name (UniqueBackend *backend) + { + g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL); +@@ -154,7 +154,7 @@ + * + * Return value: FIXME + */ +-G_CONST_RETURN gchar * ++const gchar * + unique_backend_get_startup_id (UniqueBackend *backend) + { + g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL); +diff -Nur libunique-1.1.6.orig/unique/uniquebackend.h libunique-1.1.6/un= ique/uniquebackend.h +--- libunique-1.1.6.orig/unique/uniquebackend.h 2011-12-01 07:38:17.7481= 22298 +0000 ++++ libunique-1.1.6/unique/uniquebackend.h 2011-12-01 07:42:13.833467492= +0000 +@@ -94,10 +94,10 @@ +=20 + UniqueBackend * unique_backend_create (void); +=20 +-G_CONST_RETURN gchar *unique_backend_get_name (UniqueBackend = *backend); ++const gchar *unique_backend_get_name (UniqueBackend *backend)= ; + void unique_backend_set_name (UniqueBackend = *backend, + const gchar = *name); +-G_CONST_RETURN gchar *unique_backend_get_startup_id (UniqueBackend = *backend); ++const gchar *unique_backend_get_startup_id (UniqueBackend *backend)= ; + void unique_backend_set_startup_id (UniqueBackend = *backend, + const gchar = *startup_id); + GdkScreen * unique_backend_get_screen (UniqueBackend = *backend); +diff -Nur libunique-1.1.6.orig/unique/uniqueinternals.h libunique-1.1.6/= unique/uniqueinternals.h +--- libunique-1.1.6.orig/unique/uniqueinternals.h 2011-12-01 07:38:17.74= 8122298 +0000 ++++ libunique-1.1.6/unique/uniqueinternals.h 2011-12-01 07:41:17.1429779= 14 +0000 +@@ -44,11 +44,11 @@ + * and then back into an id + */ + UniqueResponse unique_response_from_string (const gchar *res= ponse); +-G_CONST_RETURN gchar *unique_response_to_string (UniqueResponse res= ponse); ++const gchar *unique_response_to_string (UniqueResponse response); +=20 + gint unique_command_from_string (UniqueApp *app= , + const gchar *com= mand); +-G_CONST_RETURN gchar *unique_command_to_string (UniqueApp *app= , ++const gchar *unique_command_to_string (UniqueApp *app, + gint com= mand); +=20 + G_END_DECLS +diff -Nur libunique-1.1.6.orig/unique/uniquemessage.c libunique-1.1.6/un= ique/uniquemessage.c +--- libunique-1.1.6.orig/unique/uniquemessage.c 2011-12-01 07:38:17.7481= 22298 +0000 ++++ libunique-1.1.6/unique/uniquemessage.c 2011-12-01 07:41:45.743225713= +0000 +@@ -185,7 +185,7 @@ + * + * Since: 1.0.2 + */ +-G_CONST_RETURN guchar * ++const guchar * + unique_message_data_get (UniqueMessageData *message_data, + gsize *length) + { +@@ -525,7 +525,7 @@ + * owned by the #UniqueMessageData structure and should not be + * modified or freed + */ +-G_CONST_RETURN gchar * ++const gchar * + unique_message_data_get_startup_id (UniqueMessageData *message_data) + { + g_return_val_if_fail (message_data !=3D NULL, NULL); +diff -Nur libunique-1.1.6.orig/unique/uniquemessage.h libunique-1.1.6/un= ique/uniquemessage.h +--- libunique-1.1.6.orig/unique/uniquemessage.h 2011-12-01 07:38:17.7481= 22298 +0000 ++++ libunique-1.1.6/unique/uniquemessage.h 2011-12-01 07:40:47.576064565= +0000 +@@ -48,7 +48,7 @@ + void unique_message_data_set (UniqueMessag= eData *message_data, + const guchar= *data, + gsize = length); +-G_CONST_RETURN guchar *unique_message_data_get (UniqueMessag= eData *message_data, ++const guchar *unique_message_data_get (UniqueMessageData *me= ssage_data, + gsize = *length); +=20 + gboolean unique_message_data_set_text (UniqueMessag= eData *message_data, +@@ -63,7 +63,7 @@ + gchar * unique_message_data_get_filename (UniqueMessag= eData *message_data); +=20 + GdkScreen * unique_message_data_get_screen (UniqueMessag= eData *message_data); +-G_CONST_RETURN gchar * unique_message_data_get_startup_id (UniqueMessag= eData *message_data); ++const gchar * unique_message_data_get_startup_id (UniqueMessageData *me= ssage_data); + guint unique_message_data_get_workspace (UniqueMessag= eData *message_data); +=20 + G_END_DECLS --=20 1.9.1