1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cryptography
5, cython_3
6, poetry-core
7, pytestCheckHook
8, pythonOlder
9, setuptools
10}:
11
12buildPythonPackage rec {
13 pname = "bluetooth-data-tools";
14 version = "1.14.0";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.9";
18
19 src = fetchFromGitHub {
20 owner = "Bluetooth-Devices";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-eO17EuZ9K6tLAyEGmTaxw1Cxfz3XPPwNCcIwZ2/uHug=";
24 };
25
26 # The project can build both an optimized cython version and an unoptimized
27 # python version. This ensures we fail if we build the wrong one.
28 env.REQUIRE_CYTHON = 1;
29
30 nativeBuildInputs = [
31 cython_3
32 poetry-core
33 setuptools
34 ];
35
36 propagatedBuildInputs = [
37 cryptography
38 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 ];
43
44 postPatch = ''
45 substituteInPlace pyproject.toml \
46 --replace " --cov=bluetooth_data_tools --cov-report=term-missing:skip-covered" ""
47 '';
48
49 pythonImportsCheck = [
50 "bluetooth_data_tools"
51 ];
52
53 meta = with lib; {
54 description = "Library for converting bluetooth data and packets";
55 homepage = "https://github.com/Bluetooth-Devices/bluetooth-data-tools";
56 changelog = "https://github.com/Bluetooth-Devices/bluetooth-data-tools/blob/v${version}/CHANGELOG.md";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ fab ];
59 };
60}