2017-02-26 21:25:29 +01:00
|
|
|
{ stdenv, fetchurl, boost, cmake, gettext, gstreamer, gst-plugins-base
|
2013-12-31 14:51:11 +01:00
|
|
|
, liblastfm, qt4, taglib, fftw, glew, qjson, sqlite, libgpod, libplist
|
2015-05-05 04:07:56 +02:00
|
|
|
, usbmuxd, libmtp, gvfs, libcdio, libspotify, protobuf, qca2, pkgconfig
|
2015-05-02 20:48:04 +02:00
|
|
|
, sparsehash, config, makeWrapper, runCommand, gst_plugins }:
|
2015-04-28 06:18:00 +02:00
|
|
|
|
2015-05-02 20:30:53 +02:00
|
|
|
let
|
2015-05-05 04:07:56 +02:00
|
|
|
withSpotify = config.clementine.spotify or false;
|
2017-03-17 00:47:37 +01: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 04:07:56 +02:00
|
|
|
|
2015-04-28 06:18:00 +02:00
|
|
|
version = "1.2.3";
|
|
|
|
|
2015-05-02 20:37:10 +02:00
|
|
|
exeName = "clementine";
|
2015-04-28 06:18:00 +02:00
|
|
|
|
2015-05-05 04:07:56 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = https://github.com/clementine-player/Clementine/archive/1.2.3.tar.gz;
|
|
|
|
sha256 = "1gx1109i4pylz6x7gvp4rdzc6dvh0w6in6hfbygw01d08l26bxbx";
|
|
|
|
};
|
2015-04-28 06:18:00 +02:00
|
|
|
|
2015-05-05 04:07:56 +02:00
|
|
|
patches = [
|
|
|
|
./clementine-1.2.1-include-paths.patch
|
|
|
|
./clementine-dbus-namespace.patch
|
|
|
|
./clementine-spotify-blob.patch
|
|
|
|
];
|
2015-04-28 06:18:00 +02:00
|
|
|
|
2015-05-05 04:07:56 +02:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
cmake
|
|
|
|
fftw
|
|
|
|
gettext
|
|
|
|
glew
|
2017-02-26 21:25:29 +01:00
|
|
|
gst-plugins-base
|
2015-05-05 04:07:56 +02:00
|
|
|
gstreamer
|
|
|
|
gvfs
|
|
|
|
liblastfm
|
|
|
|
pkgconfig
|
|
|
|
protobuf
|
|
|
|
qca2
|
|
|
|
qjson
|
|
|
|
qt4
|
|
|
|
sqlite
|
|
|
|
taglib
|
2017-03-17 00:47:37 +01: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 06:18:00 +02:00
|
|
|
|
2015-05-17 22:12:14 +02:00
|
|
|
free = stdenv.mkDerivation {
|
|
|
|
name = "clementine-free-${version}";
|
2015-05-05 04:07:56 +02:00
|
|
|
inherit patches src buildInputs;
|
|
|
|
enableParallelBuilding = true;
|
2016-03-20 23:32:57 +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'
|
|
|
|
'';
|
2015-05-05 04:07:56 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "http://www.clementine-player.org";
|
|
|
|
description = "A multiplatform music player";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.ttuegel ];
|
|
|
|
};
|
|
|
|
};
|
2015-04-28 06:18:00 +02:00
|
|
|
|
2015-05-05 04:07:56 +02:00
|
|
|
# Spotify blob for Clementine
|
|
|
|
blob = stdenv.mkDerivation {
|
|
|
|
name = "clementine-blob-${version}";
|
|
|
|
# Use the same patches and sources as Clementine
|
|
|
|
inherit patches src;
|
|
|
|
buildInputs = buildInputs ++ [ libspotify ];
|
|
|
|
# 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
|
|
|
|
'';
|
2015-04-28 06:18:00 +02:00
|
|
|
enableParallelBuilding = true;
|
2015-05-05 04:07:56 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "http://www.clementine-player.org";
|
|
|
|
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 06:18:00 +02:00
|
|
|
};
|
2013-12-31 14:51:11 +01:00
|
|
|
|
2014-05-25 01:25:04 +02:00
|
|
|
in
|
2015-04-28 06:18:00 +02:00
|
|
|
|
2015-05-05 04:07:56 +02:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2015-05-02 20:48:04 +02:00
|
|
|
runCommand "clementine-${version}"
|
|
|
|
{
|
2015-05-17 22:12:14 +02:00
|
|
|
inherit blob free;
|
2015-05-05 04:07:56 +02:00
|
|
|
buildInputs = [ makeWrapper ] ++ gst_plugins; # for the setup-hooks
|
2015-04-28 06:18:00 +02:00
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
2015-05-05 04:07:56 +02:00
|
|
|
meta = {
|
2013-12-31 14:51:11 +01:00
|
|
|
homepage = "http://www.clementine-player.org";
|
2015-04-28 06:18:00 +02:00
|
|
|
description = "A multiplatform music player"
|
2015-05-05 04:07:56 +02:00
|
|
|
+ " (" + (optionalString withSpotify "with Spotify, ")
|
|
|
|
+ "with gstreamer plugins: "
|
2015-04-28 06:18:00 +02:00
|
|
|
+ concatStrings (intersperse ", " (map (x: x.name) gst_plugins))
|
|
|
|
+ ")";
|
2013-12-31 14:51:11 +01:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2014-03-07 18:20:18 +01:00
|
|
|
maintainers = [ maintainers.ttuegel ];
|
2013-12-31 14:51:11 +01:00
|
|
|
};
|
|
|
|
}
|
2015-05-02 20:48:04 +02:00
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
2015-05-17 22:12:14 +02:00
|
|
|
makeWrapper "$free/bin/${exeName}" "$out/bin/${exeName}" \
|
2015-05-05 04:07:56 +02:00
|
|
|
${optionalString withSpotify "--set CLEMENTINE_SPOTIFYBLOB \"$blob/libexec/clementine\""} \
|
2015-05-02 20:48:04 +02:00
|
|
|
--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"
|
2015-05-17 22:36:13 +02:00
|
|
|
|
|
|
|
mkdir -p $out/share
|
|
|
|
for dir in applications icons kde4; do
|
|
|
|
ln -s "$free/share/$dir" "$out/share/$dir"
|
|
|
|
done
|
2015-05-02 20:48:04 +02:00
|
|
|
''
|