[gnome-software] Use an API version when installing runtime loadable modules



commit cce164a2e933feb5311c97e1b8d894ae49ddb90f
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 28 12:19:36 2013 +0000

    Use an API version when installing runtime loadable modules
    
    Using gnome-software 3.10.x plugins in a 3.11.x binary (and vice-versa) causes
    all kinds of mischief.

 configure.ac                   |    6 ++++++
 contrib/gnome-software.spec.in |    4 ++--
 src/gs-plugin-loader.c         |    6 +++++-
 src/plugins/Makefile.am        |    2 +-
 4 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index cf369d1..fccbb0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,6 +92,12 @@ AS_IF([test "$enable_man" != no], [
 ])
 AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
 
+# this refers to the gnome-software plugin API version
+# this is not in any way related to a package or soname version
+GS_PLUGIN_API_VERSION=2
+AC_SUBST(GS_PLUGIN_API_VERSION)
+AC_DEFINE_UNQUOTED([GS_PLUGIN_API_VERSION], "$GS_PLUGIN_API_VERSION", [the plugin API version])
+
 dnl ---------------------------------------------------------------------------
 dnl - Makefiles, etc.
 dnl ---------------------------------------------------------------------------
diff --git a/contrib/gnome-software.spec.in b/contrib/gnome-software.spec.in
index 7200e7b..2abb359 100644
--- a/contrib/gnome-software.spec.in
+++ b/contrib/gnome-software.spec.in
@@ -87,8 +87,8 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %{_mandir}/man1/gnome-software.1.gz
 %{_datadir}/icons/hicolor/*/apps/*
 %{_datadir}/gnome-software/featured.ini
-%dir %{_libdir}/gs-plugins
-%{_libdir}/gs-plugins/*.so
+%dir %{_libdir}/gs-plugins-2
+%{_libdir}/gs-plugins-2/*.so
 %{_sysconfdir}/xdg/autostart/gnome-software-service.desktop
 %{_libexecdir}/gnome-software-service
 %{_datadir}/dbus-1/services/org.gnome.Software.service
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 5dbfc49..7db1495 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2442,6 +2442,8 @@ out:
 void
 gs_plugin_loader_set_location (GsPluginLoader *plugin_loader, const gchar *location)
 {
+       gchar *filename;
+
        g_free (plugin_loader->priv->location);
 
        /* something non-default specified */
@@ -2451,7 +2453,9 @@ gs_plugin_loader_set_location (GsPluginLoader *plugin_loader, const gchar *locat
        }
 
        /* use the default, but this requires a 'make install' */
-       plugin_loader->priv->location = g_build_filename (LIBDIR, "gs-plugins", NULL);
+       filename = g_strdup_printf ("gs-plugins-%s", GS_PLUGIN_API_VERSION);
+       plugin_loader->priv->location = g_build_filename (LIBDIR, filename, NULL);
+       g_free (filename);
 }
 
 /**
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index febcf2f..c82f82f 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -22,7 +22,7 @@ noinst_LTLIBRARIES =                                  \
        libgs_plugin_dummy.la                           \
        libgs_plugin_self_test.la
 
-plugindir = $(libdir)/gs-plugins
+plugindir = $(libdir)/gs-plugins-${GS_PLUGIN_API_VERSION}
 plugin_LTLIBRARIES =                                   \
        libgs_plugin_appdata.la                         \
        libgs_plugin_appstream.la                       \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]