1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, unittestCheckHook 6, pythonOlder 7, isPy3k 8}: 9 10buildPythonPackage rec { 11 pname = "pyserial"; 12 version = "3.5"; 13 format = "setuptools"; 14 15 # Supports Python 2.7 and 3.4+ 16 disabled = isPy3k && pythonOlder "3.4"; 17 18 src = fetchPypi { 19 inherit pname version; 20 hash = "sha256-PHfgFBcN//vYFub/wgXphC77EL6fWOwW0+hnW0klzds="; 21 }; 22 23 patches = [ 24 ./001-rfc2217-only-negotiate-on-value-change.patch 25 ./002-rfc2217-timeout-setter-for-rfc2217.patch 26 ]; 27 28 doCheck = !stdenv.hostPlatform.isDarwin; # broken on darwin 29 30 nativeCheckInputs = [ unittestCheckHook ]; 31 32 unittestFlagsArray = [ "-s" "test" ]; 33 34 pythonImportsCheck = [ 35 "serial" 36 ]; 37 38 meta = with lib; { 39 description = "Python serial port extension"; 40 homepage = "https://github.com/pyserial/pyserial"; 41 license = licenses.bsd3; 42 maintainers = with maintainers; [ makefu ]; 43 }; 44}