1{ lib 2, stdenv 3, buildPythonPackage 4, fetchPypi 5, gcc 6, cython 7, boost 8, bluez 9, nlohmann_json 10, pyserial 11, requests 12, warble 13}: 14 15buildPythonPackage rec { 16 pname = "metawear"; 17 version = "1.0.8"; 18 format = "setuptools"; 19 20 src = fetchPypi { 21 inherit pname version; 22 hash = "sha256-gNEI6P6GslNd1DzFwCFndVIfUvSTPYollGdqkZhQ4Y8="; 23 }; 24 25 nativeBuildInputs = [ 26 cython 27 ]; 28 29 buildInputs = [ 30 boost 31 bluez 32 nlohmann_json 33 ]; 34 35 postPatch = '' 36 # remove vendored nlohmann_json 37 rm MetaWear-SDK-Cpp/src/metawear/dfu/cpp/json.hpp 38 substituteInPlace MetaWear-SDK-Cpp/src/metawear/dfu/cpp/file_operations.cpp \ 39 --replace '#include "json.hpp"' '#include <nlohmann/json.hpp>' 40 ''; 41 42 propagatedBuildInputs = [ 43 pyserial 44 requests 45 warble 46 ]; 47 48 enableParallelBuilding = true; 49 50 pythonImportsCheck = [ "mbientlab" "mbientlab.metawear" ]; 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} 60