Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / mautrix-googlechat / default.nix
blobe0f5bc80b8f1446077919df71213b7dfd0dc3434
1 { fetchFromGitHub
2 , fetchpatch
3 , lib
4 , python3
5 , enableE2be ? true
6 , enableMetrics ? true
7 , enableSqlite ? true
8 }: python3.pkgs.buildPythonApplication rec {
9   pname = "mautrix-googlechat";
10   version = "0.5.1";
12   src = fetchFromGitHub {
13     owner = "mautrix";
14     repo = "googlechat";
15     rev = "refs/tags/v${version}";
16     hash = "sha256-a/EWz/aCkBE6XdDpmZcx2Q7/xKNwGCiZUhZc9YIIDhU=";
17   };
19   patches = [
20     (fetchpatch {
21       # patch setup.py to generate $out/bin/mautrix-googlechat
22       # https://github.com/mautrix/googlechat/pull/81
23       name = "mautrix-googlechat-entry-point.patch";
24       url = "https://github.com/mautrix/googlechat/pull/81/commits/112fa3d27bc6f89a02321cb80d219de149e00df8.patch";
25       sha256 = "sha256-DsITDNLsIgBIqN6sD5JHaFW0LToxVUTzWc7mE2L09IQ=";
26     })
27   ];
29   baseConfigPath = "share/mautrix-googlechat/example-config.yaml";
30   postInstall = ''
31     rm $out/example-config.yaml
32     install -D mautrix_googlechat/example-config.yaml $out/$baseConfigPath
33   '';
35   passthru.optional-dependencies = with python3.pkgs; {
36     e2be = [
37       python-olm
38       pycryptodome
39       unpaddedbase64
40     ];
41     metrics = [
42       prometheus-client
43     ];
44     sqlite = [
45       aiosqlite
46     ];
47   };
49   propagatedBuildInputs = with python3.pkgs; [
50     aiohttp
51     commonmark
52     yarl
53     asyncpg
54     ruamel-yaml
55     commonmark
56     python-magic
57     protobuf
58     mautrix
59   ] ++ lib.optionals enableE2be passthru.optional-dependencies.e2be
60   ++ lib.optionals enableMetrics passthru.optional-dependencies.metrics
61   ++ lib.optionals enableSqlite passthru.optional-dependencies.sqlite;
63   doCheck = false;
65   meta = with lib; {
66     homepage = "https://github.com/mautrix/googlechat";
67     description = "Matrix-Google Chat puppeting bridge";
68     license = licenses.agpl3Plus;
69     platforms = platforms.linux;
70     maintainers = with maintainers; [ arcnmx ];
71     mainProgram = "mautrix-googlechat";
72   };