1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, smbus-cffi
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "bme680";
11 version = "1.1.1";
12
13 src = fetchFromGitHub {
14 owner = "pimoroni";
15 repo = "bme680-python";
16 rev = "v${version}";
17 sha256 = "sha256-gmdRxMJ0DoCyNcb/bYp746PBi4HktHAAYOcSQJ0Uheg=";
18 };
19
20 propagatedBuildInputs = [
21 smbus-cffi
22 ];
23
24 preBuild = ''
25 cd library
26 '';
27
28 checkInputs = [
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}