Files
nixpkgs/pkgs/development/python-modules/bleak/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

74 lines
1.6 KiB
Nix

{
lib,
stdenv,
async-timeout,
bluez,
buildPythonPackage,
dbus-fast,
fetchFromGitHub,
poetry-core,
pytest-asyncio,
pytestCheckHook,
pythonOlder,
typing-extensions,
pyobjc-core,
pyobjc-framework-CoreBluetooth,
pyobjc-framework-libdispatch,
}:
buildPythonPackage rec {
pname = "bleak";
version = "1.1.1";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "hbldh";
repo = "bleak";
tag = "v${version}";
hash = "sha256-z0Mxr1pUQWNEK01PKMV/CzpW+GeCRcv/+9BADts1FuU=";
};
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
# bleak checks BlueZ's version with a call to `bluetoothctl --version`
substituteInPlace bleak/backends/bluezdbus/version.py \
--replace-fail \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
'';
build-system = [ poetry-core ];
dependencies = [
]
++ lib.optionals stdenv.hostPlatform.isLinux [
dbus-fast
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
pyobjc-core
pyobjc-framework-CoreBluetooth
pyobjc-framework-libdispatch
]
++ lib.optionals (pythonOlder "3.12") [
typing-extensions
]
++ lib.optionals (pythonOlder "3.11") [
async-timeout
];
nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
];
pythonImportsCheck = [ "bleak" ];
meta = {
description = "Bluetooth Low Energy platform agnostic client";
homepage = "https://github.com/hbldh/bleak";
changelog = "https://github.com/hbldh/bleak/blob/${src.tag}/CHANGELOG.rst";
license = lib.licenses.mit;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [ oxzi ];
};
}