2023-02-02 18:25:31 +00:00
|
|
|
{ fetchFromGitHub
|
|
|
|
, fetchpatch
|
2023-01-11 07:51:40 +00:00
|
|
|
, lib
|
|
|
|
, python3
|
2023-02-02 18:25:31 +00:00
|
|
|
, enableE2be ? true
|
|
|
|
, enableMetrics ? true
|
|
|
|
, enableSqlite ? true
|
2023-01-11 07:51:40 +00:00
|
|
|
}: python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "mautrix-googlechat";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.5.1";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mautrix";
|
|
|
|
repo = "googlechat";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-a/EWz/aCkBE6XdDpmZcx2Q7/xKNwGCiZUhZc9YIIDhU=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# patch setup.py to generate $out/bin/mautrix-googlechat
|
|
|
|
# https://github.com/mautrix/googlechat/pull/81
|
|
|
|
name = "mautrix-googlechat-entry-point.patch";
|
|
|
|
url = "https://github.com/mautrix/googlechat/pull/81/commits/112fa3d27bc6f89a02321cb80d219de149e00df8.patch";
|
|
|
|
sha256 = "sha256-DsITDNLsIgBIqN6sD5JHaFW0LToxVUTzWc7mE2L09IQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
baseConfigPath = "share/mautrix-googlechat/example-config.yaml";
|
|
|
|
postInstall = ''
|
|
|
|
rm $out/example-config.yaml
|
|
|
|
install -D mautrix_googlechat/example-config.yaml $out/$baseConfigPath
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.optional-dependencies = with python3.pkgs; {
|
|
|
|
e2be = [
|
|
|
|
python-olm
|
|
|
|
pycryptodome
|
|
|
|
unpaddedbase64
|
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
metrics = [
|
|
|
|
prometheus-client
|
|
|
|
];
|
|
|
|
sqlite = [
|
|
|
|
aiosqlite
|
|
|
|
];
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
aiohttp
|
2023-03-15 16:39:30 +00:00
|
|
|
commonmark
|
2023-01-11 07:51:40 +00:00
|
|
|
yarl
|
|
|
|
asyncpg
|
|
|
|
ruamel-yaml
|
2023-03-15 16:39:30 +00:00
|
|
|
commonmark
|
2023-01-11 07:51:40 +00:00
|
|
|
python-magic
|
2023-08-04 22:07:22 +00:00
|
|
|
protobuf
|
2023-01-11 07:51:40 +00:00
|
|
|
mautrix
|
|
|
|
] ++ lib.optionals enableE2be passthru.optional-dependencies.e2be
|
|
|
|
++ lib.optionals enableMetrics passthru.optional-dependencies.metrics
|
|
|
|
++ lib.optionals enableSqlite passthru.optional-dependencies.sqlite;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/mautrix/googlechat";
|
|
|
|
description = "A Matrix-Google Chat puppeting bridge";
|
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ arcnmx ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "mautrix-googlechat";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
}
|