summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/drumstick/default.nix
blob: e5fc8ddd2feaa091b2a8b987516c6d39babfba1c (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
{
  lib,
  stdenv,
  fetchurl,
  cmake,
  docbook_xml_dtd_45,
  docbook_xsl,
  doxygen,
  graphviz-nox,
  pkg-config,
  qttools,
  wrapQtAppsHook,
  alsa-lib,
  fluidsynth,
  libpulseaudio,
  qtbase,
  qtsvg,
  qtwayland,
  sonivox,
  qt5compat ? null,
}:

let
  isQt6 = lib.versions.major qtbase.version == "6";
in
stdenv.mkDerivation rec {
  pname = "drumstick";
  version = "2.11.0";

  src = fetchurl {
    url = "mirror://sourceforge/drumstick/${version}/drumstick-${version}.tar.bz2";
    hash = "sha256-vPlhQ+i8gifI/UIXii7KhZQ+RYBdnE09FVCXQiJcQdU=";
  };

  patches = [ ./drumstick-plugins.patch ];

  postPatch = ''
    substituteInPlace library/rt/backendmanager.cpp --subst-var out
  '';

  outputs = [
    "out"
    "dev"
    "man"
  ];

  nativeBuildInputs = [
    cmake
    docbook_xml_dtd_45
    docbook_xml_dtd_45
    docbook_xsl
    doxygen
    graphviz-nox
    pkg-config
    qttools
    wrapQtAppsHook
  ];

  buildInputs = [
    alsa-lib
    fluidsynth
    libpulseaudio
    qtbase
    qtsvg
    qtwayland
    sonivox
  ]
  ++ lib.optionals isQt6 [ qt5compat ];

  cmakeFlags = [
    (lib.cmakeBool "USE_DBUS" true)
    (lib.cmakeBool "USE_QT5" (!isQt6))
  ];

  meta = {
    description = "MIDI libraries for Qt/C++";
    homepage = "https://drumstick.sourceforge.io/";
    license = lib.licenses.gpl2Plus;
    maintainers = with lib.maintainers; [ wegank ];
    platforms = lib.platforms.linux;
  };
}