Skip to content
This repository has been archived by the owner on Mar 10, 2019. It is now read-only.

Commit

Permalink
remove old plugin system, switch to libpeas
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Matthew committed Apr 24, 2011
1 parent db05297 commit ea85111
Show file tree
Hide file tree
Showing 27 changed files with 255 additions and 3,352 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.deps
.libs
*.pyc
*.rb-plugin
*.plugin

autom4te*.cache
stamp-h
Expand All @@ -30,10 +30,10 @@ gnome-doc-utils.make
rhythmbox.pc

#
bindings/gi/MPID-0.13.gir
bindings/gi/MPID-0.13.typelib
bindings/gi/RB-0.13.gir
bindings/gi/RB-0.13.typelib
bindings/gi/MPID-3.0.gir
bindings/gi/MPID-3.0.typelib
bindings/gi/RB-3.0.gir
bindings/gi/RB-3.0.typelib

#
org.gnome.Rhythmbox.service
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-schemas-install --enable-gtk-doc --disable
distuninstallcheck_listfiles = find . -type f -print | grep -v '^\./var/scrollkeeper'

SUBDIRS = macros lib metadata rhythmdb widgets sources podcast \
backends shell bindings plugins remote data po help tests doc
backends shell bindings remote data po help tests doc

INCLUDES = rhythmbox.h

Expand Down
32 changes: 15 additions & 17 deletions bindings/gi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ rb_introspection_sources = \
shell/rb-history.c \
shell/rb-play-order.h \
shell/rb-play-order.c \
shell/rb-plugin.h \
shell/rb-plugin.c \
shell/rb-track-transfer-batch.c \
shell/rb-track-transfer-batch.h \
shell/rb-track-transfer-queue.c \
Expand Down Expand Up @@ -122,23 +120,23 @@ rb_introspection_sources = \
widgets/rb-uri-dialog.h \
widgets/rb-uri-dialog.c

MPID-0.13.gir: $(top_builddir)/shell/librhythmbox-core.la
MPID_0_13_gir_INCLUDES = GObject-2.0
MPID_0_13_gir_CFLAGS = $(RHYTHMBOX_CFLAGS_NOWARN) $(GUDEV_CFLAGS) -I../..
MPID_0_13_gir_LIBS = $(top_builddir)/shell/librhythmbox-core.la
MPID_0_13_gir_FILES = $(addprefix $(top_srcdir)/,$(mpid_introspection_sources))
MPID_0_13_gir_PACKAGES = gobject-2.0
MPID_0_13_gir_SCANNERFLAGS = --symbol-prefix mpid_
MPID-3.0.gir: $(top_builddir)/shell/librhythmbox-core.la
MPID_3_0_gir_INCLUDES = GObject-2.0
MPID_3_0_gir_CFLAGS = $(RHYTHMBOX_CFLAGS_NOWARN) $(GUDEV_CFLAGS) -I../..
MPID_3_0_gir_LIBS = $(top_builddir)/shell/librhythmbox-core.la
MPID_3_0_gir_FILES = $(addprefix $(top_srcdir)/,$(mpid_introspection_sources))
MPID_3_0_gir_PACKAGES = gobject-2.0
MPID_3_0_gir_SCANNERFLAGS = --symbol-prefix mpid_

RB-0.13.gir: $(top_builddir)/shell/librhythmbox-core.la MPID-0.13.gir
RB_0_13_gir_INCLUDES = GObject-2.0 Gio-2.0 Gtk-3.0 Gst-0.10 libxml2-2.0
RB_0_13_gir_CFLAGS = $(RHYTHMBOX_CFLAGS_NOWARN) $(TOTEM_PLPARSER_CFLAGS) $(DBUS_CFLAGS) $(GUDEV_CFLAGS) -I../..
RB_0_13_gir_LIBS = $(top_builddir)/shell/librhythmbox-core.la
RB_0_13_gir_FILES = $(addprefix $(top_srcdir)/,$(rb_introspection_sources))
RB_0_13_gir_PACKAGES = gobject-2.0 gio-2.0 gtk+-3.0 gstreamer-0.10 libxml-2.0
RB_0_13_gir_SCANNERFLAGS = --symbol-prefix rb_ --identifier-prefix RB --accept-unprefixed --include-uninstalled=$(builddir)/MPID-0.13.gir
RB-3.0.gir: $(top_builddir)/shell/librhythmbox-core.la MPID-3.0.gir
RB_3_0_gir_INCLUDES = GObject-2.0 Gio-2.0 Gtk-3.0 Gst-0.10 libxml2-2.0
RB_3_0_gir_CFLAGS = $(RHYTHMBOX_CFLAGS_NOWARN) $(TOTEM_PLPARSER_CFLAGS) $(DBUS_CFLAGS) $(GUDEV_CFLAGS) -I../..
RB_3_0_gir_LIBS = $(top_builddir)/shell/librhythmbox-core.la
RB_3_0_gir_FILES = $(addprefix $(top_srcdir)/,$(rb_introspection_sources))
RB_3_0_gir_PACKAGES = gobject-2.0 gio-2.0 gtk+-3.0 gstreamer-0.10 libxml-2.0
RB_3_0_gir_SCANNERFLAGS = --symbol-prefix rb_ --identifier-prefix RB --accept-unprefixed --include-uninstalled=$(builddir)/MPID-3.0.gir

