mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-09 14:33:22 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
74 lines
1.9 KiB
Nix
74 lines
1.9 KiB
Nix
{ fetchFromGitHub
|
|
, fetchpatch
|
|
, lib
|
|
, python3
|
|
, enableE2be ? true
|
|
, enableMetrics ? true
|
|
, enableSqlite ? true
|
|
}: python3.pkgs.buildPythonApplication rec {
|
|
pname = "mautrix-googlechat";
|
|
version = "0.5.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mautrix";
|
|
repo = "googlechat";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-4H+zUH0GEQ5e/9Bv0BVdf1/pXulx2ihZrhJ+jl/db+U=";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
optional-dependencies = with python3.pkgs; {
|
|
e2be = [
|
|
python-olm
|
|
pycryptodome
|
|
unpaddedbase64
|
|
];
|
|
metrics = [
|
|
prometheus-client
|
|
];
|
|
sqlite = [
|
|
aiosqlite
|
|
];
|
|
};
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
aiohttp
|
|
commonmark
|
|
yarl
|
|
asyncpg
|
|
ruamel-yaml
|
|
commonmark
|
|
python-magic
|
|
protobuf
|
|
(mautrix.override { withOlm = enableE2be; })
|
|
] ++ lib.optionals enableE2be optional-dependencies.e2be
|
|
++ lib.optionals enableMetrics optional-dependencies.metrics
|
|
++ lib.optionals enableSqlite optional-dependencies.sqlite;
|
|
|
|
doCheck = false;
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/mautrix/googlechat";
|
|
description = "Matrix-Google Chat puppeting bridge";
|
|
license = licenses.agpl3Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ arcnmx ];
|
|
mainProgram = "mautrix-googlechat";
|
|
};
|
|
}
|