[clementine] Lastfm login fix RHBZ#757280 Patches for building against newer glibmm24 and glib2

Orcan Ogetbil oget at fedoraproject.org
Wed Nov 30 05:11:59 UTC 2011


commit 1e900f76c4e1ae3f2dd849fccabef86ae58a5798
Author: Orcan Ogetbil <oget.fedora at gmail.com>
Date:   Wed Nov 30 00:11:56 2011 -0500

    Lastfm login fix RHBZ#757280
    Patches for building against newer glibmm24 and glib2

 clementine-glib2-2.30.patch       |   12 ++++++++++
 clementine-glibmm24-2.30.patch    |   44 +++++++++++++++++++++++++++++++++++++
 clementine-lastfm-login-fix.patch |   27 ++++++++++++++++++++++
 clementine.spec                   |   18 ++++++++++++++-
 4 files changed, 100 insertions(+), 1 deletions(-)
---
diff --git a/clementine-glib2-2.30.patch b/clementine-glib2-2.30.patch
new file mode 100644
index 0000000..cd4eee3
--- /dev/null
+++ b/clementine-glib2-2.30.patch
@@ -0,0 +1,12 @@
+diff -rupN clementine-0.7.1.old/src/main.cpp clementine-0.7.1/src/main.cpp
+--- clementine-0.7.1.old/src/main.cpp	2011-11-29 18:59:07.112404698 -0500
++++ clementine-0.7.1/src/main.cpp	2011-11-29 23:00:41.876822198 -0500
+@@ -61,7 +61,7 @@
+ #include <QtDebug>
+ 
+ #include <glib-object.h>
+-#include <glib/gutils.h>
++#include <glib.h>
+ #include <gst/gst.h>
+ 
+ #include <boost/scoped_ptr.hpp>
diff --git a/clementine-glibmm24-2.30.patch b/clementine-glibmm24-2.30.patch
new file mode 100644
index 0000000..d50daa3
--- /dev/null
+++ b/clementine-glibmm24-2.30.patch
@@ -0,0 +1,44 @@
+diff -rupN clementine-0.7.1.old/src/devices/giolister.cpp clementine-0.7.1/src/devices/giolister.cpp
+--- clementine-0.7.1.old/src/devices/giolister.cpp	2011-03-29 15:23:34.000000000 -0400
++++ clementine-0.7.1/src/devices/giolister.cpp	2011-11-29 19:36:22.224852516 -0500
+@@ -458,19 +458,34 @@ void GioLister::UnmountDevice(const QStr
+ 
+   if (info.volume) {
+     if (g_volume_can_eject(info.volume)) {
+-      g_volume_eject(info.volume, G_MOUNT_UNMOUNT_NONE, NULL,
+-                     (GAsyncReadyCallback) VolumeEjectFinished, NULL);
++      g_volume_eject_with_operation(
++          info.volume,
++	  G_MOUNT_UNMOUNT_NONE,
++	  NULL,
++	  NULL,
++	  (GAsyncReadyCallback) VolumeEjectFinished,
++	  NULL);
+       g_object_unref(info.volume);
+       return;
+     }
+   }
+ 
+   if (g_mount_can_eject(info.mount)) {
+-    g_mount_eject(info.mount, G_MOUNT_UNMOUNT_NONE, NULL,
+-                  (GAsyncReadyCallback) MountEjectFinished, NULL);
++    g_mount_eject_with_operation(
++	  info.mount,
++	  G_MOUNT_UNMOUNT_NONE,
++	  NULL,
++	  NULL,
++	  (GAsyncReadyCallback) MountEjectFinished,
++	  NULL);
+   } else if (g_mount_can_unmount(info.mount)) {
+-    g_mount_unmount(info.mount, G_MOUNT_UNMOUNT_NONE, NULL,
+-                    (GAsyncReadyCallback) MountUnmountFinished, NULL);
++    g_mount_unmount_with_operation(
++	  info.mount,
++	  G_MOUNT_UNMOUNT_NONE,
++	  NULL,
++	  NULL,
++	  (GAsyncReadyCallback) MountUnmountFinished,
++	  NULL);
+   }
+ }
+ 
diff --git a/clementine-lastfm-login-fix.patch b/clementine-lastfm-login-fix.patch
new file mode 100644
index 0000000..8d34f90
--- /dev/null
+++ b/clementine-lastfm-login-fix.patch
@@ -0,0 +1,27 @@
+diff -rupN clementine-0.7.1.old/src/core/network.cpp clementine-0.7.1/src/core/network.cpp
+--- clementine-0.7.1.old/src/core/network.cpp	2011-03-29 15:16:15.000000000 -0400
++++ clementine-0.7.1/src/core/network.cpp	2011-11-29 18:58:08.606678681 -0500
+@@ -91,6 +91,12 @@ QNetworkReply* NetworkAccessManager::cre
+       QCoreApplication::applicationName(),
+       QCoreApplication::applicationVersion()).toUtf8());
+ 
++  if (op == QNetworkAccessManager::PostOperation && 
++      !new_request.header(QNetworkRequest::ContentTypeHeader).isValid()) {
++    new_request.setHeader(QNetworkRequest::ContentTypeHeader,
++			  "application/x-www-form-urlencoded");
++  }
++
+   // Prefer the cache unless the caller has changed the setting already
+   if (request.attribute(QNetworkRequest::CacheLoadControlAttribute).toInt()
+       == QNetworkRequest::PreferNetwork) {
+diff -rupN clementine-0.7.1.old/src/main.cpp clementine-0.7.1/src/main.cpp
+--- clementine-0.7.1.old/src/main.cpp	2011-03-29 15:16:24.000000000 -0400
++++ clementine-0.7.1/src/main.cpp	2011-11-29 18:59:07.112404698 -0500
+@@ -208,6 +208,7 @@ int main(int argc, char *argv[]) {
+ #ifdef HAVE_LIBLASTFM
+   lastfm::ws::ApiKey = LastFMService::kApiKey;
+   lastfm::ws::SharedSecret = LastFMService::kSecret;
++  lastfm::setNetworkAccessManager(new NetworkAccessManager);
+ #endif
+ 
+   CommandlineOptions options(argc, argv);
diff --git a/clementine.spec b/clementine.spec
index c01de3e..ff14a89 100644
--- a/clementine.spec
+++ b/clementine.spec
@@ -1,6 +1,6 @@
 Name:           clementine
 Version:        0.7.1
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        A music player and library organizer
 
 Group:          Applications/Multimedia
@@ -8,6 +8,14 @@ License:        GPLv3+ and GPLv2+
 URL:            http://code.google.com/p/clementine-player
 Source0:        http://clementine-player.googlecode.com/files/%{name}-%{version}.tar.gz
 
+# Fixes lastfm login issue. From upstream trunk
+# RHBZ#757280 upstream#2438
+Patch0:         clementine-lastfm-login-fix.patch
+# Fixes build against newer glibmm24. From upstream trunk
+Patch1:         clementine-glibmm24-2.30.patch
+# Fixes build against newer glib2. From upstream trunk
+Patch2:         clementine-glib2-2.30.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  boost-devel
@@ -49,6 +57,9 @@ music.
 
 %prep
 %setup -q
+%patch0 -p1 -b .lastfm
+%patch1 -p1 -b .glibmm24
+%patch2 -p1 -b .glib2
 
 # Remove all 3rdparty libraries exceph universalchardet
 # as it is not available as a separate library.
@@ -85,6 +96,7 @@ make install DESTDIR=%{buildroot} -C %{_target_platform}
 %check
 pushd %{_target_platform}
     # Run a fake X session since some tests check for X
+    # Yet the tests still fail sometimes
     xvfb-run -a -n 10 make test
 popd
 desktop-file-validate \
@@ -118,6 +130,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Tue Nov 29 2011 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> - 0.7.1-4
+- Lastfm login fix RHBZ#757280
+- Patches for building against newer glibmm24 and glib2
+
 * Mon Oct 10 2011 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> - 0.7.1-3
 - Rebuild for libechonest soname bump.
 


More information about the scm-commits mailing list