1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 mock,
6 smbus-cffi,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "bme680";
12 version = "1.1.1";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "pimoroni";
17 repo = "bme680-python";
18 rev = "v${version}";
19 hash = "sha256-gmdRxMJ0DoCyNcb/bYp746PBi4HktHAAYOcSQJ0Uheg=";
20 };
21
22 propagatedBuildInputs = [ smbus-cffi ];
23
24 preBuild = ''
25 cd library
26 '';
27
28 nativeCheckInputs = [
29 mock
30 pytestCheckHook
31 ];
32
33 postPatch = ''
34 substituteInPlace library/setup.cfg \
35 --replace "smbus" "smbus-cffi"
36 '';
37
38 pythonImportsCheck = [ "bme680" ];
39
40 meta = with lib; {
41 description = "Python library for driving the Pimoroni BME680 Breakout";
42 homepage = "https://github.com/pimoroni/bme680-python";
43 license = licenses.mit;
44 platforms = platforms.linux;
45 maintainers = with maintainers; [ mic92 ];
46 };
47}