2020-11-09 15:59:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-06-28 23:13:55 +00:00
|
|
|
, mock
|
2020-11-09 15:59:12 +00:00
|
|
|
, smbus-cffi
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bme680";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "1.1.1";
|
2020-11-09 15:59:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pimoroni";
|
|
|
|
repo = "bme680-python";
|
|
|
|
rev = "v${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-gmdRxMJ0DoCyNcb/bYp746PBi4HktHAAYOcSQJ0Uheg=";
|
2020-11-09 15:59:12 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
smbus-cffi
|
|
|
|
];
|
2020-11-09 15:59:12 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd library
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
checkInputs = [
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace library/setup.cfg \
|
|
|
|
--replace "smbus" "smbus-cffi"
|
|
|
|
'';
|
2020-11-09 15:59:12 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "bme680" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for driving the Pimoroni BME680 Breakout";
|
|
|
|
homepage = "https://github.com/pimoroni/bme680-python";
|
|
|
|
license = licenses.mit;
|
2020-12-03 08:41:04 +00:00
|
|
|
platforms = platforms.linux;
|
2020-11-09 15:59:12 +00:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
|
|
|
};
|
|
|
|
}
|