[arch-commits] Commit in muine/trunk (PKGBUILD drop-musicbrainz.patch fix-dnd.patch)

Balló György bgyorgy at archlinux.org
Sat Jun 24 17:38:33 UTC 2017


    Date: Saturday, June 24, 2017 @ 17:38:32
  Author: bgyorgy
Revision: 240817

upgpkg: muine 0.8.11-4

Fix some crashers

Added:
  muine/trunk/drop-musicbrainz.patch
  muine/trunk/fix-dnd.patch
Modified:
  muine/trunk/PKGBUILD

------------------------+
 PKGBUILD               |   12 ++-
 drop-musicbrainz.patch |  144 +++++++++++++++++++++++++++++++++++++++++++++++
 fix-dnd.patch          |   19 ++++++
 3 files changed, 172 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-06-24 16:14:54 UTC (rev 240816)
+++ PKGBUILD	2017-06-24 17:38:32 UTC (rev 240817)
@@ -5,7 +5,7 @@
 
 pkgname=muine
 pkgver=0.8.11
-pkgrel=3
+pkgrel=4
 pkgdesc="A music player written in C Sharp"
 arch=('i686' 'x86_64')
 license=('GPL')
@@ -24,7 +24,9 @@
         drop-gnome-sharp-dependency.patch
         use-standard-icons.patch
         use-gstreamer-1.0.patch
-        enable-deprecations.patch)
+        enable-deprecations.patch
+        drop-musicbrainz.patch
+        fix-dnd.patch)
 sha256sums=('fac70bd9ab8a3c7c48c1f48d10f06080f6b5a42ce32cce21a6ab472cb178ecd4'
             'b798a754ca545f9efb97e6d2e5911f26af028a41c0f40a4e3f2cb9c8fe38cbfa'
             '870bb03f031c7ed248b417896b4e02d2ed3659e1b7e320d032d48b81d558ee8a'
@@ -33,7 +35,9 @@
             '8671a431e9c30ed4373fbbe659f90fbe411e178f31daa4fb8dc1914ec0a6864c'
             'd3e8171b2f3ceb27e039652289ac79c846a797c88eb6945af833da80eb33c154'
             '4887f59d1a039e907961681b57eea5dfb2d7d5d27d1e37ae677d4ac6394095b5'
-            '598763b8f81a08b6eea54f5710480e7ca2f706ed4fa82527d3525a649ab774ab')
+            '598763b8f81a08b6eea54f5710480e7ca2f706ed4fa82527d3525a649ab774ab'
+            '5bf67b8c879138d3b50d21ee0a95025640ef0ed06044f2938580513192ce2ecc'
+            '91f657c23792c62de9a391035c635a602e5afe430182aa8e8912d84112199718')
 
 prepare() {
   cd $pkgname-$pkgver
@@ -45,6 +49,8 @@
   patch -Np1 -i ../use-standard-icons.patch
   patch -Np1 -i ../use-gstreamer-1.0.patch
   patch -Np1 -i ../enable-deprecations.patch
+  patch -Np1 -i ../drop-musicbrainz.patch
+  patch -Np1 -i ../fix-dnd.patch
   sed -i 's/MCS, gmcs/MCS, mcs/' configure.in
   autoreconf -fi
 }

