Skip to content

Commit

Permalink
turses: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 1, 2017
1 parent 8f932af commit 4a6295e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 35 deletions.
41 changes: 41 additions & 0 deletions 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;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -4611,6 +4611,8 @@ with pkgs;

ttylog = callPackage ../tools/misc/ttylog { };

turses = callPackage ../applications/networking/instant-messengers/turses { };

twitterBootstrap = callPackage ../development/web/twitter-bootstrap {};
twitterBootstrap3 = callPackage ../development/web/twitter-bootstrap/v3.nix {};

Expand Down
35 changes: 0 additions & 35 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -22972,41 +22972,6 @@ in {
};


turses = buildPythonPackage (rec {
name = "turses-0.3.1";
disabled = isPyPy || isPy3k;

src = pkgs.fetchurl {
url = "mirror://pypi/t/turses/${name}.tar.gz";
sha256 = "15mkhm3b5ka42h8qph0mhh8izfc1200v7651c62k7ldcs50ib9j6";
};

buildInputs = with self; [ mock pytest coverage tox ];
propagatedBuildInputs = with self; [ urwid tweepy future ] ++ optional isPy26 argparse;

checkPhase = ''
TMP_TURSES=`echo turses-$RANDOM`
mkdir $TMP_TURSES
HOME=$TMP_TURSES py.test tests/
rm -rf $TMP_TURSES
'';

patchPhase = ''
sed -i -e "s|future==0.14.3|future==${pkgs.lib.getVersion self.future}|" setup.py
sed -i -e "s|tweepy==3.3.0|tweepy==${pkgs.lib.getVersion self.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 = {
homepage = https://github.com/alejandrogomez/turses;
description = "A Twitter client for the console";
license = licenses.gpl3;
maintainers = with maintainers; [ garbas ];
platforms = platforms.linux;
};
});

tweepy = buildPythonPackage (rec {
name = "tweepy-3.5.0";

Expand Down

0 comments on commit 4a6295e

Please sign in to comment.