2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonRelaxDepsHook,
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build-system
|
|
|
|
setuptools,
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# dependencies
|
|
|
|
async-timeout,
|
|
|
|
bellows,
|
|
|
|
click,
|
|
|
|
coloredlogs,
|
|
|
|
crc,
|
|
|
|
libgpiod,
|
|
|
|
typing-extensions,
|
|
|
|
zigpy,
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-timeout,
|
2023-10-09 19:29:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "universal-silabs-flasher";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.0.19";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NabuCasa";
|
|
|
|
repo = "universal-silabs-flasher";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-VoO9B27CNY2Cnt/Q2HsU6DVYkukQMgbIHc6xqfN0P7w=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail '"setuptools-git-versioning<2"' "" \
|
|
|
|
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ pythonRelaxDepsHook ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
# https://github.com/NabuCasa/universal-silabs-flasher/pull/50
|
|
|
|
"gpiod"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
async-timeout
|
|
|
|
bellows
|
|
|
|
click
|
|
|
|
coloredlogs
|
|
|
|
crc
|
|
|
|
typing-extensions
|
|
|
|
zigpy
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (stdenv.hostPlatform.isLinux) [ libgpiod ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-mock
|
|
|
|
pytest-timeout
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "universal_silabs_flasher" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/NabuCasa/universal-silabs-flasher/releases/tag/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "Flashes Silicon Labs radios running EmberZNet or CPC multi-pan firmware";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "universal-silabs-flasher";
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://github.com/NabuCasa/universal-silabs-flasher";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|