about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/turses
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-08-28 12:43:26 +0100
committerJörg Thalheim <joerg@thalheim.io>2017-09-01 18:56:04 +0100
commit4a6295e6fbcfc0e13db74960b3f39b10c1335f67 (patch)
treec67e8057a42d6c3d3fdfb6c4b8cc764428a38dd2 /pkgs/applications/networking/instant-messengers/turses
parent8f932af2631131f2d02d41ead9596c3fb39d320e (diff)
turses: fix build
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/turses')
-rw-r--r--pkgs/applications/networking/instant-messengers/turses/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/applications/networking/instant-messengers/turses/default.nix b/pkgs/applications/networking/instant-messengers/turses/default.nix
new file mode 100644
index 0000000000000..1e7da4c119b20
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/turses/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, python3Packages }:
+
+with stdenv.lib;
+with python3Packages;
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "turses";
+  version = "0.3.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "15mkhm3b5ka42h8qph0mhh8izfc1200v7651c62k7ldcs50ib9j6";
+  };
+
+  buildInputs = [ mock pytest coverage tox ];
+  propagatedBuildInputs = [ urwid tweepy future ];
+
+  checkPhase = ''
+    TMP_TURSES=`echo turses-$RANDOM`
+    mkdir $TMP_TURSES
+    PYTHONPATH=tests:$PYTHONPATH HOME=$TMP_TURSES py.test tests/
+    rm -rf $TMP_TURSES
+  '';
+
+  patchPhase = ''
+    sed -i -e 's|urwid==1.3.0|urwid==${getVersion urwid}|' setup.py
+    sed -i -e "s|future==0.14.3|future==${getVersion future}|" setup.py
+    sed -i -e "s|tweepy==3.3.0|tweepy==${getVersion tweepy}|" setup.py
+    sed -i -e "s|config.generate_config_file.assert_called_once()|assert config.generate_config_file.call_count == 1|" tests/test_config.py
+    sed -i -e "s|self.observer.update.assert_called_once()|assert self.observer.update.call_count == 1|" tests/test_meta.py
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/alejandrogomez/turses;
+    description = "A Twitter client for the console";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ garbas ];
+    platforms = platforms.linux;
+  };
+}