2019-01-27 12:03:57 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, boost, cmake, chromaprint, gettext, gst_all_1, liblastfm
|
2019-03-26 10:11:29 +00:00
|
|
|
, taglib, fftw, glew, qjson, sqlite, libgpod, libplist, usbmuxd, libmtp
|
2017-08-28 11:52:18 +01:00
|
|
|
, libpulseaudio, gvfs, libcdio, libechonest, libspotify, pcre, projectm, protobuf
|
2018-07-21 01:44:44 +01:00
|
|
|
, qca2, pkgconfig, sparsehash, config, makeWrapper, gst_plugins }:
|
2015-04-28 05:18:00 +01:00
|
|
|
|
2015-05-02 19:30:53 +01:00
|
|
|
let
|
2017-03-16 23:47:37 +00:00
|
|
|
withIpod = config.clementine.ipod or false;
|
|
|
|
withMTP = config.clementine.mtp or true;
|
|
|
|
withCD = config.clementine.cd or true;
|
|
|
|
withCloud = config.clementine.cloud or true;
|
2015-05-05 03:07:56 +01:00
|
|
|
|
2017-08-03 03:54:50 +01:00
|
|
|
version = "1.3.1";
|
2015-04-28 05:18:00 +01:00
|
|
|
|
2019-01-27 12:03:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "clementine-player";
|
|
|
|
repo = "Clementine";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0i3jkfs8dbfkh47jq3cnx7pip47naqg7w66vmfszk4d8vj37j62j";
|
2015-05-05 03:07:56 +01:00
|
|
|
};
|
2015-04-28 05:18:00 +01:00
|
|
|
|
2015-05-05 03:07:56 +01:00
|
|
|
patches = [
|
|
|
|
./clementine-spotify-blob.patch
|
2019-01-27 12:03:57 +00:00
|
|
|
# Required so as to avoid adding libspotify as a build dependency (as it is
|
2017-08-03 03:54:50 +01:00
|
|
|
# unfree and thus would prevent us from having a free package).
|
|
|
|
./clementine-spotify-blob-remove-from-build.patch
|
2018-03-03 18:53:12 +00:00
|
|
|
(fetchpatch {
|
|
|
|
# Fix w/gcc7
|
|
|
|
url = "https://github.com/clementine-player/Clementine/pull/5630.patch";
|
|
|
|
sha256 = "0px7xp1m4nvrncx8sga1qlxppk562wrk2qqk19iiry84nxg20mk4";
|
|
|
|
})
|
2015-05-05 03:07:56 +01:00
|
|
|
];
|
2015-04-28 05:18:00 +01:00
|
|
|
|
2017-08-28 11:52:18 +01:00
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
|
2015-05-05 03:07:56 +01:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
2017-08-03 03:54:50 +01:00
|
|
|
chromaprint
|
2015-05-05 03:07:56 +01:00
|
|
|
fftw
|
|
|
|
gettext
|
|
|
|
glew
|
2017-08-03 03:54:50 +01:00
|
|
|
gst_all_1.gst-plugins-base
|
|
|
|
gst_all_1.gstreamer
|
2015-05-05 03:07:56 +01:00
|
|
|
gvfs
|
2017-08-03 03:54:50 +01:00
|
|
|
libechonest
|
2015-05-05 03:07:56 +01:00
|
|
|
liblastfm
|
2017-08-03 03:54:50 +01:00
|
|
|
libpulseaudio
|
|
|
|
pcre
|
2017-08-28 11:52:18 +01:00
|
|
|
projectm
|
2015-05-05 03:07:56 +01:00
|
|
|
protobuf
|
|
|
|
qca2
|
|
|
|
qjson
|
|
|
|
sqlite
|
|
|
|
taglib
|
2017-03-16 23:47:37 +00:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optionals (withIpod) [libgpod libplist usbmuxd]
|
|
|
|
++ stdenv.lib.optionals (withMTP) [libmtp]
|
|
|
|
++ stdenv.lib.optionals (withCD) [libcdio]
|
|
|
|
++ stdenv.lib.optionals (withCloud) [sparsehash];
|
2015-04-28 05:18:00 +01:00
|
|
|
|
2017-09-08 19:24:14 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i src/CMakeLists.txt \
|
|
|
|
-e 's,-Werror,,g' \
|
|
|
|
-e 's,-Wno-unknown-warning-option,,g' \
|
|
|
|
-e 's,-Wno-unused-private-field,,g'
|
|
|
|
sed -i CMakeLists.txt \
|
|
|
|
-e 's,libprotobuf.a,protobuf,g'
|
|
|
|
'';
|
|
|
|
|
2015-05-17 21:12:14 +01:00
|
|
|
free = stdenv.mkDerivation {
|
|
|
|
name = "clementine-free-${version}";
|
2018-04-24 22:27:45 +01:00
|
|
|
inherit src patches nativeBuildInputs postPatch;
|
|
|
|
|
2018-06-21 01:52:36 +01:00
|
|
|
# gst_plugins needed for setup-hooks
|
|
|
|
buildInputs = buildInputs ++ [ makeWrapper gst_plugins ];
|
2017-08-28 11:52:18 +01:00
|
|
|
|
|
|
|
cmakeFlags = [ "-DUSE_SYSTEM_PROJECTM=ON" ];
|
|
|
|
|
2015-05-05 03:07:56 +01:00
|
|
|
enableParallelBuilding = true;
|
2017-09-08 19:24:14 +01:00
|
|
|
|
2018-04-06 16:16:31 +01:00
|
|
|
passthru.unfree = unfree;
|
|
|
|
|
2018-04-24 22:27:45 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/clementine \
|
|
|
|
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
|
|
|
|
'';
|
|
|
|
|
2015-05-05 03:07:56 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.clementine-player.org;
|
2015-05-05 03:07:56 +01:00
|
|
|
description = "A multiplatform music player";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.ttuegel ];
|
|
|
|
};
|
|
|
|
};
|
2015-04-28 05:18:00 +01:00
|
|
|
|
2018-04-06 16:16:31 +01:00
|
|
|
# Unfree Spotify blob for Clementine
|
|
|
|
unfree = stdenv.mkDerivation {
|
2015-05-05 03:07:56 +01:00
|
|
|
name = "clementine-blob-${version}";
|
|
|
|
# Use the same patches and sources as Clementine
|
2017-09-08 19:24:14 +01:00
|
|
|
inherit src nativeBuildInputs postPatch;
|
2017-08-03 03:54:50 +01:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./clementine-spotify-blob.patch
|
|
|
|
];
|
|
|
|
|
2018-06-21 01:52:36 +01:00
|
|
|
buildInputs = buildInputs ++ [ libspotify makeWrapper ];
|
2015-05-05 03:07:56 +01:00
|
|
|
# Only build and install the Spotify blob
|
|
|
|
preBuild = ''
|
|
|
|
cd ext/clementine-spotifyblob
|
|
|
|
'';
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/libexec/clementine
|
|
|
|
mv $out/bin/clementine-spotifyblob $out/libexec/clementine
|
|
|
|
rmdir $out/bin
|
2018-04-06 16:16:31 +01:00
|
|
|
|
|
|
|
makeWrapper ${free}/bin/clementine $out/bin/clementine \
|
2018-04-24 22:27:45 +01:00
|
|
|
--set CLEMENTINE_SPOTIFYBLOB $out/libexec/clementine
|
2018-04-06 16:16:31 +01:00
|
|
|
|
|
|
|
mkdir -p $out/share
|
|
|
|
for dir in applications icons kde4; do
|
|
|
|
ln -s "$free/share/$dir" "$out/share/$dir"
|
|
|
|
done
|
2015-05-05 03:07:56 +01:00
|
|
|
'';
|
2015-04-28 05:18:00 +01:00
|
|
|
enableParallelBuilding = true;
|
2015-05-05 03:07:56 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.clementine-player.org;
|
2015-05-05 03:07:56 +01:00
|
|
|
description = "Spotify integration for Clementine";
|
|
|
|
# The blob itself is Apache-licensed, although libspotify is unfree.
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.ttuegel ];
|
|
|
|
};
|
2015-04-28 05:18:00 +01:00
|
|
|
};
|
2013-12-31 13:51:11 +00:00
|
|
|
|
2018-04-06 16:16:31 +01:00
|
|
|
in free
|