INTROSPECTION_GIRS += MPID-0.13.gir RB-0.13.gir
INTROSPECTION_GIRS += MPID-3.0.gir RB-3.0.gir

girdir = $(datadir)/gir-1.0
dist_gir_DATA = $(INTROSPECTION_GIRS)
Expand Down
100 changes: 18 additions & 82 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ AVAHI_REQS=0.6
LIBSOUP_REQS=2.26.0
GUDEV_REQS=143
LIBMTP_REQS=0.3.0
PYGOBJECT_REQUIRED=2.15.4
LIBPEAS_REQS=0.7.3

GNOME_MEDIA_PROFILES_REQS=2.91.0
LIBNOTIFY_REQS=0.7.0
BRASERO_MIN_REQS=2.31.5
WEBKIT_MIN_REQS=1.3.9
PYGOBJECT_REQUIRED=2.28

GLIB_GSETTINGS

Expand Down Expand Up @@ -103,7 +104,9 @@ PKG_CHECK_MODULES(RHYTHMBOX, \
gio-unix-2.0 >= $GLIB_REQS \
libgnome-media-profiles-3.0 >= $GNOME_MEDIA_PROFILES_REQS \
libsoup-2.4 >= $LIBSOUP_REQS \
libsoup-gnome-2.4 >= $LIBSOUP_REQS)
libsoup-gnome-2.4 >= $LIBSOUP_REQS \
libpeas-1.0 >= $LIBPEAS_REQS
libpeas-gtk-1.0 >= $LIBPEAS_REQS)

PKG_CHECK_MODULES(TOTEM_PLPARSER, totem-plparser >= $TOTEM_PLPARSER_REQS, have_totem_plparser=yes, have_totem_plparser=no)
if test x$have_totem_plparser != xyes; then
Expand Down Expand Up @@ -636,94 +639,27 @@ AC_SUBST(PLUGINDIR)
dnl ================================================================
dnl Python plugins
dnl ================================================================
AM_PATH_PYTHON

AC_MSG_CHECKING([whether Python plugin support is requested])
AC_ARG_ENABLE([python],
AS_HELP_STRING([--enable-python],[Enable python support]),
[enable_python=$enableval have_python=$enableval],
[enable_python=autodetect have_python=yes])
AC_MSG_RESULT([$have_python])

if test "x$have_python" != "xyes"; then
if test "x$enable_python" = "xyes"; then
AC_MSG_ERROR([Python not found])
elif test "x$enable_python" = "xautodetect"; then
enable_python=no
AC_MSG_WARN([Python not found, disabling python support])
fi
fi

if test "x$have_python" != "xno"; then
AM_PATH_PYTHON([2.3],[],[have_python=no])
if test "x$PYTHON" = "x:"; then
have_python=no
fi
fi

if test "x$have_python" != "xno"; then
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
PYTHON_LIBS="-lpython$PYTHON_VERSION"
if test -d $PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION ; then
PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config"
PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config/Makefile"
else
PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
fi
PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_EXTRA_LIBS="$PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_LIB_LOC])
AC_SUBST([PYTHON_CFLAGS])
AC_SUBST([PYTHON_EXTRA_LIBS])

