2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
setuptools,
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# docs
|
|
|
|
sphinx-rtd-theme,
|
|
|
|
sphinxHook,
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
colorzero,
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gpiozero";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.0.1";
|
|
|
|
pyproject = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gpiozero";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-ifdCFcMH6SrhKQK/TJJ5lJafSfAUzd6ZT5ANUzJGwxI=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace " --cov" ""
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"doc"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
setuptools
|
2022-08-12 12:06:08 +00:00
|
|
|
sphinx-rtd-theme
|
|
|
|
sphinxHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ colorzero ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"gpiozero"
|
|
|
|
"gpiozero.tools"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabledTests = [
|
|
|
|
# https://github.com/gpiozero/gpiozero/issues/1087
|
|
|
|
"test_spi_hardware_write"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple interface to GPIO devices with Raspberry Pi";
|
|
|
|
homepage = "https://github.com/gpiozero/gpiozero";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/gpiozero/gpiozero/blob/v${version}/docs/changelog.rst";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = licenses.bsd3;
|
2022-11-21 17:40:18 +00:00
|
|
|
platforms = platforms.linux;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|