at master 1.3 kB view raw
1{ 2 stdenv, 3 lib, 4 buildPythonPackage, 5 fetchPypi, 6 replaceVars, 7 8 # build-system 9 setuptools, 10 setuptools-scm, 11 12 # dependencies 13 packaging, 14 15 # native dependencies 16 portmidi, 17 18 # optional-dependencies 19 pygame, 20 python-rtmidi, 21 rtmidi-python, 22 23 # tests 24 pytestCheckHook, 25 pythonOlder, 26 27}: 28 29buildPythonPackage rec { 30 pname = "mido"; 31 version = "1.3.3"; 32 pyproject = true; 33 34 disabled = pythonOlder "3.7"; 35 36 src = fetchPypi { 37 inherit pname version; 38 hash = "sha256-GuyzC38oJATxfkN2jL90pqMb8is7eDvdEXoc6dIst0w="; 39 }; 40 41 patches = [ 42 (replaceVars ./libportmidi-cdll.patch { 43 libportmidi = "${portmidi.out}/lib/libportmidi${stdenv.hostPlatform.extensions.sharedLibrary}"; 44 }) 45 ]; 46 47 build-system = [ 48 setuptools 49 setuptools-scm 50 ]; 51 52 pythonRelaxDeps = [ "packaging" ]; 53 54 dependencies = [ packaging ]; 55 56 optional-dependencies = { 57 ports-pygame = [ pygame ]; 58 ports-rtmidi = [ python-rtmidi ]; 59 ports-rtmidi-python = [ rtmidi-python ]; 60 }; 61 62 nativeCheckInputs = [ pytestCheckHook ]; 63 64 pythonImportsCheck = [ "mido" ]; 65 66 meta = with lib; { 67 description = "MIDI Objects for Python"; 68 homepage = "https://mido.readthedocs.io"; 69 changelog = "https://github.com/mido/mido/releases/tag/${version}"; 70 license = licenses.mit; 71 maintainers = [ ]; 72 }; 73}