Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / mautrix-facebook / default.nix
blobcb7897853b520d6b1c8fa38c6b7ffc4f797b4932
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , python3
5 , enableSystemd ? lib.meta.availableOn stdenv.hostPlatform python3.pkgs.systemd
6 }:
8 python3.pkgs.buildPythonPackage rec {
9   pname = "mautrix-facebook";
10   version = "0.5.1";
12   src = fetchFromGitHub {
13     owner = "mautrix";
14     repo = "facebook";
15     rev = "v${version}";
16     hash = "sha256-8uleN7L3fgNqqRjva3kJU7fLPJZpO6b0J4z0RxZ9B64=";
17   };
19   propagatedBuildInputs = with python3.pkgs; [
20     commonmark
21     aiohttp
22     asyncpg
23     commonmark
24     mautrix
25     paho-mqtt
26     pillow
27     prometheus-client
28     pycryptodome
29     python-olm
30     python-magic
31     ruamel-yaml
32     unpaddedbase64
33     yarl
34     zstandard
35   ] ++ lib.optional enableSystemd systemd;
37   postPatch = ''
38     # Drop version limiting so that every dependency update doesn't break this package.
39     sed -i -e 's/,<.*//' requirements.txt
40   '';
42   postInstall = ''
43     mkdir -p $out/bin
45     cat <<-END >$out/bin/mautrix-facebook
46     #!/bin/sh
47     PYTHONPATH="$PYTHONPATH" exec ${python3}/bin/python -m mautrix_facebook "\$@"
48     END
49     chmod +x $out/bin/mautrix-facebook
50   '';
52   checkPhase = ''
53     $out/bin/mautrix-facebook --help
54   '';
56   meta = with lib; {
57     homepage = "https://github.com/mautrix/facebook";
58     changelog = "https://github.com/mautrix/facebook/releases/tag/v${version}";
59     description = "Matrix-Facebook Messenger puppeting bridge";
60     license = licenses.agpl3Plus;
61     maintainers = with maintainers; [ kevincox ];
62     mainProgram = "mautrix-facebook";
63   };