1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 boost,
6 cmake,
7 chromaprint,
8 gettext,
9 gst_all_1,
10 liblastfm,
11 qtbase,
12 qtx11extras,
13 qttools,
14 taglib_1,
15 fftw,
16 glew,
17 qjson,
18 sqlite,
19 libgpod,
20 libplist,
21 usbmuxd,
22 libmtp,
23 libpulseaudio,
24 gvfs,
25 libcdio,
26 pcre,
27 projectm_3,
28 protobuf,
29 qca-qt5,
30 pkg-config,
31 sparsehash,
32 config,
33 wrapQtAppsHook,
34 gst_plugins,
35 util-linux,
36 libunwind,
37 libselinux,
38 elfutils,
39 libsepol,
40 orc,
41 alsa-lib,
42}:
43
44let
45 withIpod = config.clementine.ipod or false;
46 withMTP = config.clementine.mtp or true;
47 withCD = config.clementine.cd or true;
48 withCloud = config.clementine.cloud or true;
49in
50stdenv.mkDerivation (finalAttrs: {
51 pname = "clementine";
52 version = "1.4.1-45-g34eb666c0";
53
54 src = fetchFromGitHub {
55 owner = "clementine-player";
56 repo = "Clementine";
57 tag = finalAttrs.version;
58 hash = "sha256-5qZpQW8ZsyKpIww51sqghcrkhhh78TcpmMoctHgcoQo=";
59 };
60
61 nativeBuildInputs = [
62 cmake
63 pkg-config
64 wrapQtAppsHook
65 util-linux
66 libunwind
67 libselinux
68 elfutils
69 libsepol
70 orc
71 ];
72
73 buildInputs = [
74 boost
75 chromaprint
76 fftw
77 gettext
78 glew
79 gst_all_1.gst-plugins-base
80 gst_all_1.gst-plugins-bad
81 gst_all_1.gstreamer
82 gvfs
83 liblastfm
84 libpulseaudio
85 pcre
86 projectm_3
87 protobuf
88 qca-qt5
89 qjson
90 qtbase
91 qtx11extras
92 qttools
93 sqlite
94 taglib_1
95 alsa-lib
96 ]
97 # gst_plugins needed for setup-hooks
98 ++ gst_plugins
99 ++ lib.optionals (withIpod) [
100 libgpod
101 libplist
102 usbmuxd
103 ]
104 ++ lib.optionals (withMTP) [ libmtp ]
105 ++ lib.optionals (withCD) [ libcdio ]
106 ++ lib.optionals (withCloud) [ sparsehash ];
107
108 postPatch = ''
109 sed -i src/CMakeLists.txt \
110 -e 's,-Werror,,g' \
111 -e 's,-Wno-unknown-warning-option,,g' \
112 -e 's,-Wno-unused-private-field,,g'
113 sed -i CMakeLists.txt \
114 -e 's,libprotobuf.a,protobuf,g'
115 '';
116
117 preConfigure = ''
118 rm -rf ext/{,lib}clementine-spotifyblob
119 '';
120
121 cmakeFlags = [
122 "-DFORCE_GIT_REVISION=1.3.1"
123 "-DUSE_SYSTEM_PROJECTM=ON"
124 "-DSPOTIFY_BLOB=OFF"
125 ];
126
127 dontWrapQtApps = true;
128
129 postInstall = ''
130 wrapQtApp $out/bin/clementine \
131 --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
132 '';
133
134 meta = {
135 homepage = "https://www.clementine-player.org";
136 description = "Multiplatform music player";
137 license = lib.licenses.gpl3Plus;
138 platforms = lib.platforms.linux;
139 maintainers = with lib.maintainers; [ ttuegel ];
140 };
141})