1{
2 stdenv,
3 fetchFromGitHub,
4 lib,
5 cmake,
6 libxcb,
7 qtbase,
8 qtsvg,
9 wrapQtAppsHook,
10 procps,
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "spotify-qt";
15 version = "4.0.0";
16
17 src = fetchFromGitHub {
18 owner = "kraxarn";
19 repo = "spotify-qt";
20 rev = "v${finalAttrs.version}";
21 hash = "sha256-4Qcmb8SYh4wQIosMU9bk22Y7FF3gfYgM3zODMBsD8Iw=";
22 };
23
24 postPatch = ''
25 substituteInPlace src/spotifyclient/helper.cpp \
26 --replace-fail /usr/bin/ps ${lib.getExe' procps "ps"}
27 '';
28
29 buildInputs = [
30 libxcb
31 qtbase
32 qtsvg
33 ];
34
35 nativeBuildInputs = [
36 cmake
37 wrapQtAppsHook
38 ];
39
40 cmakeFlags = [ (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "") ];
41
42 installFlags = [ "DESTDIR=$(out)" ];
43
44 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
45 mkdir -p $out/Applications
46 mv $out/bin/spotify-qt.app $out/Applications
47 ln $out/Applications/spotify-qt.app/Contents/MacOS/spotify-qt $out/bin/spotify-qt
48 '';
49
50 meta = with lib; {
51 description = "Lightweight unofficial Spotify client using Qt";
52 mainProgram = "spotify-qt";
53 homepage = "https://github.com/kraxarn/spotify-qt";
54 license = licenses.gpl3Only;
55 maintainers = with maintainers; [ iivusly ];
56 platforms = platforms.unix;
57 };
58})