1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 appdirs,
7 click,
8 click-log,
9 looseversion,
10 paho-mqtt,
11 pyaml,
12 pyserial,
13 schema,
14 simplejson,
15}:
16buildPythonPackage rec {
17 pname = "bcg";
18 version = "1.17.0";
19 format = "setuptools";
20
21 src = fetchFromGitHub {
22 owner = "hardwario";
23 repo = "bch-gateway";
24 rev = "v${version}";
25 sha256 = "2Yh5MeIv+BIxjoO9GOPqq7xTAFhyBvnxPy7DeO2FrkI=";
26 };
27
28 patches = [
29 (fetchpatch {
30 # https://github.com/hardwario/bch-gateway/pull/19
31 name = "bcg-fix-import-with-Python-3.12.patch";
32 url = "https://github.com/hardwario/bch-gateway/pull/19/commits/1314c892992d8914802b6c42602c39f6a1418fca.patch";
33 hash = "sha256-dNiBppXjPSMUe2yiiSc9gGbAc8l4mI41wWq+g7PkD/Y=";
34 })
35 ];
36 postPatch = ''
37 sed -ri 's/@@VERSION@@/${version}/g' \
38 bcg/__init__.py setup.py
39 '';
40
41 propagatedBuildInputs = [
42 appdirs
43 click
44 click-log
45 looseversion
46 paho-mqtt
47 pyaml
48 pyserial
49 schema
50 simplejson
51 ];
52
53 pythonImportsCheck = [ "bcg" ];
54
55 meta = with lib; {
56 homepage = "https://github.com/hardwario/bch-gateway";
57 description = "HARDWARIO Gateway (Python Application «bcg»)";
58 mainProgram = "bcg";
59 platforms = platforms.linux;
60 license = licenses.mit;
61 maintainers = with maintainers; [ cynerd ];
62 };
63}