Bug 185060 - [patch] audio/sonata patch to work with mpd 0.18+
Summary: [patch] audio/sonata patch to work with mpd 0.18+
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Nicola Vitale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-21 09:10 UTC by Matthieu Volat
Modified: 2014-02-04 13:20 UTC (History)
0 users

See Also:


Attachments
file.diff (1.81 KB, patch)
2013-12-21 09:10 UTC, Matthieu Volat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu Volat 2013-12-21 09:10:00 UTC
audio/sonata broke with last mpd update : it will never connect because it cannot find anymore the xfade functionality (that was removed).

solution (see belows) is to slightly patch main.py file so that it will look over xfade support absence.

Fix: Applying this patch from upstream(?) fix the problem:
https://github.com/multani/sonata/commit/6bea8bb

I've attached a patch that applies it to the port directory directly.

Patch attached with submission follows:
How-To-Repeat: upgrade to mpd 0.18+
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-12-23 04:37:04 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ports-bugs

ports PR.
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-23 04:37:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->nivit

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 3 Mathieu Arnold freebsd_committer freebsd_triage 2014-02-04 13:11:34 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 4 dfilter service freebsd_committer freebsd_triage 2014-02-04 13:11:36 UTC
Author: mat
Date: Tue Feb  4 13:11:28 2014
New Revision: 342517
URL: http://svnweb.freebsd.org/changeset/ports/342517
QAT: https://qat.redports.org/buildarchive/r342517/

Log:
  - Fix build with mpd 0.18+ [1]
  - Support staging
  - Use new options knobs
  
  PR:		185060 [1]
  Submitted by:	Matthieu Volat [1]
  Sponsored by:	Absolight

Deleted:
  head/audio/sonata/pkg-plist
Modified:
  head/audio/sonata/Makefile
  head/audio/sonata/files/patch-sonata_main.py
  head/audio/sonata/pkg-descr

Modified: head/audio/sonata/Makefile
==============================================================================
--- head/audio/sonata/Makefile	Tue Feb  4 12:55:10 2014	(r342516)
+++ head/audio/sonata/Makefile	Tue Feb  4 13:11:28 2014	(r342517)
@@ -3,7 +3,7 @@
 
 PORTNAME=	sonata
 PORTVERSION=	1.6.2.1
-PORTREVISION=	8
+PORTREVISION=	9
 CATEGORIES=	audio python
 MASTER_SITES=	http://codingteam.net/project/sonata/upload/releases/
 
@@ -15,12 +15,10 @@ LICENSE=	GPLv3
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}mpd>=0.2.0:${PORTSDIR}/audio/py-mpd
 
 USES=		gettext pkgconfig
-NO_STAGE=	yes
 USE_GNOME=	pygtk2
 USE_PYTHON=	yes
 USE_PYDISTUTILS=	yes
-
-PYDISTUTILS_PKGNAME=	Sonata
+PYDISTUTILS_AUTOPLIST=	yes
 
 OPTIONS_DEFINE=	DOCS MANPAGES MMKEYS MPD PYGNOMEEXTRAS TAGLIB ZSI
 OPTIONS_DEFAULT=	MPD
@@ -29,43 +27,19 @@ MPD_DESC=	Install Music Player Daemon
 PYGNOMEEXTRAS_DESC=	Use py-gnome-extras for enhanced system tray
 TAGLIB_DESC=	Install support for editing metadata
 ZSI_DESC=	Install support for automatic lyrics fetching
+OPTIONS_SUB=	yes
 
-.include <bsd.port.options.mk>
-
-REINPLACE_ARGS=	-i.bak -e 's,%%DOCSDIR%%,${DOCSDIR},' \
-		-e 's,%%PREFIX%%,${PREFIX},'
+MANPAGES_MAKE_ENV_OFF=	NO_INSTALL_MANPAGES=${NO_INSTALL_MANPAGES}
+DOCS_MAKE_ENV=	NOPORTDOCS=${NOPORTDOCS}
+MPD_RUN_DEPENDS+=	musicpd:${PORTSDIR}/audio/musicpd
+MMKEYS_RUN_DEPENDS=${PYTHON_PKGNAMEPREFIX}dbus>=0.82.4:${PORTSDIR}/devel/py-dbus
+PYGNOMEEXTRAS_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}gnome-extras>=2.25.3_4:${PORTSDIR}/x11-toolkits/py-gnome-extras
+TAGLIB_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}tagpy>=0.94.5:${PORTSDIR}/audio/py-tagpy
+ZSI_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}zsi>=2.0,1:${PORTSDIR}/net/py-zsi
 
 post-patch:
