nixpkgs/pkgs/servers/mautrix-signal/default.nix

62 lines
1.4 KiB
Nix
Raw Normal View History

2021-06-21 17:29:34 +00:00
{ lib, python3, fetchFromGitHub }:
python3.pkgs.buildPythonPackage rec {
pname = "mautrix-signal";
version = "0.4.1";
src = fetchFromGitHub {
2021-11-17 12:23:31 +00:00
owner = "mautrix";
repo = "signal";
2022-10-22 19:35:18 +00:00
rev = "refs/tags/v${version}";
sha256 = "sha256-WcyBv7b1JxiZJSqxgAUUgTa5Q/aNzU9SfXfdXKVuuXQ=";
};
propagatedBuildInputs = with python3.pkgs; [
CommonMark
aiohttp
asyncpg
attrs
mautrix
phonenumbers
pillow
prometheus-client
pycryptodome
python-olm
python-magic
qrcode
ruamel-yaml
unpaddedbase64
yarl
];
doCheck = false;
2022-08-28 11:52:13 +00:00
postPatch = ''
substituteInPlace requirements.txt \
--replace "asyncpg>=0.20,<0.26" "asyncpg>=0.20" \
--replace "mautrix>=0.16.0,<0.17" "mautrix>=0.16.0"
'';
postInstall = ''
mkdir -p $out/bin
# Make a little wrapper for running mautrix-signal with its dependencies
echo "$mautrixSignalScript" > $out/bin/mautrix-signal
echo "#!/bin/sh
exec python -m mautrix_signal \"\$@\"
" > $out/bin/mautrix-signal
chmod +x $out/bin/mautrix-signal
wrapProgram $out/bin/mautrix-signal \
--prefix PATH : "${python3}/bin" \
--prefix PYTHONPATH : "$PYTHONPATH"
'';
meta = with lib; {
2021-11-17 12:23:31 +00:00
homepage = "https://github.com/mautrix/signal";
description = "A Matrix-Signal puppeting bridge";
license = licenses.agpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ expipiplus1 ];
};
}