2020-06-08 20:19:18 +03:00
|
|
|
{ stdenv, mkDerivation, fetchFromGitHub, fetchpatch, boost, cmake, chromaprint, gettext, gst_all_1, liblastfm
|
|
|
|
, qtbase, qtx11extras
|
2019-03-26 13:11:29 +03:00
|
|
|
, taglib, fftw, glew, qjson, sqlite, libgpod, libplist, usbmuxd, libmtp
|
2017-08-28 13:52:18 +03:00
|
|
|
, libpulseaudio, gvfs, libcdio, libechonest, libspotify, pcre, projectm, protobuf
|
2018-07-21 03:44:44 +03:00
|
|
|
, qca2, pkgconfig, sparsehash, config, makeWrapper, gst_plugins }:
|
2015-04-28 07:18:00 +03:00
|
|
|
|
2015-05-02 21:30:53 +03:00
|
|
|
let
|
2017-03-17 02:47:37 +03: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 05:07:56 +03:00
|
|
|
|
2020-06-08 20:19:18 +03:00
|
|
|
version = "1.4.0rc1";
|
2015-04-28 07:18:00 +03:00
|
|
|
|
2019-01-27 15:03:57 +03:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "clementine-player";
|
|
|
|
repo = "Clementine";
|
|
|
|
rev = version;
|
2020-06-08 20:19:18 +03:00
|
|
|
sha256 = "1rqk0hrsn8f8bjk0j0vq1af0ygy6xx7qi9fw0jjw2cmj6kzckyi2";
|
2015-05-05 05:07:56 +03:00
|
|
|
};
|
2015-04-28 07:18:00 +03:00
|
|
|
|
2015-05-05 05:07:56 +03:00
|
|
|
patches = [
|
|
|
|
./clementine-spotify-blob.patch
|
|
|
|
];
|
2015-04-28 07:18:00 +03:00
|
|
|
|
2017-08-28 13:52:18 +03:00
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
|
2015-05-05 05:07:56 +03:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
2017-08-03 05:54:50 +03:00
|
|
|
chromaprint
|
2015-05-05 05:07:56 +03:00
|
|
|
fftw
|
|
|
|
gettext
|
|
|
|
glew
|
2017-08-03 05:54:50 +03:00
|
|
|
gst_all_1.gst-plugins-base
|
|
|
|
gst_all_1.gstreamer
|
2015-05-05 05:07:56 +03:00
|
|
|
gvfs
|
2017-08-03 05:54:50 +03:00
|
|
|
libechonest
|
2015-05-05 05:07:56 +03:00
|
|
|
liblastfm
|
2017-08-03 05:54:50 +03:00
|
|
|
libpulseaudio
|
|
|
|
pcre
|
2017-08-28 13:52:18 +03:00
|
|
|
projectm
|
2015-05-05 05:07:56 +03:00
|
|
|
protobuf
|
|
|
|
qca2
|
|
|
|
qjson
|
2020-06-08 20:19:18 +03:00
|
|
|
qtbase
|
|
|
|
qtx11extras
|
2015-05-05 05:07:56 +03:00
|
|
|
sqlite
|
|
|
|
taglib
|
2017-03-17 02:47:37 +03: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 07:18:00 +03:00
|
|
|
|
2017-09-08 21:24:14 +03: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'
|
|
|
|
'';
|
|
|
|
|
2020-06-08 20:19:18 +03:00
|
|
|
free = mkDerivation {
|
2019-08-14 00:52:01 +03:00
|
|
|
pname = "clementine-free";
|
|
|
|
inherit version;
|
2018-04-25 00:27:45 +03:00
|
|
|
inherit src patches nativeBuildInputs postPatch;
|
|
|
|
|
2018-06-21 03:52:36 +03:00
|
|
|
# gst_plugins needed for setup-hooks
|
2019-11-10 02:52:53 +03:00
|
|
|
buildInputs = buildInputs ++ [ makeWrapper ] ++ gst_plugins;
|
2017-08-28 13:52:18 +03:00
|
|
|
|
2020-06-08 20:19:18 +03:00
|
|
|
preConfigure = ''
|
|
|
|
rm -rf ext/{,lib}clementine-spotifyblob
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_SYSTEM_PROJECTM=ON"
|
|
|
|
"-DSPOTIFY_BLOB=OFF"
|
|
|
|
];
|
2017-08-28 13:52:18 +03:00
|
|
|
|
2015-05-05 05:07:56 +03:00
|
|
|
enableParallelBuilding = true;
|
2017-09-08 21:24:14 +03:00
|
|
|
|
2018-04-06 18:16:31 +03:00
|
|
|
passthru.unfree = unfree;
|
|
|
|
|
2018-04-25 00:27:45 +03:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/clementine \
|
|
|
|
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
|
|
|
|
'';
|
|
|
|
|
2015-05-05 05:07:56 +03:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-24 17:55:31 +03:00
|
|
|
homepage = "https://www.clementine-player.org";
|
2015-05-05 05:07:56 +03:00
|
|
|
description = "A multiplatform music player";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.ttuegel ];
|
|
|
|
};
|
|
|
|
};
|
2015-04-28 07:18:00 +03:00
|
|
|
|
2018-04-06 18:16:31 +03:00
|
|
|
# Unfree Spotify blob for Clementine
|
2020-06-08 20:19:18 +03:00
|
|
|
unfree = mkDerivation {
|
2019-08-14 00:52:01 +03:00
|
|
|
pname = "clementine-blob";
|
|
|
|
inherit version;
|
2015-05-05 05:07:56 +03:00
|
|
|
# Use the same patches and sources as Clementine
|
2020-06-08 20:19:18 +03:00
|
|
|
inherit src nativeBuildInputs patches postPatch;
|
2017-08-03 05:54:50 +03:00
|
|
|
|
2018-06-21 03:52:36 +03:00
|
|
|
buildInputs = buildInputs ++ [ libspotify makeWrapper ];
|
2015-05-05 05:07:56 +03: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 18:16:31 +03:00
|
|
|
|
|
|
|
makeWrapper ${free}/bin/clementine $out/bin/clementine \
|
2018-04-25 00:27:45 +03:00
|
|
|
--set CLEMENTINE_SPOTIFYBLOB $out/libexec/clementine
|
2018-04-06 18:16:31 +03:00
|
|
|
|
|
|
|
mkdir -p $out/share
|
|
|
|
for dir in applications icons kde4; do
|
2020-03-16 02:41:12 +03:00
|
|
|
ln -s "${free}/share/$dir" "$out/share/$dir"
|
2018-04-06 18:16:31 +03:00
|
|
|
done
|
2015-05-05 05:07:56 +03:00
|
|
|
'';
|
2015-04-28 07:18:00 +03:00
|
|
|
enableParallelBuilding = true;
|
2015-05-05 05:07:56 +03:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-24 21:32:21 +03:00
|
|
|
homepage = "https://www.clementine-player.org";
|
2015-05-05 05:07:56 +03: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 07:18:00 +03:00
|
|
|
};
|
2013-12-31 17:51:11 +04:00
|
|
|
|
2018-04-06 18:16:31 +03:00
|
|
|
in free
|