ports/165747: [PATCH] audio/tcd: Remove musicbrainz support
Jason E. Hale
bsdkaffee at gmail.com
Mon Mar 5 20:40:09 UTC 2012
>Number: 165747
>Category: ports
>Synopsis: [PATCH] audio/tcd: Remove musicbrainz support
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 05 20:40:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Jason E. Hale
>Release: FreeBSD 9.0-RELEASE i386
>Organization:
none
>Environment:
System: FreeBSD mocha.verizon.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Thu Jan 19 11:42:41 EST 2012 Jason at mocha.verizon.net:/usr/obj/usr/src/sys/MOCHA9 i386
>Description:
- Remove audio/libmusicbrainz support from audio/tcd
- audio/libmusicbrainz is deprecated as the MusicBrainz RDF webservice is no
longer functional
>How-To-Repeat:
- Use attached diff
- Remove files/patch-tcd_mb.c
- Remove files/patch-tcd_mb.h
>Fix:
--- 2012-03-05-tcd.diff begins here ---
diff -ruN tcd.orig/Makefile tcd/Makefile
--- tcd.orig/Makefile 2012-03-05 13:32:10.000000000 -0500
+++ tcd/Makefile 2012-03-05 13:33:13.000000000 -0500
@@ -7,7 +7,7 @@
PORTNAME= tcd
PORTVERSION= 2.2.0
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -15,25 +15,10 @@
MAINTAINER= gahr at FreeBSD.org
COMMENT= A simple, user-friendly ncurses-based CD player
-OPTIONS= MUSICBRAINZ "Enable experimental MusicBrainz support" OFF
-
USE_SDL= sdl
GNU_CONFIGURE= yes
MAN1= tcd.1
PLIST_FILES= bin/tcd
-.include <bsd.port.pre.mk>
-
-.if defined(WITH_MUSICBRAINZ)
-LIB_DEPENDS= musicbrainz.4:${PORTSDIR}/audio/libmusicbrainz
-CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib \
- -DUSE_MUSICBRAINZ -lmusicbrainz -ggdb
-post-patch:
- ${REINPLACE_CMD} -e 's|tcd_SOURCES = |tcd_SOURCES = tcd_mb.c tcd_mb.h |' \
- ${WRKSRC}/src/Makefile.am ${WRKSRC}/src/Makefile.in
- ${REINPLACE_CMD} -e 's|am_tcd_OBJECTS = |am_tcd_OBJECTS = tcd_mb.$$(OBJEXT) |' \
- ${WRKSRC}/src/Makefile.in
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -ruN tcd.orig/files/patch-cddb.c tcd/files/patch-cddb.c
--- tcd.orig/files/patch-cddb.c 2012-03-05 13:32:10.000000000 -0500
+++ tcd/files/patch-cddb.c 2012-03-05 13:42:36.000000000 -0500
@@ -1,16 +1,6 @@
---- src/cddb.c.orig 2004-06-15 23:20:09.000000000 +0200
-+++ src/cddb.c 2008-06-26 20:15:03.000000000 +0200
-@@ -39,6 +39,9 @@
-
- #include "cd-utils.h"
- #include "cddb.h"
-+#ifdef USE_MUSICBRAINZ
-+# include "tcd_mb.h"
-+#endif
- #include "concat-strings.h"
-
- static void append_data(char *dest, const char *data, size_t maxlen)
-@@ -229,12 +232,19 @@
+--- ./src/cddb.c.orig 2004-06-15 17:20:09.000000000 -0400
++++ ./src/cddb.c 2012-03-05 13:42:25.000000000 -0500
+@@ -229,10 +229,11 @@
return concat_strings(get_home_dir(), "/.tcd/", cd_id, NULL);
}
@@ -22,12 +12,4 @@
+ struct cd_info *cd = &cds->cd_info;
result = 0;
-+
-+#ifdef USE_MUSICBRAINZ
-+ if (!tcd_readmb(cds, cdrom))
-+ return result;
-+#endif
-+
if ((filename = cddb_filename(cddb_discid(cdrom))) != NULL) {
- result = tcd_readcddb(cd, cdrom, filename);
- free(filename);
diff -ruN tcd.orig/files/patch-tcd_mb.c tcd/files/patch-tcd_mb.c
--- tcd.orig/files/patch-tcd_mb.c 2012-03-05 13:32:10.000000000 -0500
+++ tcd/files/patch-tcd_mb.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,101 +0,0 @@
---- /dev/null 2008-06-26 21:42:58.000000000 +0200
-+++ src/tcd_mb.c 2008-06-26 21:43:09.000000000 +0200
-@@ -0,0 +1,98 @@
-+/*-
-+ * Copyright (c) 2008 Pietro Cerutti <gahr at FreeBSD.org>
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 3. All advertising materials mentioning features or use of this software
-+ * must display the following acknowledgement:
-+ * This product includes software developed by the University of
-+ * California, Berkeley and its contributors.
-+ * 4. Neither the name of the University nor the names of its contributors
-+ * may be used to endorse or promote products derived from this software
-+ * without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#include "tcd_mb.h"
-+#include <musicbrainz/mb_c.h>
-+
-+int
-+tcd_readmb(struct tcd_state *cd, SDL_CD *cdrom)
-+{
-+ int nof_cds; /* Can handle only one at the moment */
-+ char *cd_title;
-+ static char tmp_buff[256] = { 0 };
-+ size_t len;
-+ musicbrainz_t mb;
-+
-+ /*
-+ * Sanity check
-+ */
-+ if(!cd || !cdrom)
-+ return (1);
-+
-+ /*
-+ * Initialize
-+ */
-+ cd_title = cd->cd_info.disc_title;
-+ mb = mb_New();
-+ mb_SetServer(mb, MB_HOST, MB_PORT);
-+ mb_SetDevice(mb, SDL_CDName(cd->current_discid));
-+ if (!mb_Query(mb, MBQ_GetCDInfo)) {
-+ mb_GetQueryError(mb, tmp_buff, sizeof(tmp_buff));
-+ fprintf(stderr, "MusicBrainz error: %s\n", tmp_buff);
-+ return (1);
-+ }
-+
-+ /*
-+ * Query
-+ */
-+ nof_cds = mb_GetResultInt(mb, MBE_GetNumAlbums);
-+ if(nof_cds != 1) {
-+ fprintf(stderr, "MusicBrainz error: %sCD%s found\n",
-+ !nof_cds ? "no" : "too many", !nof_cds ? "" : "s");
-+ return (1);
-+ }
-+
-+ /*
-+ * Select
-+ */
-+ mb_Select1(mb, MBS_SelectArtist, 1);
-+ mb_Select1(mb, MBS_SelectAlbum, 1);
-+
-+ /*
-+ * Set Artist and Album
-+ */
-+ mb_GetResultData(mb, MBE_AlbumGetAlbumArtistName, tmp_buff, sizeof(tmp_buff));
-+ len = snprintf(cd_title, 256, "%s / ", tmp_buff);
-+ mb_GetResultData(mb, MBE_AlbumGetAlbumName, cd_title+len, 256 - len);
-+
-+ /*
-+ * Set tracks
-+ */
-+ for(len = 1; len <= cdrom->numtracks; len++)
-+ mb_GetResultData1(mb, MBE_AlbumGetTrackName, cd->cd_info.trk[len-1].name, 256, len);
-+
-+ mb_Delete(mb);
-+
-+ tcd_writediskinfo(&cd->cd_info, cdrom);
-+
-+ return (0);
-+}
diff -ruN tcd.orig/files/patch-tcd_mb.h tcd/files/patch-tcd_mb.h
--- tcd.orig/files/patch-tcd_mb.h 2012-03-05 13:32:10.000000000 -0500
+++ tcd/files/patch-tcd_mb.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,47 +0,0 @@
---- /dev/null 2008-06-26 20:11:00.000000000 +0200
-+++ src/tcd_mb.h 2008-06-26 19:37:19.000000000 +0200
-@@ -0,0 +1,44 @@
-+/*-
-+ * Copyright (c) 2008 Pietro Cerutti <gahr at FreeBSD.org>
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 3. All advertising materials mentioning features or use of this software
-+ * must display the following acknowledgement:
-+ * This product includes software developed by the University of
-+ * California, Berkeley and its contributors.
-+ * 4. Neither the name of the University nor the names of its contributors
-+ * may be used to endorse or promote products derived from this software
-+ * without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#ifndef TCD_MB_H_
-+#define TCD_MB_H_
-+
-+#include "tcd.h"
-+#include <SDL/SDL.h>
-+
-+#define MB_HOST "www.musicbrainz.org"
-+#define MB_PORT 80
-+
-+int tcd_readmb(struct tcd_state *cd, SDL_CD *cdrom);
-+
-+#endif /* ! TCD_MB_H_ */
--- 2012-03-05-tcd.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list