2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
substituteAll,
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build
|
|
|
|
pkg-config,
|
|
|
|
glibc,
|
|
|
|
python,
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# runtime
|
|
|
|
bluez,
|
|
|
|
boost,
|
|
|
|
glib,
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "gattlib";
|
|
|
|
version = "unstable-2021-06-16";
|
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version;
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oscaracena";
|
|
|
|
repo = "pygattlib";
|
|
|
|
rev = "7bdb229124fe7d9f4a2cc090277b0fdef82e2a56";
|
|
|
|
hash = "sha256-PS5DIH1JuH2HweyebLLM+UNFGY/XsjKIrsD9x7g7yMI=";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./setup.patch;
|
2024-06-05 15:53:02 +00:00
|
|
|
boost_version =
|
|
|
|
let
|
|
|
|
pythonVersion = with lib.versions; "${major python.version}${minor python.version}";
|
|
|
|
in
|
2022-04-15 01:41:22 +00:00
|
|
|
"boost_python${pythonVersion}";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
glibc
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bluez
|
|
|
|
boost
|
|
|
|
glib
|
|
|
|
];
|
|
|
|
|
|
|
|
# has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "gattlib" ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library to use the GATT Protocol for Bluetooth LE devices";
|
|
|
|
homepage = "https://github.com/oscaracena/pygattlib";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|