2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-07-31 10:19:44 +00:00
|
|
|
fetchpatch2,
|
2024-06-05 15:53:02 +00:00
|
|
|
mock,
|
|
|
|
pyserial,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2021-01-09 10:05:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pylacrosse";
|
|
|
|
version = "0.4";
|
2023-04-29 16:46:19 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hthiery";
|
|
|
|
repo = "python-lacrosse";
|
2023-04-29 16:46:19 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-jrkehoPLYbutDfxMBO/vlx4nMylTNs/gtvoBTFHFsDw=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
patches = [
|
|
|
|
# Migrate to pytest, https://github.com/hthiery/python-lacrosse/pull/17
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/hthiery/python-lacrosse/commit/cc2623c667bc252360a9b5ccb4fc05296cf23d9c.patch?full_index=1";
|
|
|
|
hash = "sha256-LKryLnXMKj1lVClneyHNVOWM5KPPhOGy0/FX/7Qy/jU=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "version = version," "version = '${version}',"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ pyserial ];
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-01-09 10:05:03 +00:00
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pylacrosse" ];
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for Jeelink LaCrosse";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pylacrosse";
|
2021-01-09 10:05:03 +00:00
|
|
|
homepage = "https://github.com/hthiery/python-lacrosse";
|
|
|
|
license = with licenses; [ lgpl2Plus ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|