2022-06-26 10:26:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, python
|
|
|
|
, pythonOlder
|
2022-07-14 12:49:19 +00:00
|
|
|
, isPy3k
|
2022-06-26 10:26:21 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyserial";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "3.5";
|
|
|
|
format = "setuptools";
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
# Supports Python 2.7 and 3.4+
|
|
|
|
disabled = isPy3k && pythonOlder "3.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-06-26 10:26:21 +00:00
|
|
|
hash = "sha256-PHfgFBcN//vYFub/wgXphC77EL6fWOwW0+hnW0klzds=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
patches = [
|
|
|
|
./001-rfc2217-only-negotiate-on-value-change.patch
|
|
|
|
./002-rfc2217-timeout-setter-for-rfc2217.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin; # broken on darwin
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
${python.interpreter} -m unittest discover -s test
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"serial"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python serial port extension";
|
2022-06-26 10:26:21 +00:00
|
|
|
homepage = "https://github.com/pyserial/pyserial";
|
|
|
|
license = licenses.bsd3;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ makefu ];
|
|
|
|
};
|
|
|
|
}
|