1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, cython 6, alsa-lib 7, CoreAudio 8, CoreMIDI 9, CoreServices 10}: 11 12buildPythonPackage rec { 13 pname = "rtmidi-python"; 14 version = "0.2.2"; 15 16 src = fetchPypi { 17 inherit pname version; 18 sha256 = "1wpcaxfpbmsjc78g8841kpixr0a3v6zn0ak058s3mm25kcysp4m0"; 19 }; 20 21 postPatch = '' 22 rm rtmidi_python.cpp 23 ''; 24 25 nativeBuildInputs = [ cython ]; 26 buildInputs = lib.optionals stdenv.isLinux [ 27 alsa-lib 28 ] ++ lib.optionals stdenv.isDarwin [ 29 CoreAudio 30 CoreMIDI 31 CoreServices 32 ]; 33 34 setupPyBuildFlags = [ "--from-cython" ]; 35 36 # package has no tests 37 doCheck = false; 38 39 pythonImportsCheck = [ 40 "rtmidi_python" 41 ]; 42 43 meta = with lib; { 44 description = "Python wrapper for RtMidi"; 45 homepage = "https://github.com/superquadratic/rtmidi-python"; 46 license = licenses.mit; 47 maintainers = with maintainers; [ ]; 48 }; 49}