1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 cython,
6 boost,
7 bluez,
8 nlohmann_json,
9 pyserial,
10 requests,
11 warble,
12}:
13
14buildPythonPackage rec {
15 pname = "metawear";
16 version = "1.0.8";
17 format = "setuptools";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-gNEI6P6GslNd1DzFwCFndVIfUvSTPYollGdqkZhQ4Y8=";
22 };
23
24 nativeBuildInputs = [ cython ];
25
26 buildInputs = [
27 boost
28 bluez
29 nlohmann_json
30 ];
31
32 postPatch = ''
33 # remove vendored nlohmann_json
34 rm MetaWear-SDK-Cpp/src/metawear/dfu/cpp/json.hpp
35 substituteInPlace MetaWear-SDK-Cpp/src/metawear/dfu/cpp/file_operations.cpp \
36 --replace '#include "json.hpp"' '#include <nlohmann/json.hpp>'
37 '';
38
39 propagatedBuildInputs = [
40 pyserial
41 requests
42 warble
43 ];
44
45 enableParallelBuilding = true;
46
47 pythonImportsCheck = [
48 "mbientlab"
49 "mbientlab.metawear"
50 ];
51
52 meta = with lib; {
53 description = "Python bindings for the MetaWear C++ SDK by MbientLab";
54 homepage = "https://github.com/mbientlab/metawear-sdk-python";
55 license = with licenses; [ unfree ];
56 maintainers = with maintainers; [ stepbrobd ];
57 platforms = platforms.linux;
58 };
59}