2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
cython,
|
|
|
|
poetry-core,
|
|
|
|
setuptools,
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
habluetooth,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
bleak,
|
|
|
|
pytestCheckHook,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "home-assistant-bluetooth";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "1.12.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabled = pythonOlder "3.11";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "home-assistant-libs";
|
2024-01-13 08:15:51 +00:00
|
|
|
repo = "home-assistant-bluetooth";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-KTaZ3xbZpBIN5zP73YdJW6QeCQThGdqejnfWwvL+0R8=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/home-assistant-libs/home-assistant-bluetooth/issues/38
|
|
|
|
./habluetooth-3.0-compat.patch
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postPatch = ''
|
|
|
|
# drop pytest parametrization (coverage, etc.)
|
|
|
|
sed -i '/addopts/d' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
cython
|
2022-08-12 12:06:08 +00:00
|
|
|
poetry-core
|
2022-12-17 10:02:37 +00:00
|
|
|
setuptools
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ habluetooth ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "home_assistant_bluetooth" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
bleak
|
2022-08-12 12:06:08 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Basic bluetooth models used by Home Assistant";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/home-assistant-libs/home-assistant-bluetooth/blob/v${version}/CHANGELOG.md";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://github.com/home-assistant-libs/home-assistant-bluetooth";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = teams.home-assistant.members;
|
|
|
|
};
|
|
|
|
}
|