GST_PYTHON_REQUIRED=0.10.1
PKG_CHECK_MODULES([PYGOBJECT], [
gst-python-0.10 >= $GST_PYTHON_REQUIRED
pygobject-2.0 >= $PYGOBJECT_REQUIRED],
[],
[
have_python=no
if test "x$enable_python" = "xyes"; then
AC_MSG_ERROR([$PYGOBJECT_PKG_ERRORS])
elif test "x$enable_python" = "xautodetect"; then
enable_python=no
AC_MSG_WARN([$PYGOBJECT_PKG_ERRORS])
AC_MSG_WARN([Disabling python support])
fi
])
AC_ARG_ENABLE([python],
AS_HELP_STRING([--enable-python[=@<:@no/auto/yes@:>@]],[Build with python support]),
[enable_python=$enableval],
[enable_python="auto"])

AC_SUBST([PYGOBJECT_CFLAGS])
AC_SUBST([PYGOBJECT_LIBS])
if test "x$enable_python" = "xauto"; then
PKG_CHECK_EXISTS([pygobject-2.0 >= $PYGOBJECT_REQUIRED],
[enable_python=yes],[enable_python=no])
fi

if test "x$have_python" != "xno"; then
AC_MSG_CHECKING([for gst-python defs])
GST_PYTHON_DEFSDIR=`$PKG_CONFIG --variable=defsdir gst-python-0.10`
AC_MSG_RESULT([$GST_PYTHON_DEFSDIR])

AC_MSG_CHECKING([for pygobject codegen])
PYGOBJECT_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygobject-2.0`/codegen.py"
AC_MSG_RESULT([$PYGOBJECT_CODEGEN])

AC_MSG_CHECKING([for pygobject h2def])
PYGOBJECT_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygobject-2.0`/h2def.py"
AC_MSG_RESULT([$PYGOBJECT_H2DEF])

AC_SUBST([GST_PYTHON_DEFSDIR])
AC_SUBST([PYGOBJECT_CODEGEN])
AC_SUBST([PYGOBJECT_H2DEF])
fi
if test "x$enable_python" = "xyes"; then
PKG_CHECK_MODULES(PYTHON, [pygobject-2.0 >= $PYGOBJECT_REQUIRED])

if test "x$have_python" != "xno" -a "x$enable_python" != "xno"; then
enable_python=yes
AC_DEFINE([ENABLE_PYTHON],[1],[Define to compile with python plugin support])
pyoverridesdir=`$PKG_CONFIG --variable=overridesdir pygobject-2.0`
AC_SUBST(pyoverridesdir)
fi

AM_CONDITIONAL([ENABLE_PYTHON],[test "x$enable_python" = "xyes"])
AM_CONDITIONAL(ENABLE_PYTHON, test x"$enable_python" = "xyes")

dnl ================================================================
dnl Vala plugins
Expand Down
12 changes: 6 additions & 6 deletions data/org.gnome.rhythmbox.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,6 @@
<summary>List of active plugin names.</summary>
<description>List of active plugin names. These plugins will be loaded on startup if available.</description>
</key>
<key name="hidden-plugins" type="as">
<default>['audiocd','cd-recorder','generic-player','iradio','mmkeys','mpris']</default>
<summary>List of hidden plugin names.</summary>
<description>List of hidden plugin names. These plugins will not be shown in the plugin configuration dialog.</description>
</key>
</schema>

<schema id="org.gnome.rhythmbox.plugins.audiocd" path="/org/gnome/rhythmbox/plugins/audiocd/">
Expand Down Expand Up @@ -311,14 +306,19 @@
<child name="source" schema="org.gnome.rhythmbox.source"/>
</schema>

<schema id="org.gnome.rhythmbox.plugins.iradio.source" extends="org.gnome.rhythmbox.source">
<override name="sorting">('Title',true)</override>
<override name="paned-position">200</override>
<override name="show-browser">true</override>
</schema>
<schema id="org.gnome.rhythmbox.plugins.iradio" path="/org/gnome/rhythmbox/plugins/iradio/">
<key name="initial-stations-loaded" type="b">
<default>false</default>
<summary>Whether the initial station list has been loaded</summary>
<description>Whether the initial station list has been loaded</description>
</key>

<child name='source' schema='org.gnome.rhythmbox.source'/>
<child name='source' schema='org.gnome.rhythmbox.plugins.iradio.source'/>
</schema>

<enum id="org.gnome.rhythmbox.plugins.jamendo.audio-format">
Expand Down
1 change: 0 additions & 1 deletion doc/reference/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ INCLUDES=\
$(RHYTHMBOX_CFLAGS)

if ENABLE_PYTHON
BINDING_LIBS = $(top_builddir)/bindings/python/rb.la
MORE_GTKDOC_LIBS = $(PYTHON_LIBS)
endif

