1{ buildPythonPackage, stdenv, fetchFromGitHub, six, python-axolotl, pytest
2, isPy3k
3}:
4
5buildPythonPackage rec {
6 name = "${pname}-${version}";
7 pname = "yowsup";
8 version = "2.5.2";
9
10 # python2 is currently incompatible with yowsup:
11 # https://github.com/tgalal/yowsup/issues/2325#issuecomment-343516519
12 disabled = !isPy3k;
13
14 src = fetchFromGitHub {
15 owner = "tgalal";
16 repo = "yowsup";
17 rev = "v${version}";
18 sha256 = "16l8jmr32wwvl11m0a4r4id3dkfqj2n7dn6gky1077xwmj2da4fl";
19 };
20
21 checkInputs = [ pytest ];
22 checkPhase = ''
23 HOME=$(mktemp -d) py.test yowsup
24 '';
25
26 patches = [ ./argparse-dependency.patch ];
27
28 propagatedBuildInputs = [ six python-axolotl ];
29
30 meta = with stdenv.lib; {
31 homepage = "https://github.com/tgalal/yowsup";
32 description = "The python WhatsApp library";
33 license = licenses.gpl3;
34 maintainers = with maintainers; [ ma27 ];
35 };
36}