Added: drop-musicbrainz.patch
===================================================================
--- drop-musicbrainz.patch	                        (rev 0)
+++ drop-musicbrainz.patch	2017-06-24 17:38:32 UTC (rev 240817)
@@ -0,0 +1,144 @@
+diff -Naur muine-0.8.11.orig/src/CoverGetter.cs muine-0.8.11/src/CoverGetter.cs
+--- muine-0.8.11.orig/src/CoverGetter.cs	2009-09-13 16:53:58.000000000 +0200
++++ muine-0.8.11/src/CoverGetter.cs	2017-06-24 18:59:25.451408318 +0200
+@@ -27,8 +27,6 @@
+ 
+ using Gdk;
+ 
+-using musicbrainz;
+-
+ namespace Muine
+ {
+ 	public class CoverGetter
+@@ -320,109 +318,7 @@
+ 		/// </exception>
+ 		private Pixbuf DownloadFromAmazonViaMusicBrainz (Album album)
+ 		{
+-			// Rather than do the lib search and catch the
+-			// DllNotFoundException every single time,
+-			// we check a simple bool as a performance helper.
+-			if (musicbrainz_lib_missing)
+-				return null;
+-
+-			Pixbuf pix = null;
+-			try {
+-				// Sane album title
+-				string sane_album_title;
+-				if (album.Name != null)
+-					sane_album_title = SanitizeString (album.Name);
+-				else
+-					sane_album_title = String.Empty;
+-
+-				// Sane artist name
+-				string sane_artist_name;
+-				if (album.Artists != null && album.Artists.Length > 0)
+-					sane_artist_name = album.Artists [0].ToLower ();
+-				else
+-					sane_artist_name = String.Empty;
+-
+-				//
+-				string asin = null;
+-				
+-				// TODO: Move to constant
+-				string AmazonImageUri =
+-				  "http://images.amazon.com/images/P/{0}.01._SCMZZZZZZZ_.jpg";
+-
+-
+-				// remove "disc 1" and family
+-				//  TODO: Make the regexes translatable?
+-				//  (e.g. "uno|dos|tres...", "les|los..)
+-				string sane_album_title_regex  = @"[,:]?\s*";
+-				sane_album_title_regex += @"(cd|dis[ck])\s*";
+-				sane_album_title_regex += @"(\d+|one|two|three|four|five|six|seven|eight|nine|ten)\s*$";
+-				sane_album_title =  Regex.Replace (sane_album_title, sane_album_title_regex, String.Empty);
+-
+-				// Remove "The " and "the " from artist names
+-				string sane_artist_name_regex = @"^the\s+";
+-				sane_artist_name = Regex.Replace (sane_artist_name, sane_artist_name_regex, String.Empty);
+-				
+-				MusicBrainz c = new MusicBrainz ();
+-				
+-				// set the depth of the query
+-				//   (see http://wiki.musicbrainz.org/ClientHOWTO)
+-				c.SetDepth(4);
+-
+-				string [] album_name = new string [] { sane_album_title };
+-
+-				bool match =
+-				  c.Query (MusicBrainz.MBQ_FindAlbumByName, album_name);
+-
+-				if (match) {
+-					int num_albums =
+-					  c.GetResultInt (MusicBrainz.MBE_GetNumAlbums);
+-					
+-					string fetched_artist_name;
+-					for (int i = 1; i <= num_albums; i++) {
+-						c.Select (MusicBrainz.MBS_SelectAlbum, i);
+-
+-						// gets the artist from the first track of the album
+-						c.GetResultData
+-						  (MusicBrainz.MBE_AlbumGetArtistName, 1,
+-						   out fetched_artist_name);
+-
+-						// Remove "The " here as well
+-						if (fetched_artist_name != null) {
+-							string tmp = fetched_artist_name.ToLower ();
+-							string fetched_artist_name_regex = @"^the\s+";
+-							fetched_artist_name = Regex.Replace (tmp, fetched_artist_name_regex, String.Empty);
+-
+-						} else {
+-							fetched_artist_name = String.Empty;
+-						}
+-
+-						if (fetched_artist_name == sane_artist_name) {
+-							c.GetResultData
+-							  (MusicBrainz.MBE_AlbumGetAmazonAsin, out asin);
+-
+-							break;
+-						}
+-
+-						// go back one level so we can select the next album
+-						c.Select(MusicBrainz.MBS_Back); 
+-					}
+-				}
+-
+-				if (asin == null) {
+-					pix = null;
+-				} else {
+-					string uri = String.Format (AmazonImageUri, asin);
+-					pix = Download (uri);
+-				}
+-				
+-			} catch (DllNotFoundException) {
+-				// We catch this exception so we can always include the
+-				// musicbrainz support but not have a strict compile/runtime
+-				// requirement on it.
+-				musicbrainz_lib_missing = true;
+-			}
+-
+-			return pix;
++			return null;
+ 		}
+ 		
+ 		// Methods :: Private :: DownloadFromAmazonViaAPI
+diff -Naur muine-0.8.11.orig/src/Makefile.am muine-0.8.11/src/Makefile.am
+--- muine-0.8.11.orig/src/Makefile.am	2017-06-24 18:53:07.530698000 +0200
++++ muine-0.8.11/src/Makefile.am	2017-06-24 19:00:38.870158064 +0200
+@@ -29,7 +29,6 @@
+ 	$(srcdir)/ColoredCellRendererPixbuf.cs  \
+ 	$(srcdir)/CoverDatabase.cs		\
+ 	$(srcdir)/CoverGetter.cs		\
+-	$(srcdir)/MusicBrainz.cs		\
+ 	$(srcdir)/GnomeProxy.cs			\
+ 	$(srcdir)/CoverImage.cs			\
+ 	$(srcdir)/MmKeys.cs			\
+diff -Naur muine-0.8.11.orig/src/muine.exe.config.in muine-0.8.11/src/muine.exe.config.in
+--- muine-0.8.11.orig/src/muine.exe.config.in	2017-06-24 18:53:07.537364000 +0200
++++ muine-0.8.11/src/muine.exe.config.in	2017-06-24 19:00:20.066291163 +0200
+@@ -2,6 +2,5 @@
+   <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/>
+   <dllmap dll="libgtk-2.0-0.dll" target="libgtk-x11-2.0.so.0"/>
+   <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/>
+-  <dllmap dll="musicbrainz" target="libmusicbrainz.so.4"/>
+   <dllmap dll="libmuine" target="@pkglibdir@/libmuine.so"/>
+ </configuration>

Added: fix-dnd.patch
===================================================================
--- fix-dnd.patch	                        (rev 0)
+++ fix-dnd.patch	2017-06-24 17:38:32 UTC (rev 240817)
@@ -0,0 +1,19 @@
+diff -Naur muine-0.8.11.orig/src/PlaylistWindow.cs muine-0.8.11/src/PlaylistWindow.cs
+--- muine-0.8.11.orig/src/PlaylistWindow.cs	2017-06-24 18:53:07.537364000 +0200
++++ muine-0.8.11/src/PlaylistWindow.cs	2017-06-24 19:21:08.225082062 +0200
+@@ -2091,7 +2091,14 @@
+ 				ArrayList new_dinfos = new ArrayList ();
+ 
+ 				foreach (string s in bits) {
+-					string fn = new Uri(s).LocalPath;
++					string fn;
++					
++					try {
++						fn = new Uri(s).LocalPath;
++
++					} catch {
++						continue;
++					}
+ 
+ 					if (fn == null)
+ 						continue;



More information about the arch-commits mailing list