ports/165833: [PATCH] audio/cynthiune: Remove audio/libmusicbrainz dependency
Jason E. Hale
bsdkaffee at gmail.com
Wed Mar 7 19:00:28 UTC 2012
>Number: 165833
>Category: ports
>Synopsis: [PATCH] audio/cynthiune: Remove audio/libmusicbrainz dependency
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Mar 07 19:00:27 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 the audio/libmusicbrainz dependency from audio/cynthiune as the
MusicBrainz RDF webservice is no longer functional (patch taken from Ubuntu)
- Move LICENSE to appease portlint
>How-To-Repeat:
- Use attached diff
>Fix:
--- 2012-03-07-cynthuine.diff begins here ---
diff -ruN cynthiune.orig/Makefile cynthiune/Makefile
--- cynthiune.orig/Makefile 2012-03-07 12:38:30.000000000 -0500
+++ cynthiune/Makefile 2012-03-07 13:19:03.000000000 -0500
@@ -7,7 +7,7 @@
PORTNAME= cynthiune
PORTVERSION= 0.9.5
-PORTREVISION= 9
+PORTREVISION= 10
CATEGORIES= audio gnustep
MASTER_SITES= ${MASTER_SITE_DEBIAN}
MASTER_SITE_SUBDIR= pool/main/c/cynthiune.app
@@ -16,15 +16,14 @@
MAINTAINER= dinoex at FreeBSD.org
COMMENT= Romantic music player for GNUstep
+LICENSE= GPLv2
+
LIB_DEPENDS+= FLAC:${PORTSDIR}/audio/flac
LIB_DEPENDS+= tag.1:${PORTSDIR}/audio/taglib
-LIB_DEPENDS+= musicbrainz.4:${PORTSDIR}/audio/libmusicbrainz
LIB_DEPENDS+= modplug.1:${PORTSDIR}/audio/libmodplug
LIB_DEPENDS+= artsc.0:${PORTSDIR}/audio/arts
LIB_DEPENDS+= id3tag.0:${PORTSDIR}/audio/libid3tag
-LICENSE= GPLv2
-
USE_GNUSTEP= yes
USE_GNUSTEP_BACK= yes
USE_GNUSTEP_BUILD= yes
diff -ruN cynthiune.orig/files/patch-CynthiuneController.m cynthiune/files/patch-CynthiuneController.m
--- cynthiune.orig/files/patch-CynthiuneController.m 1969-12-31 19:00:00.000000000 -0500
+++ cynthiune/files/patch-CynthiuneController.m 2012-03-07 12:38:55.000000000 -0500
@@ -0,0 +1,12 @@
+--- ./CynthiuneController.m.orig 2006-03-28 01:41:08.000000000 -0500
++++ ./CynthiuneController.m 2012-03-06 09:08:34.000000000 -0500
+@@ -28,9 +28,6 @@
+ #import <AppKit/NSPasteboard.h>
+ #import <AppKit/NSToolbar.h>
+ #import <AppKit/NSWindow.h>
+-#ifdef GNUSTEP
+-#import <AppKit/NSWindow+Toolbar.h>
+-#endif
+ #import <Foundation/NSArray.h>
+ #import <Foundation/NSBundle.h>
+ #import <Foundation/NSFileManager.h>
diff -ruN cynthiune.orig/files/patch-GNUmakefile.preamble cynthiune/files/patch-GNUmakefile.preamble
--- cynthiune.orig/files/patch-GNUmakefile.preamble 1969-12-31 19:00:00.000000000 -0500
+++ cynthiune/files/patch-GNUmakefile.preamble 2012-03-07 12:38:55.000000000 -0500
@@ -0,0 +1,11 @@
+--- ./GNUmakefile.preamble.orig 2012-03-05 20:54:59.000000000 -0500
++++ ./GNUmakefile.preamble 2012-03-05 20:55:39.000000000 -0500
+@@ -25,7 +25,7 @@
+ ADDITIONAL_CPPFLAGS += -DLOCALBUILD=1
+ endif
+
+-ADDITIONAL_GUI_LIBS += -L/MingW/bin -lmusicbrainz
++ADDITIONAL_GUI_LIBS += -L/MingW/bin
+
+ ifneq (mingw32, $(GNUSTEP_TARGET_OS))
+ ifeq ($(debug), yes)
diff -ruN cynthiune.orig/files/patch-SongInspectorController.m cynthiune/files/patch-SongInspectorController.m
--- cynthiune.orig/files/patch-SongInspectorController.m 1969-12-31 19:00:00.000000000 -0500
+++ cynthiune/files/patch-SongInspectorController.m 2012-03-07 12:38:55.000000000 -0500
@@ -0,0 +1,198 @@
+--- ./SongInspectorController.m.orig 2012-03-05 20:56:28.000000000 -0500
++++ ./SongInspectorController.m 2012-03-05 21:03:15.000000000 -0500
+@@ -34,8 +34,6 @@
+ #import <Foundation/NSString.h>
+ #import <Foundation/NSThread.h>
+
+-#import <musicbrainz/mb_c.h>
+-
+ #import <Cynthiune/Format.h>
+ #import <Cynthiune/NSViewExtensions.h>
+ #import <Cynthiune/utils.h>
+@@ -156,10 +154,10 @@
+ {
+ if (!threadRunning)
+ {
+- [lookupButton setEnabled: YES];
+- [lookupButton setImage: [NSImage imageNamed: @"lookup-mb-on"]];
++ [lookupButton setEnabled: NO];
++ [lookupButton setImage: [NSImage imageNamed: @"lookup-mb-off"]];
+ [lookupAnimation setImage: nil];
+- [lookupStatusLabel setStringValue: @""];
++ [lookupStatusLabel setStringValue: @"MB lookup doesn't work!"];
+ }
+ }
+ else
+@@ -320,39 +318,6 @@
+ forKey: @"song"]];
+ }
+
+-- (char *) _generateTrmId
+-{
+- id <Format> stream;
+- trm_t trmGen;
+- int size;
+- char sig[17];
+- unsigned char buffer[4096];
+- char *trmId;
+-
+- stream = [song openStreamForSong];
+- if (stream)
+- {
+- trmGen = trm_New ();
+- trm_SetPCMDataInfo (trmGen,
+- [stream readRate], [stream readChannels], 16);
+- trm_SetSongLength (trmGen, [stream readDuration]);
+- size = [stream readNextChunk: buffer withSize: 4096];
+- while (!trm_GenerateSignature (trmGen, (char *) buffer, size))
+- size = [stream readNextChunk: buffer withSize: 4096];
+-
+- trm_FinalizeSignature (trmGen, sig, NULL);
+-
+- trmId = malloc (37);
+- trm_ConvertSigToASCII (trmGen, sig, trmId);
+- trm_Delete (trmGen);
+- [stream streamClose];
+- }
+- else
+- trmId = NULL;
+-
+- return trmId;
+-}
+-
+ - (void) updateField: (NSTextField *) field
+ withString: (NSString *) string
+ {
+@@ -418,132 +383,6 @@
+ selector: @selector (_updateFieldsWithTrackInfos:)];
+ }
+
+-- (NSDictionary *) readMB: (musicbrainz_t) mb
+- track: (int) track
+-{
+- NSMutableDictionary *trackInfos;
+- NSString *string;
+- char cString[100];
+- int releases;
+-
+- trackInfos = [NSMutableDictionary new];
+- [trackInfos autorelease];
+-
+- mb_Select1 (mb, MBS_SelectTrack, track);
+- if (mb_GetResultData (mb, MBE_TrackGetTrackName, cString, 100))
+- {
+- string = [NSString stringWithUTF8String: cString];
+- [trackInfos setObject: string forKey: @"title"];
+- }
+-
+- if (mb_GetResultData (mb, MBE_TrackGetArtistName, cString, 100))
+- {
+- string = [NSString stringWithUTF8String: cString];
+- [trackInfos setObject: string forKey: @"artist"];
+- }
+-
+- if (mb_GetResultData (mb, MBE_TrackGetTrackNum, cString, 100))
+- {
+- string = [NSString stringWithUTF8String: cString];
+- [trackInfos setObject: string forKey: @"trackNumber"];
+- }
+-
+- if (mb_Select (mb, MBS_SelectTrackAlbum))
+- {
+- if (mb_GetResultData (mb, MBE_AlbumGetAlbumName, cString, 100))
+- {
+- string = [NSString stringWithUTF8String: cString];
+- [trackInfos setObject: string forKey: @"album"];
+- }
+-#ifdef MBE_AlbumGetNumReleaseDates
+- releases = mb_GetResultInt (mb, MBE_AlbumGetNumReleaseDates);
+- if (releases)
+- {
+- mb_Select1 (mb, MBS_SelectReleaseDate, 1);
+- if (mb_GetResultData (mb, MBE_ReleaseGetDate, cString, 100))
+- {
+- *(cString + 4) = 0;
+- string = [NSString stringWithUTF8String: cString];
+- [trackInfos setObject: string forKey: @"year"];
+- }
+- mb_Select (mb, MBS_Back);
+- }
+-#endif
+-
+- mb_Select (mb, MBS_Back);
+- }
+-
+- mb_Select (mb, MBS_Rewind);
+-
+- return trackInfos;
+-}
+-
+-- (void) _parseMB: (musicbrainz_t) mb
+-{
+- int count, results;
+- NSMutableArray *allTrackInfos;
+-
+- results = mb_GetResultInt (mb, MBE_GetNumTracks);
+- allTrackInfos = [[NSMutableArray alloc] initWithCapacity: results];
+- [allTrackInfos autorelease];
+-
+- for (count = 0; count < results; count++)
+- [allTrackInfos addObject: [self readMB: mb track: count + 1]];
+-
+- [self performSelectorOnMainThread: @selector (_updateSongFields:)
+- withObject: allTrackInfos
+- waitUntilDone: YES];
+-}
+-
+-- (void) lookupThread
+-{
+- NSAutoreleasePool *pool;
+- char *trmId;
+- musicbrainz_t mb;
+- char **qis;
+- char error[80];
+-
+- pool = [NSAutoreleasePool new];
+-
+- [self updateField: lookupStatusLabel
+- withString: LOCALIZED(@"Generating TRM...")];
+- trmId = [self _generateTrmId];
+- if (trmId && !threadShouldDie)
+- {
+- qis = MakeQis (trmId, song);
+-
+- if (strcasecmp (trmId, busyTrmId))
+- {
+- [self updateField: lookupStatusLabel
+- withString: LOCALIZED (@"Querying MusicBrainz server...")];
+- mb = mb_New ();
+- mb_UseUTF8 (mb, YES);
+- if (mb_QueryWithArgs (mb, MBQ_TrackInfoFromTRMId, qis))
+- [self _parseMB: mb];
+- else
+- {
+-// FIXME: there should be an accurate error message here...
+- [self updateField: lookupStatusLabel
+- withString: @""];
+- mb_GetQueryError (mb, error, 80);
+- NSLog (@"Musicbrainz error: %s (%s)", error, trmId);
+- }
+- mb_Delete (mb);
+- }
+- else
+- [self updateField: lookupStatusLabel
+- withString: LOCALIZED (@"The MusicBrainz server was too busy")];
+-
+- FreeQis (qis);
+- }
+-
+- [self performSelectorOnMainThread: @selector (lookupThreadEnded)
+- withObject: nil
+- waitUntilDone: NO];
+-
+- [pool release];
+-}
+-
+ - (void) mbLookup: (id)sender
+ {
+ if (song)
--- 2012-03-07-cynthuine.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list