2021-06-28 23:13:55 +00:00
|
|
|
{ lib, python3, fetchFromGitHub }:
|
2021-04-25 03:57:28 +00:00
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
python3.pkgs.buildPythonPackage rec {
|
2021-04-25 03:57:28 +00:00
|
|
|
pname = "mautrix-signal";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "0.4.2";
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-12-06 16:07:01 +00:00
|
|
|
owner = "mautrix";
|
|
|
|
repo = "signal";
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
sha256 = "sha256-UbetU1n9zD/mVFaJc9FECDq/Zell1TI/aYPsGXGB8Js=";
|
2021-04-25 03:57:28 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
# the version mangling in mautrix_signal/get_version.py interacts badly with pythonRelaxDepsHook
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'version=version' 'version="${version}"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"mautrix"
|
|
|
|
];
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2021-04-25 03:57:28 +00:00
|
|
|
CommonMark
|
|
|
|
aiohttp
|
|
|
|
asyncpg
|
|
|
|
attrs
|
|
|
|
mautrix
|
|
|
|
phonenumbers
|
|
|
|
pillow
|
2021-08-27 14:25:00 +00:00
|
|
|
prometheus-client
|
2021-04-25 03:57:28 +00:00
|
|
|
pycryptodome
|
|
|
|
python-olm
|
2022-05-18 14:49:53 +00:00
|
|
|
python-magic
|
2021-04-25 03:57:28 +00:00
|
|
|
qrcode
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2021-04-25 03:57:28 +00:00
|
|
|
unpaddedbase64
|
|
|
|
yarl
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
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
|
2021-05-03 20:48:10 +00:00
|
|
|
exec python -m mautrix_signal \"\$@\"
|
2021-04-25 03:57:28 +00:00
|
|
|
" > $out/bin/mautrix-signal
|
|
|
|
chmod +x $out/bin/mautrix-signal
|
|
|
|
wrapProgram $out/bin/mautrix-signal \
|
2022-09-22 12:36:57 +00:00
|
|
|
--prefix PATH : "${python3}/bin" \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH"
|
2021-04-25 03:57:28 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/mautrix/signal";
|
2021-04-25 03:57:28 +00:00
|
|
|
description = "A Matrix-Signal puppeting bridge";
|
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ expipiplus1 ];
|
|
|
|
};
|
|
|
|
}
|