diff options
-rw-r--r-- | media-sound/gmpc/ChangeLog | 9 | ||||
-rw-r--r-- | media-sound/gmpc/files/gmpc-0.18.0-libxspf.patch | 243 | ||||
-rw-r--r-- | media-sound/gmpc/gmpc-0.18.0-r1.ebuild (renamed from media-sound/gmpc/gmpc-0.18.0.ebuild) | 21 | ||||
-rw-r--r-- | media-sound/gmpc/metadata.xml | 2 |
4 files changed, 264 insertions, 11 deletions
diff --git a/media-sound/gmpc/ChangeLog b/media-sound/gmpc/ChangeLog index 466aec4e68b8..107d320ea95e 100644 --- a/media-sound/gmpc/ChangeLog +++ b/media-sound/gmpc/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for media-sound/gmpc # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/gmpc/ChangeLog,v 1.57 2009/03/20 15:44:58 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/gmpc/ChangeLog,v 1.58 2009/05/23 19:41:24 ssuominen Exp $ + +*gmpc-0.18.0-r1 (23 May 2009) + + 23 May 2009; Samuli Suominen <ssuominen@gentoo.org> -gmpc-0.18.0.ebuild, + +gmpc-0.18.0-r1.ebuild, +files/gmpc-0.18.0-libxspf.patch, metadata.xml: + Thanks to amateja from PLD Linux chatroom at Freenode for helping me out + porting gmpc to libxspf from libspiff. 20 Mar 2009; Raúl Porcel <armin76@gentoo.org> gmpc-0.17.0.ebuild: x86 stable wrt #259793 diff --git a/media-sound/gmpc/files/gmpc-0.18.0-libxspf.patch b/media-sound/gmpc/files/gmpc-0.18.0-libxspf.patch new file mode 100644 index 000000000000..761d28b1ebde --- /dev/null +++ b/media-sound/gmpc/files/gmpc-0.18.0-libxspf.patch @@ -0,0 +1,243 @@ +diff -ur gmpc-0.18.0.orig/configure.ac gmpc-0.18.0/configure.ac +--- gmpc-0.18.0.orig/configure.ac 2009-03-09 18:23:10.000000000 +0200 ++++ gmpc-0.18.0/configure.ac 2009-05-23 22:33:14.000000000 +0300 +@@ -63,34 +63,30 @@ + AC_MSG_ERROR([GMPC plugin requires zlib]) + fi + ++PKG_PROG_PKG_CONFIG + +-libspiff=0; ++libxspf=0; + +-AC_ARG_ENABLE(libspiff, +- [ --enable-libspiff Use libspiff to parse spiff playlists.], ++AC_ARG_ENABLE(libxspf, ++ [ --enable-libxspf Use libxspf to parse XSPF playlists.], + [ case "${enableval}" in +- yes) enable_libspiff=yes;; +- no) enable_libspiff=no;; +- *) AC_MSG_ERROR([bad value ${enableval} for --enable-libspiff]);; ++ yes) enable_libxspf=yes;; ++ no) enable_libxspf=no;; ++ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libxspf]);; + esac], +- [enable_libspiff=auto]) ++ [enable_libxspf=auto]) + +-if test "x${enable_libspiff}" != xno; then +- AC_CHECK_HEADER(spiff/spiff_c.h, AC_CHECK_LIB(spiff, spiff_parse,libspiff=1,libspiff=0),libspiff=0) +- if test "x${libspiff}" == "x1"; +- then +- AC_DEFINE(SPIFF,1,["Use or don't use libspiff"]) +- SPIFF_LIBS=-lspiff +- AC_SUBST(SPIFF_LIBS) +- else +- if test "x${enable_libspiff}" == "xyes"; then +- AC_MSG_ERROR([libspiff not found]) +- fi +- fi ++if test "x${enable_libxspf}" != xno; then ++ PKG_CHECK_MODULES([xspf], [xspf], [ ++ AC_DEFINE(XSPF,1,["Use or don't use libxspf"]) ++ libxspf=1 ++ ], [ ++ if test "x${enable_libxspf}" = "xyes"; then ++ AC_MSG_ERROR([libxspf not found]) ++ fi]) + fi +- +-PKG_PROG_PKG_CONFIG +- ++AC_SUBST(xspf_LIBS) ++AC_SUBST(xspf_CFLAGS) + + # Checks for header files. + AC_HEADER_STDC +@@ -475,10 +471,10 @@ + else + echo "Use mac integration library: disabled" + fi +-if test "x$libspiff" = "x1"; then +- echo "Use libspiff library: enabled" ++if test "x$libxspf" = "x1"; then ++ echo "Use libxspf library: enabled" + else +- echo "Use libspiff library: disabled" ++ echo "Use libxspf library: disabled" + fi + echo ""; + echo "Now type make to build" +diff -ur gmpc-0.18.0.orig/src/Makefile.am gmpc-0.18.0/src/Makefile.am +--- gmpc-0.18.0.orig/src/Makefile.am 2009-03-09 18:23:05.000000000 +0200 ++++ gmpc-0.18.0/src/Makefile.am 2009-05-23 22:33:14.000000000 +0300 +@@ -97,7 +97,7 @@ + @libglade_LIBS@\ + @gthread_LIBS@\ + @libsoup_LIBS@\ +- @SPIFF_LIBS@\ ++ @xspf_LIBS@\ + @sm_LIBS@ + + if USE_SYSTEM_LIBSEXY +@@ -126,6 +126,7 @@ + @gthread_CFLAGS@\ + @sm_CFLAGS@\ + @libsoup_CFLAGS@\ ++ @xspf_CFLAGS@\ + @EXTRA_CFLAGS@\ + -DPACKAGE_LIB_DIR=\""$(pkglibdir)"\"\ + -DPACKAGE_DATA_DIR=\""$(datarootdir)"\" +diff -ur gmpc-0.18.0.orig/src/url_fetcher.c gmpc-0.18.0/src/url_fetcher.c +--- gmpc-0.18.0.orig/src/url_fetcher.c 2009-03-09 18:23:05.000000000 +0200 ++++ gmpc-0.18.0/src/url_fetcher.c 2009-05-23 22:33:14.000000000 +0300 +@@ -25,8 +25,8 @@ + #include "playlist3.h" + #include "gmpc_easy_download.h" + +-#ifdef SPIFF +-#include <spiff/spiff_c.h> ++#ifdef XSPF ++#include <xspf_c.h> + #endif + /** in gmpc */ + void pl3_option_menu_activate(); +@@ -89,73 +89,57 @@ + } + } + /*** +- * parse spiff file ++ * parse XSPF file + */ +-static void url_parse_spiff_file(const char *data, int size) ++static void url_parse_xspf_file(const char *data, int size, const char *uri) + { +-#ifdef SPIFF ++#ifdef XSPF + int songs= 0; +- const gchar *tempdir = g_get_tmp_dir(); +- gchar *filename = g_build_filename(tempdir, "gmpc-temp-spiff-file",NULL); +- if(filename) +- { +- GError *error = NULL; +- int has_http = FALSE, has_file = FALSE; +- char **handlers = mpd_server_get_url_handlers(connection); +- int i = 0; +- for (i = 0; handlers && handlers[i]; i++) { +- if (strcmp(handlers[i], "http://") == 0) { +- has_http = TRUE; +- } else if (strcmp(handlers[i], "file://") == 0) { +- has_file = TRUE; +- } +- } +- if (handlers) +- g_strfreev(handlers); +- +- g_file_set_contents(filename, data,(gssize)size, &error); +- if(!error) +- { +- struct spiff_track *strack; +- struct spiff_mvalue *sloc; +- struct spiff_list *slist = spiff_parse(filename); +- if (slist != NULL) +- { +- SPIFF_LIST_FOREACH_TRACK(slist, strack) { +- SPIFF_TRACK_FOREACH_LOCATION(strack, sloc) { +- char *scheme = g_uri_parse_scheme(sloc->value); +- if(scheme) +- { +- debug_printf(DEBUG_INFO, "Trying to add url: %s", sloc->value); +- if(strcmp(scheme, "http") == 0 && has_http) +- { +- mpd_playlist_add(connection, sloc->value); +- songs++; +- } +- else if(strcmp(scheme, "file") == 0 && has_file) +- { +- mpd_playlist_add(connection, sloc->value); +- songs++; +- } +- g_free(scheme); +- } +- else{ +- debug_printf(DEBUG_ERROR, "Failed to parse scheme: %s",sloc->value); +- } +- } +- } +- spiff_free(slist); +- } +- g_unlink(filename); +- } +- else +- { +- debug_printf(DEBUG_ERROR, "Error message: %s", error->message); +- g_error_free(error); +- } ++ GError *error = NULL; ++ int has_http = FALSE, has_file = FALSE; ++ char **handlers = mpd_server_get_url_handlers(connection); ++ int i = 0; ++ for (i = 0; handlers && handlers[i]; i++) { ++ if (strcmp(handlers[i], "http://") == 0) { ++ has_http = TRUE; ++ } else if (strcmp(handlers[i], "file://") == 0) { ++ has_file = TRUE; ++ } ++ } ++ if (handlers) ++ g_strfreev(handlers); ++ ++ struct xspf_track *strack; ++ struct xspf_mvalue *sloc; ++ struct xspf_list *slist = xspf_parse_memory(data, (int)size, uri); ++ if (slist != NULL) ++ { ++ XSPF_LIST_FOREACH_TRACK(slist, strack) { ++ XSPF_TRACK_FOREACH_LOCATION(strack, sloc) { ++ char *scheme = g_uri_parse_scheme(sloc->value); ++ if(scheme) ++ { ++ debug_printf(DEBUG_INFO, "Trying to add url: %s", sloc->value); ++ if(strcmp(scheme, "http") == 0 && has_http) ++ { ++ mpd_playlist_add(connection, sloc->value); ++ songs++; ++ } ++ else if(strcmp(scheme, "file") == 0 && has_file) ++ { ++ mpd_playlist_add(connection, sloc->value); ++ songs++; ++ } ++ g_free(scheme); ++ } ++ else{ ++ debug_printf(DEBUG_ERROR, "Failed to parse scheme: %s",sloc->value); ++ } ++ } ++ } ++ xspf_free(slist); ++ } + +- g_free(filename); +- } + if (songs) { + char *string = g_strdup_printf(_("Added %i %s"), songs, ngettext("stream", "streams", songs)); + pl3_push_statusbar_message(string); +@@ -164,7 +148,7 @@ + + + #else +- debug_printf(DEBUG_ERROR, "Spiff not supported, install libspiff"); ++ debug_printf(DEBUG_ERROR, "XSPF playlist not supported, install libxspf"); + #endif + } + +@@ -220,7 +204,7 @@ + else if (!strncasecmp(data, "<?xml", 5)) { + debug_printf(DEBUG_INFO, "Detected a xml file, might be xspf"); + /* This might just be a xspf file */ +- url_parse_spiff_file(data, size); ++ url_parse_xspf_file(data, size, text); + } + /** pls file: */ + else if (!strncasecmp(data, "[playlist]", 10)) { diff --git a/media-sound/gmpc/gmpc-0.18.0.ebuild b/media-sound/gmpc/gmpc-0.18.0-r1.ebuild index 32120a805a64..8e841aa66073 100644 --- a/media-sound/gmpc/gmpc-0.18.0.ebuild +++ b/media-sound/gmpc/gmpc-0.18.0-r1.ebuild @@ -1,10 +1,9 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/gmpc/gmpc-0.18.0.ebuild,v 1.2 2009/03/15 08:38:43 angelos Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/gmpc/gmpc-0.18.0-r1.ebuild,v 1.1 2009/05/23 19:41:24 ssuominen Exp $ -EAPI=1 - -inherit gnome2-utils +EAPI=2 +inherit autotools eutils gnome2-utils DESCRIPTION="A GTK+2 client for the Music Player Daemon" HOMEPAGE="http://gmpcwiki.sarine.nl/index.php/GMPC" @@ -13,7 +12,7 @@ SRC_URI="mirror://sourceforge/musicpd/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~sparc ~x86" -IUSE="nls session spiff" +IUSE="nls session xspf" RDEPEND=">=dev-libs/glib-2.10:2 dev-perl/XML-Parser @@ -24,20 +23,24 @@ RDEPEND=">=dev-libs/glib-2.10:2 >=x11-libs/gtk+-2.12:2 x11-libs/libsexy session? ( x11-libs/libSM ) - spiff? ( media-libs/libspiff )" + xspf? ( >=media-libs/libxspf-1.2 )" DEPEND="${RDEPEND} dev-util/gob dev-util/intltool dev-util/pkgconfig sys-devel/gettext" -src_compile() { +src_prepare() { + epatch "${FILESDIR}"/${P}-libxspf.patch + eautoreconf +} + +src_configure() { econf \ $(use_enable session sm) \ - $(use_enable spiff libspiff) \ + $(use_enable xspf libxspf) \ --enable-system-libsexy \ --disable-shave - emake || die "emake failed" } src_install() { diff --git a/media-sound/gmpc/metadata.xml b/media-sound/gmpc/metadata.xml index ec34307f13ad..35e639abbdcf 100644 --- a/media-sound/gmpc/metadata.xml +++ b/media-sound/gmpc/metadata.xml @@ -7,6 +7,6 @@ <name>Christoph Mende</name> </maintainer> <use> - <flag name='spiff'>Use libspiff to parse XSPF playlists</flag> + <flag name='xspf'>Enable support for reading and saving XSPF playlists</flag> </use> </pkgmetadata> |