Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 stdenv, 3 lib, 4 buildPythonPackage, 5 fetchPypi, 6 substituteAll, 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.2"; 32 pyproject = true; 33 34 disabled = pythonOlder "3.7"; 35 36 src = fetchPypi { 37 inherit pname version; 38 hash = "sha256-Ouootu1zD3N9WxLaNXjevp3FAFj6Nw/pzt7ZGJtnw0g="; 39 }; 40 41 patches = [ 42 (substituteAll { 43 src = ./libportmidi-cdll.patch; 44 libportmidi = "${portmidi.out}/lib/libportmidi${stdenv.hostPlatform.extensions.sharedLibrary}"; 45 }) 46 ]; 47 48 build-system = [ 49 setuptools 50 setuptools-scm 51 ]; 52 53 pythonRelaxDeps = [ "packaging" ]; 54 55 dependencies = [ packaging ]; 56 57 optional-dependencies = { 58 ports-pygame = [ pygame ]; 59 ports-rtmidi = [ python-rtmidi ]; 60 ports-rtmidi-python = [ rtmidi-python ]; 61 }; 62 63 nativeCheckInputs = [ pytestCheckHook ]; 64 65 pythonImportsCheck = [ "mido" ]; 66 67 meta = with lib; { 68 description = "MIDI Objects for Python"; 69 homepage = "https://mido.readthedocs.io"; 70 changelog = "https://github.com/mido/mido/releases/tag/${version}"; 71 license = licenses.mit; 72 maintainers = [ ]; 73 }; 74}