mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-16 18:24:04 +00:00
Diff: https://github.com/hbldh/bleak/compare/v2.1.1...v3.0.2 Changelog: https://github.com/hbldh/bleak/blob/v3.0.2/CHANGELOG.rst
74 lines
1.7 KiB
Nix
74 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
bluez,
|
|
buildPythonPackage,
|
|
bumble,
|
|
dbus-fast,
|
|
fetchFromGitHub,
|
|
pyobjc-core,
|
|
pyobjc-framework-CoreBluetooth,
|
|
pyobjc-framework-libdispatch,
|
|
pytest-asyncio,
|
|
pytest-cov-stub,
|
|
pytestCheckHook,
|
|
uv-build,
|
|
}:
|
|
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "bleak";
|
|
version = "3.0.2";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "hbldh";
|
|
repo = "bleak";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-I+nN3/KKF0PC9TO8SULXX1oOGUokYa2tlPVfEJ/0mbY=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace-fail "uv_build>=0.10.9,<0.11.0" "uv_build" \
|
|
--replace-fail "ignore:Couldn't import C tracer:coverage.exceptions.CoverageWarning" ""
|
|
''
|
|
# bleak checks BlueZ's version with a call to `bluetoothctl --version`
|
|
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
substituteInPlace bleak/backends/bluezdbus/version.py \
|
|
--replace-fail \
|
|
'"bluetoothctl"' \
|
|
'"${lib.getExe' bluez "bluetoothctl"}"'
|
|
'';
|
|
|
|
build-system = [ uv-build ];
|
|
|
|
dependencies = [
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
dbus-fast
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
pyobjc-core
|
|
pyobjc-framework-CoreBluetooth
|
|
pyobjc-framework-libdispatch
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
bumble
|
|
pytest-asyncio
|
|
pytest-cov-stub
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [ "bleak" ];
|
|
|
|
meta = {
|
|
description = "Bluetooth Low Energy platform agnostic client";
|
|
homepage = "https://github.com/hbldh/bleak";
|
|
changelog = "https://github.com/hbldh/bleak/blob/${finalAttrs.src.tag}/CHANGELOG.rst";
|
|
license = lib.licenses.mit;
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
maintainers = [ ];
|
|
};
|
|
})
|