From 5dc1abebddd75a4169b5995e7dac6bf8a321a278 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Mon, 16 Jan 2017 16:36:04 +0100 Subject: [PATCH] clementine: fix build with chromaprint>=1.4 Enable PIE while I'm here. --- .../patches/clementine-chromaprint-1.4.patch | 41 +++++++++++++++++++ .../patches/clementine-moodbar_flags.patch | 14 +++++++ .../patches/clementine-sqlite-3.12.patch | 12 +++--- srcpkgs/clementine/template | 9 ++-- 4 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 srcpkgs/clementine/patches/clementine-chromaprint-1.4.patch create mode 100644 srcpkgs/clementine/patches/clementine-moodbar_flags.patch diff --git a/srcpkgs/clementine/patches/clementine-chromaprint-1.4.patch b/srcpkgs/clementine/patches/clementine-chromaprint-1.4.patch new file mode 100644 index 00000000000..bfdc49265aa --- /dev/null +++ b/srcpkgs/clementine/patches/clementine-chromaprint-1.4.patch @@ -0,0 +1,41 @@ +From ded312685735fc266d4154d355286eeb86db3bcd Mon Sep 17 00:00:00 2001 +From: Chocobozzz +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 9579b62..c7ad99e 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(data.data()), ++ chromaprint_feed(chromaprint, reinterpret_cast(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); diff --git a/srcpkgs/clementine/patches/clementine-moodbar_flags.patch b/srcpkgs/clementine/patches/clementine-moodbar_flags.patch new file mode 100644 index 00000000000..5eadfec4c46 --- /dev/null +++ b/srcpkgs/clementine/patches/clementine-moodbar_flags.patch @@ -0,0 +1,14 @@ +diff --git a/gst/moodbar/CMakeLists.txt b/gst/moodbar/CMakeLists.txt +index 44c1362..7ed5047 100644 +--- a/gst/moodbar/CMakeLists.txt ++++ b/gst/moodbar/CMakeLists.txt +@@ -1,7 +1,7 @@ + cmake_minimum_required(VERSION 2.6) + +-set(CMAKE_C_FLAGS "-Wall") +-set(CMAKE_CXX_FLAGS "-Woverloaded-virtual -Wall --std=c++0x") ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") ++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -Wall --std=c++0x") + + include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + diff --git a/srcpkgs/clementine/patches/clementine-sqlite-3.12.patch b/srcpkgs/clementine/patches/clementine-sqlite-3.12.patch index b840e91dc7f..5c6a15227c7 100644 --- a/srcpkgs/clementine/patches/clementine-sqlite-3.12.patch +++ b/srcpkgs/clementine/patches/clementine-sqlite-3.12.patch @@ -8,12 +8,12 @@ + QVariant v = db.driver()->handle(); + if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) { + sqlite3* handle = *static_cast(v.data()); -+ if (handle) { -+ sqlite3_db_config(handle, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL); -+ } -+ } -+#endif -+ ++ 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.bindValue(":name", "unicode"); set_fts_tokenizer.bindValue( diff --git a/srcpkgs/clementine/template b/srcpkgs/clementine/template index afcc303b0f5..1dd0afe61e8 100644 --- a/srcpkgs/clementine/template +++ b/srcpkgs/clementine/template @@ -1,11 +1,12 @@ # Template file for 'clementine' pkgname=clementine version=1.3.1 -revision=4 +revision=5 +patch_args="-Np1" build_style=cmake -hostmakedepends="git sparsehash pkg-config" +hostmakedepends="sparsehash pkg-config" makedepends="chromaprint-devel boost-devel gst-plugins-base1-devel liblastfm-devel - qt-devel qt-webkit-devel glew-devel qjson-devel sqlite-devel protobuf-devel libplist-devel + qt-webkit-devel glew-devel qjson-devel sqlite-devel protobuf-devel libplist-devel libusbmuxd-devel libmtp-devel libcdio-devel qca-devel pulseaudio-devel glu-devel taglib-devel crypto++-devel libspotify-devel libechonest-devel" depends="desktop-file-utils" @@ -16,8 +17,6 @@ homepage="https://www.clementine-player.org/" wrksrc="Clementine-$version" distfiles="https://github.com/clementine-player/Clementine/archive/$version.tar.gz" checksum=f885931a9ab7c88607d07b50c64fcce46fc05f13dd2c0a04188c94eff938f37c -patch_args="-p1" -nopie=yes pre_configure() { sed -i 's|AMAZON_CLOUD_DRIVE OFF|AMAZON_CLOUD_DRIVE ON|g' CMakeLists.txt