summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/nc/ncmpcpp/package.nix
blob: 275e95f68bccaee8524e961d3ad6bb8d611565ae (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
  lib,
  stdenv,
  fetchFromGitHub,
  boost187,
  libmpdclient,
  ncurses,
  pkg-config,
  readline,
  libiconv,
  icu,
  curl,
  autoconf,
  automake,
  libtool,
  outputsSupport ? true, # outputs screen
  visualizerSupport ? false,
  fftw, # visualizer screen
  clockSupport ? true, # clock screen
  taglibSupport ? true,
  taglib, # tag editor
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "ncmpcpp";
  version = "0.10.1";

  src = fetchFromGitHub {
    owner = "ncmpcpp";
    repo = "ncmpcpp";
    tag = finalAttrs.version;
    hash = "sha256-w3deSy71SWWD2kZKREowZh3KMNCBfBJbrjM0vW4/GrI=";
  };

  enableParallelBuilding = true;

  strictDeps = true;

  configureFlags = [
    "BOOST_LIB_SUFFIX="
    (lib.enableFeature outputsSupport "outputs")
    (lib.enableFeature visualizerSupport "visualizer")
    (lib.withFeature visualizerSupport "fftw")
    (lib.enableFeature clockSupport "clock")
    (lib.withFeature taglibSupport "taglib")
    (lib.withFeatureAs true "boost" boost187.dev)
  ];

  nativeBuildInputs = [
    autoconf
    automake
    libtool
    pkg-config
  ];

  buildInputs = [
    boost187
    libmpdclient
    ncurses
    readline
    libiconv
    icu
    curl
  ]
  ++ lib.optional visualizerSupport fftw
  ++ lib.optional taglibSupport taglib;

  preConfigure = ''
    autoreconf -fiv
  ''
  + lib.optionalString stdenv.hostPlatform.isDarwin ''
    # std::result_of was removed in c++20 and unusable for clang16
    substituteInPlace ./configure \
      --replace-fail "std=c++20" "std=c++17"
  '';

  meta = {
    description = "Featureful ncurses based MPD client inspired by ncmpc";
    homepage = "https://rybczak.net/ncmpcpp/";
    changelog = "https://github.com/ncmpcpp/ncmpcpp/blob/${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [
      koral
    ];
    platforms = lib.platforms.all;
    mainProgram = "ncmpcpp";
  };
})