diff --git a/media-sound/rhythmbox/Manifest b/media-sound/rhythmbox/Manifest new file mode 100644 index 0000000000000000000000000000000000000000..b4e10b01cbb1eabaa63461d6f6455c844d0c8afb --- /dev/null +++ b/media-sound/rhythmbox/Manifest @@ -0,0 +1,3 @@ +AUX rhythmbox-port-to-libsecret.patch 32498 SHA256 dcfcd926b6333a6ee4c7c34611214b63dbe44e572b504044d31552071a512dc9 SHA512 4385e6f1b7822d152354fc4923af37c3810572a76f96c8af2902536403b9f6e68fc41b422cfb3bc15e4ca853cde1362fa11906b4c65831e2b79992bb628e27ef WHIRLPOOL 765be7d37944d4d6922fc819545abd3e818ff55a5ddd2c9e6503b4476954fc242283e76fe68dd0fb255f6ffcaf75454c0de040d7d2b39677f56664ccc657fa8e +EBUILD rhythmbox-9999.ebuild 4515 SHA256 b4f3671f9f3625c0ac30808fe314d0d89fdbca00597b6efcc870d27fa1ab2ad0 SHA512 d124e573a3a017fe27b5516b8b16a48d64c50e71d0cfacb0b4e3c014b20b74e60ad7fc0dbff03b01f9a6f9bafe1a5836849a7d4ef0444bae0897c8d4517d3a78 WHIRLPOOL dc6f7efdd7e96c50b24a834e29b99fe0a10190285fec54df5127b4bfda93c8ece86cc60232a8d82f75c35ebdafcd257229250efa1eda2f92538a7c9c3a00bc9e +MISC metadata.xml 1226 SHA256 eb8be96953e74e24f63c8ce96cda303fb75b1accfaf6f75655a94f9981c21527 SHA512 11e8c4249dddc7777a6dcfc6fcfdccd33183748360f161c447786b3318dc365849b95ec363847896ff4289fa640a28abe70381eaf145ba196f4401bbf9b31291 WHIRLPOOL e67f41cea14aa2c88fa72511a75c80ef22f9239cc87dcfb33f3add075bf2c4ec49e1d0a833ea81a540c68c18c7a6aa92f94a4450af1f32d65e49f73a3213febe diff --git a/media-sound/rhythmbox/files/rhythmbox-port-to-libsecret.patch b/media-sound/rhythmbox/files/rhythmbox-port-to-libsecret.patch new file mode 100644 index 0000000000000000000000000000000000000000..bd0ed8fe39215e463f13609619ecd4d3324a738e --- /dev/null +++ b/media-sound/rhythmbox/files/rhythmbox-port-to-libsecret.patch @@ -0,0 +1,895 @@ +From 5f992f68cc96ea0d494f30be4ff5386185fb5c18 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Wed, 23 Jan 2013 02:29:10 +0530 +Subject: [PATCH] Port daap and magnatune plugins to libsecret + +The Magnatune plugin currently falls back to not saving the password at all if +libsecret isn't found. This fallback code should be removed once libsecret +becomes as prevalent as gnome-keyring was. + +Audioscrobbler used gnome-keyring for the old API, which no longer works. +Hence, that code was removed. + +https://bugzilla.gnome.org/show_bug.cgi?id=694981 + +As a bonus, add cscope.out to .gitignore +--- + .gitignore | 1 + + configure.ac | 40 ++- + plugins/audioscrobbler/Makefile.am | 1 - + .../rb-audioscrobbler-radio-source.c | 383 ++------------------- + .../rb-audioscrobbler-radio-source.h | 3 - + plugins/daap/Makefile.am | 6 +- + plugins/daap/rb-daap-source.c | 82 ++--- + plugins/magnatune/MagnatuneAccount.py | 88 ++--- + 8 files changed, 143 insertions(+), 461 deletions(-) + +diff --git a/.gitignore b/.gitignore +index a0a2751..d27c9c0 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -4,6 +4,7 @@ + .libs + *.pyc + *.plugin ++cscope.out + + autom4te*.cache + stamp-h +diff --git a/configure.ac b/configure.ac +index f739a19..58fde4d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -59,6 +59,8 @@ LIBMTP_REQS=0.3.0 + LIBPEAS_REQS=0.7.3 + GRILO_REQS=0.2.0 + LIBXML2_REQS=2.7.8 ++# Needed for libsecret commit ddd9bdd2 for the Magnatune plugin ++LIBSECRET_REQS=0.14 + + LIBNOTIFY_REQS=0.7.0 + BRASERO_MIN_REQS=2.31.5 +@@ -223,26 +225,28 @@ fi + AM_CONDITIONAL(USE_MTP, test x"$use_mtp" = xyes) + + +-dnl gnome-keyring support ++dnl libsecret keyring support + +-AC_ARG_WITH(gnome-keyring, +- AC_HELP_STRING([--with-gnome-keyring], +- [Enable gnome-keyring support]),, +- with_gnome_keyring=auto) +-if test "x$with_gnome_keyring" != "xno"; then ++AC_ARG_WITH(libsecret, ++ AC_HELP_STRING([--with-libsecret], ++ [Enable keyring support using libsecret]),, ++ with_libsecret=auto) ++if test "x$with_libsecret" != "xno"; then + +- PKG_CHECK_MODULES(GNOME_KEYRING, gnome-keyring-1, have_gnome_keyring=yes, have_gnome_keyring=no) +- if test "x$have_gnome_keyring" = "xno" -a "x$with_gnome_keyring" = "xyes"; then +- AC_MSG_ERROR([gnome-keyring support explicitly requested but gnome-keyring couldn't be found]) ++ PKG_CHECK_MODULES(LIBSECRET, libsecret-1 >= $LIBSECRET_REQS, ++ have_libsecret=yes, have_libsecret=no) ++ if test "x$have_libsecret" = "xno" -a "x$with_libsecret" = "xyes"; then ++ AC_MSG_ERROR([keyring support explicitly requested but libsecret ++ could not be found]) + fi +- if test "x$have_gnome_keyring" = "xyes"; then +- AC_DEFINE(WITH_GNOME_KEYRING, 1, [Define if gnome-keyring support is enabled]) +- use_gnome_keyring=yes +- AC_SUBST(GNOME_KEYRING_CFLAGS) +- AC_SUBST(GNOME_KEYRING_LIBS) ++ if test "x$have_libsecret" = "xyes"; then ++ AC_DEFINE(WITH_LIBSECRET, 1, [Define if libsecret support is enabled]) ++ use_libsecret=yes ++ AC_SUBST(LIBSECRET_CFLAGS) ++ AC_SUBST(LIBSECRET_LIBS) + fi + fi +-AM_CONDITIONAL(USE_GNOME_KEYRING, test x"$use_gnome_keyring" = xyes) ++AM_CONDITIONAL(USE_LIBSECRET, test x"$use_libsecret" = xyes) + + dnl Database + AC_ARG_WITH(database, +@@ -919,10 +923,10 @@ if test x"$with_vala" = xyes; then + else + AC_MSG_NOTICE([ Vala plugin support disabled]) + fi +-if test x"$use_gnome_keyring" = xyes; then +- AC_MSG_NOTICE([** gnome-keyring support enabled]) ++if test x"$use_libsecret" = xyes; then ++ AC_MSG_NOTICE([** Libsecret keyring support enabled]) + else +- AC_MSG_NOTICE([ gnome-keyring support disabled]) ++ AC_MSG_NOTICE([ Libsecret keyring support disabled]) + fi + if test "x$enable_fm_radio" != xno; then + AC_MSG_NOTICE([** FM radio support enabled]) +diff --git a/plugins/audioscrobbler/Makefile.am b/plugins/audioscrobbler/Makefile.am +index 913a6b3..ca332f1 100644 +--- a/plugins/audioscrobbler/Makefile.am ++++ b/plugins/audioscrobbler/Makefile.am +@@ -53,7 +53,6 @@ INCLUDES = \ + $(TOTEM_PLPARSER_CFLAGS) \ + $(JSON_GLIB_CFLAGS) \ + $(RHYTHMBOX_CFLAGS) \ +- $(GNOME_KEYRING_CFLAGS) \ + -D_BSD_SOURCE + + gtkbuilderdir = $(plugindatadir) +diff --git a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c +index 6f5f3cf..b0ddd52 100644 +--- a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c ++++ b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.c +@@ -35,10 +35,6 @@ + #include + #include + +-#ifdef WITH_GNOME_KEYRING +-#include +-#endif +- + #include + + #include "rb-audioscrobbler-radio-source.h" +@@ -170,9 +166,6 @@ struct _RBAudioscrobblerRadioSourcePrivate + GtkWidget *error_info_bar; + GtkWidget *error_info_bar_label; + +- GtkWidget *password_info_bar; +- GtkWidget *password_info_bar_entry; +- + RBEntryView *track_view; + RhythmDBQueryModel *track_model; + +@@ -184,13 +177,6 @@ struct _RBAudioscrobblerRadioSourcePrivate + RhythmDBEntry *playing_entry; + + RBExtDB *art_store; +- +- /* used when streaming radio using old api */ +- char *old_api_password; +- char *old_api_session_id; +- char *old_api_base_url; +- char *old_api_base_path; +- gboolean old_api_is_banned; + }; + + #define RB_AUDIOSCROBBLER_RADIO_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_AUDIOSCROBBLER_RADIO_SOURCE, RBAudioscrobblerRadioSourcePrivate)) +@@ -225,24 +211,9 @@ static void xspf_entry_parsed (TotemPlParser *parser, + GHashTable *metadata, + RBAudioscrobblerRadioSource *source); + +-/* old api */ +-static void old_api_shake_hands (RBAudioscrobblerRadioSource *source); +-static void old_api_handshake_response_cb (SoupSession *session, +- SoupMessage *msg, +- gpointer user_data); +-static void old_api_tune (RBAudioscrobblerRadioSource *source); +-static void old_api_tune_response_cb (SoupSession *session, +- SoupMessage *msg, +- gpointer user_data); +-static void old_api_fetch_playlist (RBAudioscrobblerRadioSource *source); +- + /* info bar related things */ + static void display_error_info_bar (RBAudioscrobblerRadioSource *source, + const char *message); +-static void display_password_info_bar (RBAudioscrobblerRadioSource *source); +-static void password_info_bar_response_cb (GtkInfoBar *info_bar, +- int response_id, +- RBAudioscrobblerRadioSource *source); + + /* RBDisplayPage implementations */ + static void impl_selected (RBDisplayPage *page); +@@ -413,8 +384,6 @@ rb_audioscrobbler_radio_source_constructed (GObject *object) + RhythmDB *db; + GtkWidget *main_vbox; + GtkWidget *error_info_bar_content_area; +- GtkWidget *password_info_bar_label; +- GtkWidget *password_info_bar_content_area; + GtkAccelGroup *accel_group; + RBSourceToolbar *toolbar; + +@@ -446,23 +415,6 @@ rb_audioscrobbler_radio_source_constructed (GObject *object) + gtk_container_add (GTK_CONTAINER (error_info_bar_content_area), source->priv->error_info_bar_label); + gtk_box_pack_start (GTK_BOX (main_vbox), source->priv->error_info_bar, FALSE, FALSE, 0); + +- /* password info bar */ +- source->priv->password_info_bar = gtk_info_bar_new (); +- password_info_bar_label = gtk_label_new (_("You must enter your password to listen to this station")); +- password_info_bar_content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (source->priv->password_info_bar)); +- gtk_container_add (GTK_CONTAINER (password_info_bar_content_area), password_info_bar_label); +- source->priv->password_info_bar_entry = gtk_entry_new (); +- gtk_entry_set_visibility (GTK_ENTRY (source->priv->password_info_bar_entry), FALSE); +- gtk_info_bar_add_action_widget (GTK_INFO_BAR (source->priv->password_info_bar), +- source->priv->password_info_bar_entry, +- GTK_RESPONSE_NONE); +- gtk_info_bar_add_button (GTK_INFO_BAR (source->priv->password_info_bar), GTK_STOCK_OK, GTK_RESPONSE_OK); +- g_signal_connect (source->priv->password_info_bar, +- "response", +- G_CALLBACK (password_info_bar_response_cb), +- source); +- gtk_box_pack_start (GTK_BOX (main_vbox), source->priv->password_info_bar, FALSE, FALSE, 0); +- + /* entry view */ + source->priv->track_view = rb_entry_view_new (db, G_OBJECT (shell_player), FALSE, FALSE); + rb_entry_view_append_column (source->priv->track_view, RB_ENTRY_VIEW_COL_TITLE, TRUE); +@@ -541,11 +493,6 @@ rb_audioscrobbler_radio_source_finalize (GObject *object) + g_free (source->priv->session_key); + g_free (source->priv->station_url); + +- g_free (source->priv->old_api_password); +- g_free (source->priv->old_api_session_id); +- g_free (source->priv->old_api_base_url); +- g_free (source->priv->old_api_base_path); +- + G_OBJECT_CLASS (rb_audioscrobbler_radio_source_parent_class)->finalize (object); + } + +@@ -691,7 +638,6 @@ tune (RBAudioscrobblerRadioSource *source) + + source->priv->is_busy = TRUE; + gtk_widget_hide (source->priv->error_info_bar); +- gtk_widget_hide (source->priv->password_info_bar); + + sig_arg = g_strdup_printf ("api_key%smethodradio.tunesk%sstation%s%s", + rb_audioscrobbler_service_get_api_key (source->priv->service), +@@ -772,44 +718,38 @@ tune_response_cb (SoupSession *session, + + rb_debug ("tune request responded with error: %s", message); + +- if (code == 4) { +- /* Our API key only allows streaming of radio to subscribers */ +- rb_debug ("attempting to use old API to tune radio"); +- old_api_tune (source); ++ /* show appropriate error message */ ++ char *error_message = NULL; ++ ++ if (code == 6) { ++ /* Invalid station url */ ++ error_message = g_strdup (_("Invalid station URL")); ++ } else if (code == 12) { ++ /* Subscriber only station */ ++ /* Translators: %s is the name of the audioscrobbler service, for example "Last.fm". ++ * This message indicates that to listen to this radio station the user needs to be ++ * a paying subscriber to the service. */ ++ error_message = g_strdup_printf (_("This station is only available to %s subscribers"), ++ rb_audioscrobbler_service_get_name (source->priv->service)); ++ } else if (code == 20) { ++ /* Not enough content */ ++ error_message = g_strdup (_("Not enough content to play station")); ++ } else if (code == 27) { ++ /* Deprecated station */ ++ /* Translators: %s is the name of the audioscrobbler service, for example "Last.fm". ++ * This message indicates that the service has deprecated this type of station. */ ++ error_message = g_strdup_printf (_("%s no longer supports this type of station"), ++ rb_audioscrobbler_service_get_name (source->priv->service)); + } else { +- /* show appropriate error message */ +- char *error_message = NULL; +- +- if (code == 6) { +- /* Invalid station url */ +- error_message = g_strdup (_("Invalid station URL")); +- } else if (code == 12) { +- /* Subscriber only station */ +- /* Translators: %s is the name of the audioscrobbler service, for example "Last.fm". +- * This message indicates that to listen to this radio station the user needs to be +- * a paying subscriber to the service. */ +- error_message = g_strdup_printf (_("This station is only available to %s subscribers"), +- rb_audioscrobbler_service_get_name (source->priv->service)); +- } else if (code == 20) { +- /* Not enough content */ +- error_message = g_strdup (_("Not enough content to play station")); +- } else if (code == 27) { +- /* Deprecated station */ +- /* Translators: %s is the name of the audioscrobbler service, for example "Last.fm". +- * This message indicates that the service has deprecated this type of station. */ +- error_message = g_strdup_printf (_("%s no longer supports this type of station"), +- rb_audioscrobbler_service_get_name (source->priv->service)); +- } else { +- /* Other error */ +- error_message = g_strdup_printf (_("Error tuning station: %i - %s"), code, message); +- } +- +- display_error_info_bar (source, error_message); +- +- g_free (error_message); +- +- source->priv->is_busy = FALSE; ++ /* Other error */ ++ error_message = g_strdup_printf (_("Error tuning station: %i - %s"), code, message); + } ++ ++ display_error_info_bar (source, error_message); ++ ++ g_free (error_message); ++ ++ source->priv->is_busy = FALSE; + } else { + rb_debug ("unexpected response from tune request: %s", msg->response_body->data); + display_error_info_bar(source, _("Error tuning station: unexpected response")); +@@ -1030,229 +970,6 @@ xspf_entry_parsed (TotemPlParser *parser, + } + + static void +-old_api_shake_hands (RBAudioscrobblerRadioSource *source) +-{ +- if (source->priv->old_api_password != NULL) { +- char *password_hash; +- char *msg_url; +- SoupMessage *msg; +- +- password_hash = g_compute_checksum_for_string (G_CHECKSUM_MD5, source->priv->old_api_password, -1); +- +- msg_url = g_strdup_printf ("%sradio/handshake.php?username=%s&passwordmd5=%s", +- rb_audioscrobbler_service_get_old_radio_api_url (source->priv->service), +- source->priv->username, +- password_hash); +- +- rb_debug ("sending old api handshake request: %s", msg_url); +- msg = soup_message_new ("GET", msg_url); +- soup_session_queue_message (source->priv->soup_session, +- msg, +- old_api_handshake_response_cb, +- source); +- +- g_free (password_hash); +- g_free (msg_url); +- } else { +-#ifdef WITH_GNOME_KEYRING +- GnomeKeyringResult result; +- char *password; +- +- rb_debug ("attempting to retrieve password from keyring"); +- result = gnome_keyring_find_password_sync (GNOME_KEYRING_NETWORK_PASSWORD, +- &password, +- "user", source->priv->username, +- "server", rb_audioscrobbler_service_get_name (source->priv->service), +- NULL); +- +- if (result == GNOME_KEYRING_RESULT_OK) { +- source->priv->old_api_password = g_strdup (password); +- rb_debug ("password found. shaking hands"); +- old_api_shake_hands (source); +- } else { +- rb_debug ("no password found"); +-#endif +- rb_debug ("cannot shake hands. asking user for password"); +- display_password_info_bar (source); +- source->priv->is_busy = FALSE; +-#ifdef WITH_GNOME_KEYRING +- } +-#endif +- } +-} +- +-static void +-old_api_handshake_response_cb (SoupSession *session, +- SoupMessage *msg, +- gpointer user_data) +-{ +- RBAudioscrobblerRadioSource *source; +- +- source = RB_AUDIOSCROBBLER_RADIO_SOURCE (user_data); +- +- if (msg->response_body->data == NULL) { +- g_free (source->priv->old_api_session_id); +- source->priv->old_api_session_id = NULL; +- rb_debug ("handshake failed: no response"); +- display_error_info_bar (source, _("Error tuning station: no response")); +- } else { +- char **pieces; +- int i; +- +- pieces = g_strsplit (msg->response_body->data, "\n", 0); +- for (i = 0; pieces[i] != NULL; i++) { +- gchar **values = g_strsplit (pieces[i], "=", 2); +- +- if (values[0] == NULL) { +- rb_debug ("unexpected response content: %s", pieces[i]); +- } else if (strcmp (values[0], "session") == 0) { +- if (strcmp (values[1], "FAILED") == 0) { +- g_free (source->priv->old_api_session_id); +- source->priv->old_api_session_id = NULL; +- +- rb_debug ("handshake failed: probably bad authentication. asking user for new password"); +- g_free (source->priv->old_api_password); +- source->priv->old_api_password = NULL; +- display_password_info_bar (source); +- } else { +- g_free (source->priv->old_api_session_id); +- source->priv->old_api_session_id = g_strdup (values[1]); +- rb_debug ("session ID: %s", source->priv->old_api_session_id); +- } +- } else if (strcmp (values[0], "base_url") == 0) { +- g_free (source->priv->old_api_base_url); +- source->priv->old_api_base_url = g_strdup (values[1]); +- rb_debug ("base url: %s", source->priv->old_api_base_url); +- } else if (strcmp (values[0], "base_path") == 0) { +- g_free (source->priv->old_api_base_path); +- source->priv->old_api_base_path = g_strdup (values[1]); +- rb_debug ("base path: %s", source->priv->old_api_base_path); +- } else if (strcmp (values[0], "banned") == 0) { +- if (strcmp (values[1], "0") != 0) { +- source->priv->old_api_is_banned = TRUE; +- } else { +- source->priv->old_api_is_banned = FALSE; +- } +- rb_debug ("banned: %i", source->priv->old_api_is_banned); +- } +- +- g_strfreev (values); +- } +- g_strfreev (pieces); +- } +- +- /* if handshake was successful then tune */ +- if (source->priv->old_api_session_id != NULL) { +- old_api_tune (source); +- } else { +- source->priv->is_busy = FALSE; +- } +-} +- +-static void +-old_api_tune (RBAudioscrobblerRadioSource *source) +-{ +- /* get a handshake first if we don't have one */ +- if (source->priv->old_api_session_id == NULL) { +- old_api_shake_hands (source); +- } else { +- char *escaped_station_url; +- char *msg_url; +- SoupMessage *msg; +- +- escaped_station_url = g_uri_escape_string (source->priv->station_url, NULL, FALSE); +- +- msg_url = g_strdup_printf("http://%s%s/adjust.php?session=%s&url=%s", +- source->priv->old_api_base_url, +- source->priv->old_api_base_path, +- source->priv->old_api_session_id, +- escaped_station_url); +- +- rb_debug ("sending old api tune request: %s", msg_url); +- msg = soup_message_new ("GET", msg_url); +- soup_session_queue_message (source->priv->soup_session, +- msg, +- old_api_tune_response_cb, +- source); +- +- g_free (escaped_station_url); +- g_free (msg_url); +- } +-} +- +-static void +-old_api_tune_response_cb (SoupSession *session, +- SoupMessage *msg, +- gpointer user_data) +-{ +- RBAudioscrobblerRadioSource *source; +- +- source = RB_AUDIOSCROBBLER_RADIO_SOURCE (user_data); +- +- if (msg->response_body->data != NULL) { +- char **pieces; +- int i; +- +- pieces = g_strsplit (msg->response_body->data, "\n", 0); +- for (i = 0; pieces[i] != NULL; i++) { +- gchar **values = g_strsplit (pieces[i], "=", 2); +- +- if (values[0] == NULL) { +- rb_debug ("unexpected response from old api tune request: %s", pieces[i]); +- } else if (strcmp (values[0], "response") == 0) { +- if (strcmp (values[1], "OK") == 0) { +- rb_debug ("old api tune request was successful"); +- /* no problems tuning, get the playlist */ +- old_api_fetch_playlist (source); +- } +- } else if (strcmp (values[0], "error") == 0) { +- char *error_message; +- rb_debug ("old api tune request responded with error: %s", pieces[i]); +- +- error_message = g_strdup_printf (_("Error tuning station: %s"), values[1]); +- +- +- g_free (error_message); +- +- source->priv->is_busy = FALSE; +- } +- /* TODO: do something with other information given here */ +- +- g_strfreev (values); +- } +- +- g_strfreev (pieces); +- } else { +- rb_debug ("no response from old api tune request"); +- display_error_info_bar (source, _("Error tuning station: no response")); +- source->priv->is_busy = FALSE; +- } +-} +- +-static void +-old_api_fetch_playlist (RBAudioscrobblerRadioSource *source) +-{ +- char *msg_url; +- SoupMessage *msg; +- +- msg_url = g_strdup_printf("http://%s%s/xspf.php?sk=%s&discovery=%i&desktop=%s", +- source->priv->old_api_base_url, +- source->priv->old_api_base_path, +- source->priv->old_api_session_id, +- 0, +- "1.5"); +- +- rb_debug ("sending old api playlist request: %s", msg_url); +- msg = soup_message_new ("GET", msg_url); +- soup_session_queue_message (source->priv->soup_session, +- msg, +- fetch_playlist_response_cb, +- source); +- +- g_free (msg_url); +-} +- +-static void + display_error_info_bar (RBAudioscrobblerRadioSource *source, + const char *message) + { +@@ -1261,46 +978,6 @@ display_error_info_bar (RBAudioscrobblerRadioSource *source, + gtk_widget_show_all (source->priv->error_info_bar); + } + +-static void +-display_password_info_bar (RBAudioscrobblerRadioSource *source) +-{ +- gtk_widget_show_all (source->priv->password_info_bar); +-} +- +-static void +-password_info_bar_response_cb (GtkInfoBar *info_bar, +- int response_id, +- RBAudioscrobblerRadioSource *source) +-{ +- gtk_widget_hide (source->priv->password_info_bar); +- +- g_free (source->priv->old_api_password); +- source->priv->old_api_password = g_strdup (gtk_entry_get_text (GTK_ENTRY (source->priv->password_info_bar_entry))); +- +-#ifdef WITH_GNOME_KEYRING +- /* save the new password */ +- char *password_desc; +- +- password_desc = g_strdup_printf (_("Password for streaming %s radio using the deprecated API"), +- rb_audioscrobbler_service_get_name (source->priv->service)); +- +- rb_debug ("saving password to keyring"); +- gnome_keyring_store_password_sync (GNOME_KEYRING_NETWORK_PASSWORD, +- GNOME_KEYRING_DEFAULT, +- password_desc, +- source->priv->old_api_password, +- "user", source->priv->username, +- "server", rb_audioscrobbler_service_get_name (source->priv->service), +- NULL); +- +- g_free (password_desc); +-#endif +- +- gtk_entry_set_text (GTK_ENTRY (source->priv->password_info_bar_entry), ""); +- +- old_api_shake_hands (source); +-} +- + static gboolean + impl_can_remove (RBDisplayPage *page) + { +diff --git a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.h b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.h +index f38d857..08bb4a0 100644 +--- a/plugins/audioscrobbler/rb-audioscrobbler-radio-source.h ++++ b/plugins/audioscrobbler/rb-audioscrobbler-radio-source.h +@@ -86,9 +86,6 @@ RBSource *rb_audioscrobbler_radio_source_new (RBAudioscrobblerProfilePage *paren + const char *station_name, + const char *station_url); + +-void rb_audioscrobbler_radio_source_set_old_api_password (RBAudioscrobblerRadioSource *source, +- const char *password); +- + G_END_DECLS + + #endif /* __RB_AUDIOSCROBBLER_RADIO_SOURCE_H */ +diff --git a/plugins/daap/Makefile.am b/plugins/daap/Makefile.am +index b950bef..f4bb907 100644 +--- a/plugins/daap/Makefile.am ++++ b/plugins/daap/Makefile.am +@@ -63,9 +63,9 @@ INCLUDES = \ + $(RHYTHMBOX_CFLAGS) \ + -D_BSD_SOURCE + +-if USE_GNOME_KEYRING +-libdaap_la_LIBADD += $(GNOME_KEYRING_LIBS) +-INCLUDES += $(GNOME_KEYRING_CFLAGS) ++if USE_LIBSECRET ++libdaap_la_LIBADD += $(LIBSECRET_LIBS) ++INCLUDES += $(LIBSECRET_CFLAGS) + endif + + gtkbuilderdir = $(plugindatadir) +diff --git a/plugins/daap/rb-daap-source.c b/plugins/daap/rb-daap-source.c +index fb034f9..75e0dc4 100644 +--- a/plugins/daap/rb-daap-source.c ++++ b/plugins/daap/rb-daap-source.c +@@ -35,8 +35,8 @@ + #include + #include + +-#ifdef WITH_GNOME_KEYRING +-#include ++#ifdef WITH_LIBSECRET ++#include + #endif + + #include "rhythmdb.h" +@@ -394,31 +394,36 @@ mount_op_reply_cb (GMountOperation *op, + AuthData *auth_data) + { + const char *password; +- gchar *keyring; +-#ifdef WITH_GNOME_KEYRING +- guint32 item_id; ++#ifdef WITH_LIBSECRET ++ gchar *label; ++ gchar *collection = NULL; + #endif + + rb_debug ("mount op reply: %d", result); + password = g_mount_operation_get_password (op); + +-#ifdef WITH_GNOME_KEYRING ++#ifdef WITH_LIBSECRET + switch (g_mount_operation_get_password_save (op)) { + case G_PASSWORD_SAVE_NEVER: + break; + + case G_PASSWORD_SAVE_FOR_SESSION: +- keyring = "session"; ++ collection = SECRET_COLLECTION_SESSION; + /* fall through */ + + case G_PASSWORD_SAVE_PERMANENTLY: +- gnome_keyring_set_network_password_sync (keyring, +- NULL, +- "DAAP", auth_data->name, +- NULL, "daap", +- NULL, 0, ++ label = g_strdup_printf ("Rhythmbox DAAP password for %s", auth_data->name); ++ secret_password_store_sync (SECRET_SCHEMA_COMPAT_NETWORK, ++ collection, ++ label, + password, +- &item_id); ++ NULL, ++ NULL, ++ "domain", "DAAP", ++ "server", auth_data->name, ++ "protocol", "daap", ++ NULL); ++ g_free (label); + break; + + default: +@@ -443,7 +448,11 @@ mount_op_reply_cb (GMountOperation *op, + } + + static void +-ask_password (RBDAAPSource *source, const char *name, const char *keyring, SoupSession *session, SoupMessage *msg, SoupAuth *auth) ++ask_password (RBDAAPSource *source, ++ const char *name, ++ SoupSession *session, ++ SoupMessage *msg, ++ SoupAuth *auth) + { + GtkWindow *parent; + GMountOperation *mount_op; +@@ -465,10 +474,8 @@ ask_password (RBDAAPSource *source, const char *name, const char *keyring, SoupS + g_signal_connect (mount_op, "reply", G_CALLBACK (mount_op_reply_cb), auth_data); + + flags = G_ASK_PASSWORD_NEED_PASSWORD; +-#ifdef WITH_GNOME_KEYRING +- if (gnome_keyring_is_available ()) { +- flags |= G_ASK_PASSWORD_SAVING_SUPPORTED; +- } ++#ifdef WITH_LIBSECRET ++ flags |= G_ASK_PASSWORD_SAVING_SUPPORTED; + #endif + message = g_strdup_printf (_("The music share '%s' requires a password to connect"), name); + g_signal_emit_by_name (mount_op, "ask-password", message, NULL, "DAAP", flags); +@@ -485,44 +492,31 @@ connection_auth_cb (DMAPConnection *connection, + RBDAAPSource *source) + { + gchar *password = NULL; +-#ifdef WITH_GNOME_KEYRING +- GnomeKeyringResult keyringret; +- gchar *keyring; +- GList *list = NULL; ++#ifdef WITH_LIBSECRET ++ GError *error = NULL; + +- keyring = NULL; + if (!source->priv->tried_password) { +- gnome_keyring_get_default_keyring_sync (&keyring); +- keyringret = gnome_keyring_find_network_password_sync ( +- NULL, +- "DAAP", name, +- NULL, "daap", +- NULL, 0, &list); +- } else { +- keyringret = GNOME_KEYRING_RESULT_CANCELLED; ++ password = secret_password_lookup_sync (SECRET_SCHEMA_COMPAT_NETWORK, ++ NULL, &error, ++ "domain", "DAAP", ++ "server", name, ++ "protocol", "daap", ++ NULL); + } + +- if (keyringret == GNOME_KEYRING_RESULT_OK) { +- GnomeKeyringNetworkPasswordData *pwd_data; +- +- if (list != NULL) { +- pwd_data = (GnomeKeyringNetworkPasswordData*)list->data; +- password = g_strdup (pwd_data->password); +- } ++ if (!error) + source->priv->tried_password = TRUE; +- } ++ else ++ g_error_free (error); + + if (password == NULL) { +- ask_password (source, name, keyring, session, msg, auth); ++ ask_password (source, name, session, msg, auth); + } else { + dmap_connection_authenticate_message (connection, session, msg, auth, password); + } + +- if (list) +- gnome_keyring_network_password_list_free (list); +- g_free (keyring); + #else +- ask_password (source, name, NULL, session, msg, auth); ++ ask_password (source, name, session, msg, auth); + #endif + } + +diff --git a/plugins/magnatune/MagnatuneAccount.py b/plugins/magnatune/MagnatuneAccount.py +index f8cf81b..93b04c9 100644 +--- a/plugins/magnatune/MagnatuneAccount.py ++++ b/plugins/magnatune/MagnatuneAccount.py +@@ -1,4 +1,5 @@ + # -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- ++# vim: set sts=0 ts=8 sw=8 tw=0 noet : + # + # Copyright (C) 2012 Jonathan Matthew + # +@@ -24,10 +25,25 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + +-from gi.repository import Gio, GnomeKeyring ++from gi.repository import Gio ++ ++# Till libsecret completely replaces gnome-keyring, we'll fall back to not ++# saving the password if libsecret can't be found. This code can be removed later. ++try: ++ from gi.repository import Secret, SecretUnstable ++ # We need to be able to fetch passwords stored by libgnome-keyring, so we use ++ # a schema with SECRET_SCHEMA_DONT_MATCH_NAME set. ++ # See: http://developer.gnome.org/libsecret/unstable/migrating-schemas.html ++ MAGNATUNE_SCHEMA = Secret.Schema.new("org.gnome.rhythmbox.plugins.magnatune", ++ Secret.SchemaFlags.DONT_MATCH_NAME, ++ {"rhythmbox-plugin": Secret.SchemaAttributeType.STRING}) ++except ImportError: ++ Secret = None ++ print ("You need to install libsecret and its introspection files to store your Magnatune password") + + __instance = None + ++ + def instance(): + global __instance + if __instance is None: +@@ -36,54 +52,48 @@ def instance(): + + class MagnatuneAccount(object): + def __init__(self): +- self.keyring_item = None + self.settings = Gio.Settings("org.gnome.rhythmbox.plugins.magnatune") +- +- self.keyring_attributes = GnomeKeyring.attribute_list_new() +- GnomeKeyring.attribute_list_append_string(self.keyring_attributes, +- "rhythmbox-plugin", +- "magnatune") +- (result, items) = GnomeKeyring.find_items_sync(GnomeKeyring.ItemType.GENERIC_SECRET, +- self.keyring_attributes) +- if result == GnomeKeyring.Result.OK and len(items) != 0: +- (result, item) = GnomeKeyring.item_get_info_sync(None, items[0].item_id) +- if result == GnomeKeyring.Result.OK: +- self.keyring_item = item +- else: +- print "Couldn't get keyring item: " + GnomeKeyring.result_to_message(result) +- else: +- print "couldn't search keyring items: " + GnomeKeyring.result_to_message(result) ++ self.secret = None ++ self.keyring_attributes = {"rhythmbox-plugin": "magnatune"} ++ if Secret is None: ++ print ("Account details will not be saved because libsecret was not found") ++ return ++ # Haha. ++ self.secret_service = SecretUnstable.Service.get_sync(SecretUnstable.ServiceFlags.OPEN_SESSION, None) ++ items = self.secret_service.search_sync(MAGNATUNE_SCHEMA, ++ self.keyring_attributes, ++ SecretUnstable.SearchFlags.LOAD_SECRETS, ++ None) ++ if not items: ++ # The Python API doesn't seem to have a way to differentiate between errors and no results. ++ print ("Couldn't find an existing keyring entry") ++ return ++ self.secret = items[0].get_secret().get() + + def get(self): +- if self.keyring_item is None: ++ if self.secret is None: + return ('none', None, None) + + account_type = self.settings['account-type'] + try: +- (username, password) = self.keyring_item.get_secret().split("\n") ++ (username, password) = self.secret.split("\n") + return (account_type, username, password) + except ValueError: + return ('none', None, None) + + def update(self, username, password): + secret = '\n'.join((username, password)) +- if self.keyring_item is not None: +- if secret == self.keyring_item.get_secret(): +- print "account details not changed" +- return +- +- (result, id) = GnomeKeyring.item_create_sync(None, +- GnomeKeyring.ItemType.GENERIC_SECRET, +- "Rhythmbox: Magnatune account information", +- self.keyring_attributes, +- secret, +- True) +- if result == GnomeKeyring.Result.OK: +- if self.keyring_item is None: +- (result, item) = GnomeKeyring.item_get_info_sync(None, id) +- if result == GnomeKeyring.Result.OK: +- self.keyring_item = item +- else: +- print "couldn't fetch keyring itme: " + GnomeKeyring.result_to_message(result) +- else: +- print "couldn't create keyring item: " + GnomeKeyring.result_to_message(result) ++ if secret == self.secret: ++ print ("Account details not changed") ++ return ++ self.secret = secret ++ if Secret is None: ++ print ("Account details were not saved because libsecret was not found") ++ return ++ result = Secret.password_store_sync(MAGNATUNE_SCHEMA, ++ self.keyring_attributes, ++ Secret.COLLECTION_DEFAULT, ++ "Rhythmbox: Magnatune account information", ++ secret, None) ++ if not result: ++ print ("Couldn't create keyring item!") +-- +1.7.12.4 + diff --git a/media-sound/rhythmbox/metadata.xml b/media-sound/rhythmbox/metadata.xml new file mode 100644 index 0000000000000000000000000000000000000000..dea4b57b4917426985676b4526bac1ecc277c390 --- /dev/null +++ b/media-sound/rhythmbox/metadata.xml @@ -0,0 +1,23 @@ + + + + gnome + gstreamer + + Build the visualizer plugin which uses + media-libs/clutter and x11-libs/mx + Allow the im-status plugin to set the status of your IM + clients using dev-python/dbus-python + Build the local network music sharing plugin which uses + the DAAP protocol using net-libs/libdmapsharing + Build a plugin for Last.fm and Librefm scrobbling + Use net-libs/webkit-gtk for detecting and + displaying HTML podcast episode descriptions. + Enable hardware detection via sys-fs/udev + replacing the deprecated sys-apps/hal code + Build a plugin for local network music sharing which uses + UPnP protocols using media-video/coherence, + dev-python/louie, and dev-python/twisted + Enable context panel plugin + + diff --git a/media-sound/rhythmbox/rhythmbox-9999.ebuild b/media-sound/rhythmbox/rhythmbox-9999.ebuild new file mode 100644 index 0000000000000000000000000000000000000000..c7fc2d443d2eab7ea6e7516654877f92cf9199fd --- /dev/null +++ b/media-sound/rhythmbox/rhythmbox-9999.ebuild @@ -0,0 +1,172 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="4" +GNOME2_LA_PUNT="yes" +PYTHON_DEPEND="python? 2:2.5" +PYTHON_USE_WITH="xml" +PYTHON_USE_WITH_OPT="python" + +inherit eutils gnome2 python multilib virtualx +if [[ ${PV} = 9999 ]]; then + inherit gnome2-live +fi + +DESCRIPTION="Music management and playback software for GNOME" +HOMEPAGE="http://www.rhythmbox.org/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="cdr daap dbus doc +keyring html ipod libnotify lirc mtp nsplugin +python +test +udev upnp-av visualizer webkit zeitgeist" +if [[ ${PV} = 9999 ]]; then + KEYWORDS="" +else + KEYWORDS="~amd64 ~x86" +fi + +REQUIRED_USE=" + ipod? ( udev ) + mtp? ( udev ) + dbus? ( python ) + webkit? ( python )" + +# FIXME: double check what to do with fm-radio plugin +# webkit-gtk-1.10 is needed because it uses gstreamer-1.0 +COMMON_DEPEND=">=dev-libs/glib-2.32.0:2 + dev-libs/json-glib + >=dev-libs/libxml2-2.7.8:2 + >=x11-libs/gtk+-3.6:3[introspection] + >=x11-libs/gdk-pixbuf-2.18.0:2 + >=dev-libs/gobject-introspection-0.10.0 + >=dev-libs/libpeas-0.7.3[gtk,python?] + >=dev-libs/totem-pl-parser-3.2.0 + >=net-libs/libsoup-2.26:2.4 + >=net-libs/libsoup-gnome-2.26:2.4 + >=media-libs/gst-plugins-base-0.11.92:1.0[introspection] + >=media-libs/gstreamer-0.11.92:1.0[introspection] + >=sys-libs/tdb-1.2.6 + + visualizer? ( + >=media-libs/clutter-1.8:1.0 + >=media-libs/clutter-gst-1.9.92:2.0 + >=media-libs/clutter-gtk-1.0:1.0 + >=x11-libs/mx-1.0.1:1.0 + media-plugins/gst-plugins-libvisual:1.0 ) + cdr? ( >=app-cdr/brasero-2.91.90 ) + daap? ( + >=net-libs/libdmapsharing-2.9.16:3.0 + >=net-dns/avahi-0.6 + media-plugins/gst-plugins-soup:1.0 ) + keyring? ( >=app-crypt/libsecret-0.14 ) + html? ( >=net-libs/webkit-gtk-1.10:3 ) + libnotify? ( >=x11-libs/libnotify-0.7.0 ) + lirc? ( app-misc/lirc ) + python? ( >=dev-python/pygobject-3.0:3 ) + udev? ( + virtual/udev[gudev] + ipod? ( >=media-libs/libgpod-0.7.92[udev] ) + mtp? ( >=media-libs/libmtp-0.3 ) ) + zeitgeist? ( gnome-extra/zeitgeist ) +" +RDEPEND="${COMMON_DEPEND} + media-plugins/gst-plugins-soup:1.0 + media-plugins/gst-plugins-libmms:1.0 + || ( + media-plugins/gst-plugins-cdparanoia:1.0 + media-plugins/gst-plugins-cdio:1.0 ) + media-plugins/gst-plugins-meta:1.0 + media-plugins/gst-plugins-taglib:1.0 + x11-themes/gnome-icon-theme-symbolic + upnp-av? ( + >=media-libs/grilo-0.2:0.2 + >=media-plugins/grilo-plugins-0.2:0.2[upnp-av] ) + python? ( + x11-libs/gdk-pixbuf:2[introspection] + x11-libs/gtk+:3[introspection] + x11-libs/pango[introspection] + + dbus? ( sys-apps/dbus ) + keyring? ( >=app-crypt/libsecret-0.14[introspection] ) + webkit? ( + dev-python/mako + >=net-libs/webkit-gtk-1.10:3[introspection] ) ) +" +# gtk-doc-am needed for eautoreconf +# dev-util/gtk-doc-am +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig + app-text/yelp-tools + >=dev-util/intltool-0.35 + >=app-text/gnome-doc-utils-0.9.1 + doc? ( >=dev-util/gtk-doc-1.4 ) + test? ( dev-libs/check )" +DOCS="AUTHORS ChangeLog DOCUMENTERS INTERNALS \ + MAINTAINERS MAINTAINERS.old NEWS README THANKS" + +pkg_setup() { + if use python; then + python_set_active_version 2 + python_pkg_setup + G2CONF="${G2CONF} PYTHON=$(PYTHON -2)" + fi + + # --enable-vala just installs the sample vala plugin, and the configure + # checks are broken, so don't enable it + G2CONF="${G2CONF} + MOZILLA_PLUGINDIR=/usr/$(get_libdir)/nsbrowser/plugins + --enable-mmkeys + --disable-more-warnings + --disable-schemas-compile + --disable-static + --disable-vala + --without-hal + $(use_enable visualizer) + $(use_enable daap) + $(use_enable libnotify) + $(use_enable lirc) + $(use_enable nsplugin browser-plugin) + $(use_enable python) + $(use_enable upnp-av grilo) + $(use_with cdr brasero) + $(use_with daap mdns avahi) + $(use_with keyring libsecret) + $(use_with html webkit) + $(use_with ipod) + $(use_with mtp) + $(use_with udev gudev)" + + export GST_INSPECT=/bin/true +} + +src_prepare() { + gnome2_src_prepare + # https://bugzilla.gnome.org/show_bug.cgi?id=694981 + epatch "${FILESDIR}/${PN}-port-to-libsecret.patch" + echo > py-compile +} + +src_test() { + unset SESSION_MANAGER + unset DBUS_SESSION_BUS_ADDRESS + Xemake check || die "test failed" +} + +pkg_postinst() { + gnome2_pkg_postinst + if use python; then + python_need_rebuild + python_mod_optimize /usr/$(get_libdir)/rhythmbox/plugins + fi + + ewarn + ewarn "If ${PN} doesn't play some music format, please check your" + ewarn "USE flags on media-plugins/gst-plugins-meta:1.0" + ewarn +} + +pkg_postrm() { + gnome2_pkg_postrm + python_mod_cleanup /usr/$(get_libdir)/rhythmbox/plugins +}