1{ lib
2, stdenv
3, buildPythonPackage
4, fetchPypi
5, pythonOlder
6, pythonAtLeast
7, pkg-config
8, alsa-lib
9, libjack2
10, tox
11, flake8
12, alabaster
13, CoreAudio
14, CoreMIDI
15, CoreServices
16}:
17
18buildPythonPackage rec {
19 pname = "python-rtmidi";
20 version = "1.4.9";
21
22 # https://github.com/SpotlightKid/python-rtmidi/issues/115
23 disabled = pythonOlder "3.6" || pythonAtLeast "3.11";
24
25 src = fetchPypi {
26 inherit pname version;
27 sha256 = "bfeb4ed99d0cccf6fa2837566907652ded7adc1c03b69f2160c9de4082301302";
28 };
29
30 nativeBuildInputs = [ pkg-config ];
31 buildInputs = [
32 libjack2
33 ] ++ lib.optionals stdenv.isLinux [
34 alsa-lib
35 ] ++ lib.optionals stdenv.isDarwin [
36 CoreAudio
37 CoreMIDI
38 CoreServices
39 ];
40 nativeCheckInputs = [
41 tox
42 flake8
43 alabaster
44 ];
45
46 meta = with lib; {
47 description = "A Python binding for the RtMidi C++ library implemented using Cython";
48 homepage = "https://github.com/SpotlightKid/python-rtmidi";
49 license = licenses.mit;
50 maintainers = with maintainers; [ hexa ];
51 };
52}