clementine rebuild without qtwebkit

#65 [testing]
This commit is contained in:
AlmAck 2018-06-24 21:49:33 +02:00
parent dcb6c88ab8
commit 538bfe97d6
8 changed files with 338 additions and 42 deletions

View File

@ -0,0 +1,168 @@
From 948140fab56f593e60b3f623bda5ba1c97f2d6ab Mon Sep 17 00:00:00 2001
From: Valeriy <jazzvoid@gmail.com>
Date: Wed, 11 May 2016 17:58:12 +0300
Subject: [PATCH 1/3] disconnect GVolumeMonitor signals from GioLister before
destroying it fixes #5369
---
src/core/signalchecker.cpp | 9 ++++-----
src/core/signalchecker.h | 6 +++---
src/devices/giolister.cpp | 18 +++++++++++++-----
src/devices/giolister.h | 2 ++
4 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/src/core/signalchecker.cpp b/src/core/signalchecker.cpp
index 20767f284..2b0505638 100644
--- a/src/core/signalchecker.cpp
+++ b/src/core/signalchecker.cpp
@@ -21,7 +21,7 @@
#include "core/logging.h"
-bool CheckedGConnect(gpointer source, const char* signal, GCallback callback,
+gulong CheckedGConnect(gpointer source, const char* signal, GCallback callback,
gpointer data, const int callback_param_count) {
guint signal_id = 0;
GQuark detail = 0;
@@ -29,7 +29,7 @@ bool CheckedGConnect(gpointer source, const char* signal, GCallback callback,
if (!g_signal_parse_name(signal, G_OBJECT_TYPE(source), &signal_id, &detail,
false)) {
qFatal("Connecting to invalid signal: %s", signal);
- return false;
+ return 0;
}
GSignalQuery query;
@@ -39,9 +39,8 @@ bool CheckedGConnect(gpointer source, const char* signal, GCallback callback,
int signal_params = query.n_params + 2;
if (signal_params != callback_param_count) {
qFatal("Connecting callback to signal with different parameters counts");
- return false;
+ return 0;
}
- g_signal_connect(source, signal, G_CALLBACK(callback), data);
- return true;
+ return g_signal_connect(source, signal, G_CALLBACK(callback), data);
}
diff --git a/src/core/signalchecker.h b/src/core/signalchecker.h
index 75977e6f5..79b6b5364 100644
--- a/src/core/signalchecker.h
+++ b/src/core/signalchecker.h
@@ -25,14 +25,14 @@
#include <boost/typeof/typeof.hpp>
// Do not call this directly, use CHECKED_GCONNECT instead.
-bool CheckedGConnect(gpointer source, const char* signal, GCallback callback,
- gpointer data, const int callback_param_count);
+gulong CheckedGConnect(gpointer source, const char* signal, GCallback callback,
+ gpointer data, const int callback_param_count);
#define FUNCTION_ARITY(callback) \
boost::function_types::function_arity<BOOST_TYPEOF(callback)>::value
#define CHECKED_GCONNECT(source, signal, callback, data) \
CheckedGConnect(source, signal, G_CALLBACK(callback), data, \
- FUNCTION_ARITY(callback));
+ FUNCTION_ARITY(callback))
#endif // CORE_SIGNALCHECKER_H_
diff --git a/src/devices/giolister.cpp b/src/devices/giolister.cpp
index 1979f189c..d48cc4806 100644
--- a/src/devices/giolister.cpp
+++ b/src/devices/giolister.cpp
@@ -94,11 +94,19 @@ void GioLister::Init() {
g_list_free(mounts);
// Connect signals from the monitor
- CHECKED_GCONNECT(monitor_, "volume-added", &VolumeAddedCallback, this);
- CHECKED_GCONNECT(monitor_, "volume-removed", &VolumeRemovedCallback, this);
- CHECKED_GCONNECT(monitor_, "mount-added", &MountAddedCallback, this);
- CHECKED_GCONNECT(monitor_, "mount-changed", &MountChangedCallback, this);
- CHECKED_GCONNECT(monitor_, "mount-removed", &MountRemovedCallback, this);
+ signals_.append(CHECKED_GCONNECT(monitor_, "volume-added", &VolumeAddedCallback, this));
+ signals_.append(CHECKED_GCONNECT(monitor_, "volume-removed", &VolumeRemovedCallback, this));
+ signals_.append(CHECKED_GCONNECT(monitor_, "mount-added", &MountAddedCallback, this));
+ signals_.append(CHECKED_GCONNECT(monitor_, "mount-changed", &MountChangedCallback, this));
+ signals_.append(CHECKED_GCONNECT(monitor_, "mount-removed", &MountRemovedCallback, this));
+}
+
+GioLister::~GioLister()
+{
+ foreach(gulong signal, signals_)
+ {
+ g_signal_handler_disconnect(monitor_, signal);
+ }
}
QStringList GioLister::DeviceUniqueIDs() {
diff --git a/src/devices/giolister.h b/src/devices/giolister.h
index eafa69dc6..c01680bb2 100644
--- a/src/devices/giolister.h
+++ b/src/devices/giolister.h
@@ -36,6 +36,7 @@ class GioLister : public DeviceLister {
public:
GioLister() {}
+ ~GioLister();
int priority() const { return 50; }
@@ -137,6 +138,7 @@ class GioLister : public DeviceLister {
private:
ScopedGObject<GVolumeMonitor> monitor_;
+ QList<gulong> signals_;
QMutex mutex_;
QMap<QString, DeviceInfo> devices_;
From 806e689d1d4a10ca4012ccfcc770dd7fe98b0107 Mon Sep 17 00:00:00 2001
From: Valeriy <jazzvoid@gmail.com>
Date: Wed, 11 May 2016 19:00:30 +0300
Subject: [PATCH 2/3] replace foreach with range-based for
---
src/devices/giolister.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/devices/giolister.cpp b/src/devices/giolister.cpp
index d48cc4806..f1a776bc0 100644
--- a/src/devices/giolister.cpp
+++ b/src/devices/giolister.cpp
@@ -103,7 +103,7 @@ void GioLister::Init() {
GioLister::~GioLister()
{
- foreach(gulong signal, signals_)
+ for (gulong signal : signals_)
{
g_signal_handler_disconnect(monitor_, signal);
}
From cbc7092ed90a5bbf681afd7391cb06d4f2c4ae1e Mon Sep 17 00:00:00 2001
From: Valeriy <jazzvoid@gmail.com>
Date: Tue, 17 May 2016 14:47:02 +0300
Subject: [PATCH 3/3] fix code style
---
src/devices/giolister.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/devices/giolister.cpp b/src/devices/giolister.cpp
index f1a776bc0..aa3bddb34 100644
--- a/src/devices/giolister.cpp
+++ b/src/devices/giolister.cpp
@@ -101,10 +101,8 @@ void GioLister::Init() {
signals_.append(CHECKED_GCONNECT(monitor_, "mount-removed", &MountRemovedCallback, this));
}
-GioLister::~GioLister()
-{
- for (gulong signal : signals_)
- {
+GioLister::~GioLister() {
+ for (gulong signal : signals_) {
g_signal_handler_disconnect(monitor_, signal);
}
}

View File

@ -1,14 +1,13 @@
pkgname=clementine
pkgver=1.3.1
pkgrel=7
pkgrel=8
pkgdesc="A modern music player and library organiser and a port of Amarok 1.4, with some features rewritten to take advantage of Qt4."
url="http://www.clementine-player.org/"
screenshot="http://images.clementine-player.org/screenshots/clementine-1.0-3.png"
license="GPL"
license=("GPL")
arch=('x86_64')
install=${pkgname}.install
depends=('gstreamer' 'taglib' 'glew' 'libgpod' 'libmtp' 'libplist' 'liblastfm-qt4'
'hicolor-icon-theme' 'qtwebkit' 'qjson' 'protobuf' 'crypto++'
'hicolor-icon-theme' 'qjson' 'protobuf' 'crypto++'
'libcdio' 'qca' 'qca-ossl' 'chromaprint' 'libmygpo-qt' 'libechonest-qt4')
makedepends=('cmake' 'boost' 'mesa' 'sparsehash')
optdepends=('gst-plugins-base: for more open formats'
@ -19,13 +18,38 @@ optdepends=('gst-plugins-base: for more open formats'
with ccr yourself'
'dropbox: add support for Dropbox')
categories=('multimedia')
source=("https://github.com/clementine-player/Clementine/releases/download/1.3.1/${pkgname}-${pkgver}.tar.xz")
sha1sums=('67f3438d674e075d15859daedfc9f82b638243f7')
source=("https://github.com/clementine-player/Clementine/releases/download/1.3.1/${pkgname}-${pkgver}.tar.xz"
'clementine-gcc6.patch'
'add-missing-functional-includes-5630.patch'
'clementine-1.3.1-chromaprint-1.4.0.patch'
'clementine-cryptopp6.patch'
'https://github.com/clementine-player/Clementine/commit/75f9439843a0e9cdc26cd739d5e1dbd93bd974bc.patch')
sha1sums=('67f3438d674e075d15859daedfc9f82b638243f7'
'41dfe9c6b22d60d6d6e83c3a1389a523a52e7946'
'633f88598a257fcac21610cdced1fbecfe144a10'
'9d6a8bc211f94728ff424de680ad3b042176f570'
'2d45444f011613d92acb4a247a4f9c653d34e655'
'579063e7eaad30af93609bb88854ce49728014f6')
prepare() {
cd ${pkgname}-${pkgver}
sed 's,<lastfm/,<lastfm4/,g' -i src/internet/lastfm/* -i src/core/*.cpp
mkdir -p build
# Fix build with GCC 6
patch -p1 -i ../clementine-gcc6.patch
# https://github.com/clementine-player/Clementine/pull/5630
patch -p1 -i ../add-missing-functional-includes-5630.patch
# Fix build with chromaprint 1.4.0
patch -p1 -i ../clementine-1.3.1-chromaprint-1.4.0.patch
# Fix build with crypto++ 6.0.0 due to https://github.com/weidai11/cryptopp/issues/442
patch -p1 -i ../clementine-cryptopp6.patch
# FS#58413
patch -Np1 -i ../75f9439843a0e9cdc26cd739d5e1dbd93bd974bc.patch
if [[ -d build ]]; then
rm -rf build
fi
mkdir build
}
build() {

View File

@ -0,0 +1,51 @@
From 8a6cc8b5069265e1e92e22def985e22c5955e503 Mon Sep 17 00:00:00 2001
From: Morris Hafner <mmha@users.noreply.github.com>
Date: Mon, 13 Feb 2017 17:46:46 +0100
Subject: [PATCH] Add missing <functional> includes (#5630)
---
src/core/mergedproxymodel.cpp | 1 +
src/devices/giolister.cpp | 1 +
src/library/groupbydialog.cpp | 2 ++
3 files changed, 4 insertions(+)
diff --git a/src/core/mergedproxymodel.cpp b/src/core/mergedproxymodel.cpp
index 56217f6fd..8c210d391 100644
--- a/src/core/mergedproxymodel.cpp
+++ b/src/core/mergedproxymodel.cpp
@@ -23,6 +23,7 @@
#include <QStringList>
+#include <functional>
#include <limits>
// boost::multi_index still relies on these being in the global namespace.
diff --git a/src/devices/giolister.cpp b/src/devices/giolister.cpp
index aa3bddb34..5f63ef248 100644
--- a/src/devices/giolister.cpp
+++ b/src/devices/giolister.cpp
@@ -17,6 +17,7 @@
#include "config.h"
+#include <functional>
#include <memory>
#include <QFile>
diff --git a/src/library/groupbydialog.cpp b/src/library/groupbydialog.cpp
index 5efdc9f36..e5f711b34 100644
--- a/src/library/groupbydialog.cpp
+++ b/src/library/groupbydialog.cpp
@@ -20,6 +20,8 @@
#include <QPushButton>
+#include <functional>
+
// boost::multi_index still relies on these being in the global namespace.
using std::placeholders::_1;
using std::placeholders::_2;
--
2.13.4

View File

@ -0,0 +1,41 @@
From ded312685735fc266d4154d355286eeb86db3bcd Mon Sep 17 00:00:00 2001
From: Chocobozzz <florian.bigard@gmail.com>
Date: Thu, 8 Dec 2016 23:12:17 +0100
Subject: [PATCH] Add compatibility with chromaprint >= 1.4
---
src/musicbrainz/chromaprinter.cpp | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/musicbrainz/chromaprinter.cpp b/src/musicbrainz/chromaprinter.cpp
index 9579b62ae..c7ad99e2e 100644
--- a/src/musicbrainz/chromaprinter.cpp
+++ b/src/musicbrainz/chromaprinter.cpp
@@ -143,16 +143,24 @@ QString Chromaprinter::CreateFingerprint() {
ChromaprintContext* chromaprint =
chromaprint_new(CHROMAPRINT_ALGORITHM_DEFAULT);
chromaprint_start(chromaprint, kDecodeRate, kDecodeChannels);
- chromaprint_feed(chromaprint, reinterpret_cast<void*>(data.data()),
+ chromaprint_feed(chromaprint, reinterpret_cast<int16_t *>(data.data()),
data.size() / 2);
chromaprint_finish(chromaprint);
- void* fprint = nullptr;
int size = 0;
+
+#if CHROMAPRINT_VERSION_MAJOR >= 1 && CHROMAPRINT_VERSION_MINOR >= 4
+ u_int32_t *fprint = nullptr;
+ char *encoded = nullptr;
+#else
+ void *fprint = nullptr;
+ void *encoded = nullptr;
+#endif
+
int ret = chromaprint_get_raw_fingerprint(chromaprint, &fprint, &size);
+
QByteArray fingerprint;
if (ret == 1) {
- void* encoded = nullptr;
int encoded_size = 0;
chromaprint_encode_fingerprint(fprint, size, CHROMAPRINT_ALGORITHM_DEFAULT,
&encoded, &encoded_size, 1);

View File

@ -0,0 +1,25 @@
diff --git a/src/internet/spotify/spotifyblobdownloader.cpp b/src/internet/spotify/spotifyblobdownloader.cpp
index e34577f5d..045aeeb8a 100644
--- a/src/internet/spotify/spotifyblobdownloader.cpp
+++ b/src/internet/spotify/spotifyblobdownloader.cpp
@@ -189,7 +189,7 @@ bool SpotifyBlobDownloader::CheckSignature(
try {
CryptoPP::ByteQueue bytes;
- bytes.Put(reinterpret_cast<const byte*>(public_key_data.constData()),
+ bytes.Put(reinterpret_cast<const CryptoPP::byte*>(public_key_data.constData()),
public_key_data.size());
bytes.MessageEnd();
@@ -204,9 +204,9 @@ bool SpotifyBlobDownloader::CheckSignature(
actual_filename.remove(kSignatureSuffix);
const bool result = verifier.VerifyMessage(
- reinterpret_cast<const byte*>(file_data[actual_filename].constData()),
+ reinterpret_cast<const CryptoPP::byte*>(file_data[actual_filename].constData()),
file_data[actual_filename].size(),
- reinterpret_cast<const byte*>(
+ reinterpret_cast<const CryptoPP::byte*>(
file_data[signature_filename].constData()),
file_data[signature_filename].size());
qLog(Debug) << "Verifying" << actual_filename << "against"

View File

@ -0,0 +1,22 @@
From e31278c05666f8ae0e819bd831c65e8766ba2679 Mon Sep 17 00:00:00 2001
From: Bigard Florian <florian.bigard@gmail.com>
Date: Mon, 9 May 2016 11:55:34 +0200
Subject: [PATCH] Fix projectm compilation with GCC 6 (#5371)
---
3rdparty/libprojectm/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/3rdparty/libprojectm/CMakeLists.txt b/3rdparty/libprojectm/CMakeLists.txt
index e6287f176..0ef785c49 100644
--- a/3rdparty/libprojectm/CMakeLists.txt
+++ b/3rdparty/libprojectm/CMakeLists.txt
@@ -24,6 +24,8 @@ set(BUILD_PROJECTM_STATIC ON)
set(DISABLE_NATIVE_PRESETS ON)
set(DISABLE_MILKDROP_PRESETS OFF)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
+
if(DISABLE_NATIVE_PRESETS)
ADD_DEFINITIONS(-DDISABLE_NATIVE_PRESETS)
endif(DISABLE_NATIVE_PRESETS)

View File

@ -1,14 +0,0 @@
pkgname=clementine
post_install() {
xdg-icon-resource forceupdate --theme hicolor &> /dev/null
}
post_upgrade() {
post_install $1
}
post_remove() {
post_install $1
}

View File

@ -1,21 +0,0 @@
--- src/core/database.cpp
+++ src/core/database.cpp
@@ -265,7 +265,17 @@
StaticInit();
{
- QSqlQuery set_fts_tokenizer(db);
+#ifdef SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
+ QVariant v = db.driver()->handle();
+ if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) {
+ sqlite3* handle = *static_cast<sqlite3**>(v.data());
+ if (handle) {
+ sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL);
+ }
+ }
+#endif
+
+ QSqlQuery set_fts_tokenizer("SELECT fts3_tokenizer(:name, :pointer)", db);
set_fts_tokenizer.prepare("SELECT fts3_tokenizer(:name, :pointer)");
set_fts_tokenizer.bindValue(":name", "unicode");
set_fts_tokenizer.bindValue(