From eef496f01c2b7d11e21d3f07e049f1f1ca752ecd Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 14 Oct 2017 11:54:59 +0200 Subject: [PATCH] pythonPackages.yowsup: init at v2.5.2 (#30406) * pythonPackages.yowsup: init at v2.5.2 * python.pkgs.yowsup: fix tests --- .../yowsup/argparse-dependency.patch | 13 ++++++++ .../python-modules/yowsup/default.nix | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 3 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/yowsup/argparse-dependency.patch create mode 100644 pkgs/development/python-modules/yowsup/default.nix diff --git a/pkgs/development/python-modules/yowsup/argparse-dependency.patch b/pkgs/development/python-modules/yowsup/argparse-dependency.patch new file mode 100644 index 000000000000..364f0054fe78 --- /dev/null +++ b/pkgs/development/python-modules/yowsup/argparse-dependency.patch @@ -0,0 +1,13 @@ +diff --git a/setup.py b/setup.py +index 053ed07..60f0d9a 100755 +--- a/setup.py ++++ b/setup.py +@@ -5,7 +5,7 @@ import yowsup + import platform + import sys + +-deps = ['python-dateutil', 'argparse', 'python-axolotl>=0.1.39', 'six'] ++deps = ['python-dateutil', 'python-axolotl>=0.1.39', 'six'] + + if sys.version_info < (2,7): + deps += ['importlib'] diff --git a/pkgs/development/python-modules/yowsup/default.nix b/pkgs/development/python-modules/yowsup/default.nix new file mode 100644 index 000000000000..fce974ccd3ac --- /dev/null +++ b/pkgs/development/python-modules/yowsup/default.nix @@ -0,0 +1,30 @@ +{ buildPythonPackage, stdenv, fetchFromGitHub, six, python-axolotl, pytest }: + +buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "yowsup"; + version = "2.5.2"; + + src = fetchFromGitHub { + owner = "tgalal"; + repo = "yowsup"; + rev = "v${version}"; + sha256 = "16l8jmr32wwvl11m0a4r4id3dkfqj2n7dn6gky1077xwmj2da4fl"; + }; + + checkInputs = [ pytest ]; + checkPhase = '' + HOME=$(mktemp -d) py.test yowsup + ''; + + patches = [ ./argparse-dependency.patch ]; + + propagatedBuildInputs = [ six python-axolotl ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/tgalal/yowsup"; + description = "The python WhatsApp library"; + license = licenses.gpl3; + maintainers = with maintainers; [ ma27 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index facb6eb25b36..5c2b10003cab 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -26537,6 +26537,8 @@ EOF }; }; + yowsup = callPackage ../development/python-modules/yowsup { }; + wptserve = callPackage ../development/python-modules/wptserve { }; yenc = callPackage ../development/python-modules/yenc { };