1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 isPy3k,
6 fetchFromGitHub,
7 setuptools,
8 appdirs,
9 consonance,
10 protobuf,
11 python-axolotl,
12 six,
13 pyasyncore,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "yowsup";
19 version = "3.3.0";
20 pyproject = true;
21
22 # The Python 2.x support of this package is incompatible with `six==1.11`:
23 # https://github.com/tgalal/yowsup/issues/2416#issuecomment-365113486
24 disabled = !isPy3k;
25
26 src = fetchFromGitHub {
27 owner = "tgalal";
28 repo = "yowsup";
29 tag = "v${version}";
30 sha256 = "1pz0r1gif15lhzdsam8gg3jm6zsskiv2yiwlhaif5rl7lv3p0v7q";
31 };
32
33 pythonRelaxDeps = true;
34 pythonRemoveDeps = [ "argparse" ];
35
36 env = {
37 # make protobuf compatible with old versions
38 # https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
39 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";
40 };
41
42 build-system = [ setuptools ];
43
44 nativeCheckInputs = [ pytestCheckHook ];
45
46 dependencies = [
47 appdirs
48 consonance
49 protobuf
50 python-axolotl
51 six
52 ]
53 ++ lib.optionals (!pythonOlder "3.12") [ pyasyncore ];
54
55 meta = {
56 homepage = "https://github.com/tgalal/yowsup";
57 description = "Python WhatsApp library";
58 mainProgram = "yowsup-cli";
59 license = lib.licenses.gpl3Plus;
60 maintainers = [ ];
61 };
62}