-	@${REINPLACE_CMD} ${WRKSRC}/${PYSETUP} ${WRKSRC}/sonata.py
-
-.if ${PORT_OPTIONS:MMANPAGES}
-MAN1=	${PORTNAME}.1
-.else
-MAKE_ENV=	NO_INSTALL_MANPAGES=${NO_INSTALL_MANPAGES}
-.endif
-
-.if !${PORT_OPTIONS:MDOCS}
-MAKE_ENV+=	NOPORTDOCS=${NOPORTDOCS}
-.endif
-
-.if ${PORT_OPTIONS:MMPD}
-RUN_DEPENDS+=	musicpd:${PORTSDIR}/audio/musicpd
-.endif
-
-.if ${PORT_OPTIONS:MMMKEYS}
-RUN_DEPENDS+=${PYTHON_PKGNAMEPREFIX}dbus>=0.82.4:${PORTSDIR}/devel/py-dbus
-.endif
-
-.if ${PORT_OPTIONS:MPYGNOMEEXTRAS}
-RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}gnome-extras>=2.25.3_4:${PORTSDIR}/x11-toolkits/py-gnome-extras
-.endif
-
-.if ${PORT_OPTIONS:MTAGLIB}
-RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}tagpy>=0.94.5:${PORTSDIR}/audio/py-tagpy
-.endif
-
-.if ${PORT_OPTIONS:MZSI}
-RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}zsi>=2.0,1:${PORTSDIR}/net/py-zsi
-.endif
+	@${REINPLACE_CMD} -e 's,%%DOCSDIR%%,${DOCSDIR},' \
+		-e 's,%%PREFIX%%,${PREFIX},' \
+		${WRKSRC}/${PYSETUP} ${WRKSRC}/sonata.py
 
 .include <bsd.port.mk>

Modified: head/audio/sonata/files/patch-sonata_main.py
==============================================================================
--- head/audio/sonata/files/patch-sonata_main.py	Tue Feb  4 12:55:10 2014	(r342516)
+++ head/audio/sonata/files/patch-sonata_main.py	Tue Feb  4 13:11:28 2014	(r342517)
@@ -1,6 +1,28 @@
---- sonata/main.py.orig	2013-08-03 13:13:21.000000000 +0200
-+++ sonata/main.py	2013-08-03 13:14:12.000000000 +0200
-@@ -3400,4 +3400,7 @@ class Base(object):
+--- sonata/main.py.orig	2009-09-21 23:02:16.000000000 +0200
++++ sonata/main.py	2013-12-21 09:55:28.000000000 +0100
+@@ -989,13 +989,14 @@
+ 						self.repeatmenu.set_active(self.status['repeat'] == '1')
+ 					if not self.last_random or self.last_random != self.status['random']:
+ 						self.randommenu.set_active(self.status['random'] == '1')
+-					if self.status['xfade'] == '0':
+-						self.config.xfade_enabled = False
+-					else:
+-						self.config.xfade_enabled = True
+-						self.config.xfade = int(self.status['xfade'])
+-						if self.config.xfade > 30:
+-							self.config.xfade = 30
++					self.config.xfade_enabled = False
++					if 'xfade' in self.status:
++						xfade = int(self.status['xfade'])
++						if xfade != 0:
++							self.config.xfade_enabled = True
++							self.config.xfade = xfade
++							if self.config.xfade > 30:
++								self.config.xfade = 30
+ 					self.last_repeat = self.status['repeat']
+ 					self.last_random = self.status['random']
+ 					return
+@@ -3400,4 +3401,7 @@
  		self.on_currsong_notify(force_popup=True)
  	
  	def main(self):

Modified: head/audio/sonata/pkg-descr
==============================================================================
--- head/audio/sonata/pkg-descr	Tue Feb  4 12:55:10 2014	(r342516)
+++ head/audio/sonata/pkg-descr	Tue Feb  4 13:11:28 2014	(r342517)
@@ -20,4 +20,4 @@ FEATURES:
 	+ Commandline control
 	+ Available in 24 languages
 
-WWW:	http://sonata.berlios.de/index.html
+WWW: http://sonata.berlios.de/index.html
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"