Expand Down
28 changes: 0 additions & 28 deletions doc/reference/rhythmbox-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1165,34 +1165,6 @@ RB_IS_LIBRARY_BROWSER_CLASS
RB_LIBRARY_BROWSER_GET_CLASS
</SECTION>

<SECTION>
<FILE>rb-plugin</FILE>
<TITLE>RBPlugin</TITLE>
RBPlugin
RBPluginClass
RBPluginActivationFunc
RBPluginWidgetFunc
RBPluginBooleanFunc
rb_plugin_activate
rb_plugin_deactivate
rb_plugin_is_configurable
rb_plugin_create_configure_dialog
rb_plugin_find_file
rb_get_plugin_paths
RB_PLUGIN_REGISTER
RB_PLUGIN_REGISTER_TYPE
RB_PLUGIN_DEFINE_TYPE
<SUBSECTION Standard>
RB_PLUGIN
RB_IS_PLUGIN
RB_TYPE_PLUGIN
rb_plugin_get_type
RB_PLUGIN_CLASS
RB_IS_PLUGIN_CLASS
RB_PLUGIN_GET_CLASS
RB_PLUGIN_CONST
</SECTION>

<SECTION>
<FILE>rb-player-gst-filter</FILE>
<TITLE>RBPlayerGstFilter</TITLE>
Expand Down
2 changes: 0 additions & 2 deletions doc/reference/rhythmbox.types
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "rb-play-order.h"
#include "rb-play-order-random.h"
#include "rb-play-queue-source.h"
#include "rb-plugin.h"
#include "rb-property-view.h"
#include "rb-query-creator.h"
#include "rb-rating.h"
Expand Down Expand Up @@ -99,7 +98,6 @@ rb_playlist_manager_get_type
rb_playlist_source_get_type
rb_play_order_get_type
rb_play_queue_source_get_type
rb_plugin_get_type
rb_property_view_get_type
rb_query_creator_get_type
rb_random_play_order_get_type
Expand Down
55 changes: 55 additions & 0 deletions lib/rb-file-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <libpeas/peas.h>

#include <stdio.h>
#include <string.h>
#include <config.h>
Expand Down Expand Up @@ -305,6 +307,59 @@ rb_find_user_cache_file (const char *name,
return rb_find_user_file (rb_user_cache_dir (), name, error);
}

/**
* rb_find_plugin_data_file:
* @plugin: the plugin object
* @name: name of the file to find
*
* Locates a file under the plugin's data directory.
*
* Returns: allocated string containing the location of the file
*/
char *
rb_find_plugin_data_file (GObject *object, const char *name)
{
PeasPluginInfo *info;
char *ret = NULL;
const char *plugin_name = "<unknown>";

g_object_get (object, "plugin-info", &info, NULL);
if (info != NULL) {
char *tmp;

tmp = g_build_filename (peas_plugin_info_get_data_dir (info), name, NULL);
if (g_file_test (tmp, G_FILE_TEST_EXISTS)) {
ret = tmp;
} else {
g_free (tmp);
}

plugin_name = peas_plugin_info_get_name (info);
}

if (ret == NULL) {
const char *f;
f = rb_file (name);
if (f != NULL) {
ret = g_strdup (f);
}
}

rb_debug ("found '%s' when searching for file '%s' for plugin '%s'",
ret, name, plugin_name);

/* ensure it's an absolute path */
if (ret != NULL && ret[0] != '/') {
char *pwd = g_get_current_dir ();
char *path = g_strconcat (pwd, G_DIR_SEPARATOR_S, ret, NULL);
g_free (ret);
g_free (pwd);
ret = path;
}

return ret;
}

/**
* rb_file_helpers_init:
* @uninstalled: if %TRUE, search in source and build directories
Expand Down
2 changes: 2 additions & 0 deletions lib/rb-file-helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ char * rb_find_user_data_file (const char *name,
GError **error);
char * rb_find_user_cache_file (const char *name,
GError **error);
char * rb_find_plugin_data_file (GObject *plugin,
const char *name);

char * rb_canonicalise_uri (const char *uri);

Expand Down
1 change: 0 additions & 1 deletion rhythmbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#include <shell/rb-removable-media-manager.h>
#include <shell/rb-history.h>
#include <shell/rb-play-order.h>
#include <shell/rb-plugin.h>
#include <sources/rb-display-page.h>
#include <sources/rb-display-page-group.h>
#include <sources/rb-display-page-model.h>
Expand Down
Loading

0 comments on commit ea85111

Please sign in to comment.