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