summary refs log tree commit diff
path: root/pkgs/applications/audio/tomahawk/default.nix
blob: 7021cd165cfd403323b8aec47771af64000b3b3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ stdenv, fetchurl, cmake, pkgconfig, attica, boost, gnutls, libechonest
, liblastfm, lucenepp, phonon, phonon-backend-vlc, qca2, qjson, qt4
, qtkeychain, quazip, sparsehash, taglib, websocketpp, makeWrapper

, enableXMPP      ? true,  libjreen     ? null
, enableKDE       ? false, kdelibs      ? null
, enableTelepathy ? false, telepathy_qt ? null
}:

assert enableXMPP      -> libjreen     != null;
assert enableKDE       -> kdelibs      != null;
assert enableTelepathy -> telepathy_qt != null;

stdenv.mkDerivation rec {
  name = "tomahawk-${version}";
  version = "0.8.4";

  src = fetchurl {
    url = "http://download.tomahawk-player.org/${name}.tar.bz2";
    sha256 = "0j84h36wkjfjbsd7ybyji7rcc9wpjdbl0f1xdcc1g7h0nz34pc0g";
  };

  cmakeFlags = [
    "-DLUCENEPP_INCLUDE_DIR=${lucenepp}/include"
    "-DLUCENEPP_LIBRARY_DIR=${lucenepp}/lib"
  ];

  buildInputs = [
    cmake pkgconfig attica boost gnutls libechonest liblastfm lucenepp phonon
    qca2 qjson qt4 qtkeychain quazip sparsehash taglib websocketpp
    makeWrapper
  ] ++ stdenv.lib.optional enableXMPP      libjreen
    ++ stdenv.lib.optional enableKDE       kdelibs
    ++ stdenv.lib.optional enableTelepathy telepathy_qt;

  postInstall = let
    pluginPath = stdenv.lib.concatStringsSep ":" [
      "${phonon-backend-vlc}/lib/kde4/plugins"
    ];
  in ''
    for i in "$out"/bin/*; do
      wrapProgram "$i" --prefix QT_PLUGIN_PATH : "${pluginPath}"
    done
  '';

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "A multi-source music player";
    homepage = "http://tomahawk-player.org/";
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = [ maintainers.aszlig ];
  };
}