1{ stdenv
2, lib
3, buildPythonPackage
4, fetchPypi
5, substituteAll
6, portmidi
7, pygame
8, python-rtmidi
9, rtmidi-python
10, pytestCheckHook
11}:
12
13buildPythonPackage rec {
14 pname = "mido";
15 version = "1.2.10";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "17b38a8e4594497b850ec6e78b848eac3661706bfc49d484a36d91335a373499";
20 };
21
22 patches = [
23 (substituteAll {
24 src = ./libportmidi-cdll.patch;
25 libportmidi = "${portmidi.out}/lib/libportmidi${stdenv.targetPlatform.extensions.sharedLibrary}";
26 })
27 ];
28
29 propagatedBuildInputs = [
30 pygame
31 python-rtmidi
32 rtmidi-python
33 ];
34
35 checkInputs = [
36 pytestCheckHook
37 ];
38
39 pythonImportsCheck = [
40 "mido"
41 ];
42
43 meta = with lib; {
44 description = "MIDI Objects for Python";
45 homepage = "https://mido.readthedocs.io";
46 license = licenses.mit;
47 maintainers = with maintainers; [ ];
48 };
49}