summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-rtmidi/default.nix
blob: 8c51d9942f6b4b72f4ce7fa3efb6cf25eb88dd5a (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
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, pythonAtLeast
, pkg-config
, alsa-lib
, libjack2
, tox
, flake8
, alabaster
, CoreAudio
, CoreMIDI
, CoreServices
}:

buildPythonPackage rec {
  pname = "python-rtmidi";
  version = "1.4.9";

  # https://github.com/SpotlightKid/python-rtmidi/issues/115
  disabled = pythonOlder "3.6" || pythonAtLeast "3.11";

  src = fetchPypi {
    inherit pname version;
    sha256 = "bfeb4ed99d0cccf6fa2837566907652ded7adc1c03b69f2160c9de4082301302";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [
    libjack2
  ] ++ lib.optionals stdenv.isLinux [
    alsa-lib
  ] ++ lib.optionals stdenv.isDarwin [
    CoreAudio
    CoreMIDI
    CoreServices
  ];
  nativeCheckInputs = [
    tox
    flake8
    alabaster
  ];

  meta = with lib; {
    description = "A Python binding for the RtMidi C++ library implemented using Cython";
    homepage = "https://github.com/SpotlightKid/python-rtmidi";
    license = licenses.mit;
    maintainers = with maintainers; [ hexa ];
  };
}