From f1eeb3245e32a8022975125f0d6750fae6855966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 12 Sep 2020 01:36:36 +0200 Subject: [PATCH] zulip-term: init at 0.5.2 --- .../instant-messengers/zulip-term/default.nix | 46 +++++++++++++++++++ .../zulip-term/pytest-executable-name.patch | 13 ++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 61 insertions(+) create mode 100644 pkgs/applications/networking/instant-messengers/zulip-term/default.nix create mode 100644 pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch diff --git a/pkgs/applications/networking/instant-messengers/zulip-term/default.nix b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix new file mode 100644 index 00000000000..8f4b2200cc5 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/zulip-term/default.nix @@ -0,0 +1,46 @@ +{ lib +, python3 +, fetchFromGitHub +, glibcLocales +}: + +python3.pkgs.buildPythonApplication rec { + pname = "zulip-term"; + version = "0.5.2"; + + # no tests on PyPI + src = fetchFromGitHub { + owner = "zulip"; + repo = "zulip-terminal"; + rev = version; + sha256 = "1xhhy3v4wck74a83avil0rnmsi2grrh03cww19n5mv80p2q1cjmf"; + }; + + patches = [ + ./pytest-executable-name.patch + ]; + + propagatedBuildInputs = with python3.pkgs; [ + urwid + zulip + urwid-readline + beautifulsoup4 + lxml + mypy-extensions + ]; + + checkInputs = [ + glibcLocales + ] ++ (with python3.pkgs; [ + pytestCheckHook + pytestcov + pytest-mock + ]); + + meta = with lib; { + description = "Zulip's official terminal client"; + homepage = "https://github.com/zulip/zulip-terminal"; + license = licenses.asl20; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch b/pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch new file mode 100644 index 00000000000..4602a254ab8 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/zulip-term/pytest-executable-name.patch @@ -0,0 +1,13 @@ +diff --git a/tests/cli/test_run.py b/tests/cli/test_run.py +index 459aa82..c6e434e 100644 +--- a/tests/cli/test_run.py ++++ b/tests/cli/test_run.py +@@ -180,7 +180,7 @@ def test_main_multiple_autohide_options(capsys, options): + assert str(e.value) == "2" + captured = capsys.readouterr() + lines = captured.err.strip('\n') +- lines = lines.split("pytest: ", 1)[1] ++ lines = lines.split("__main__.py: ", 1)[1] + expected = ("error: argument {}: not allowed " + "with argument {}".format(options[1], options[0])) + assert lines == expected diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e8de40a13e7..44f404d5e8b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9839,6 +9839,8 @@ in zulip = callPackage ../applications/networking/instant-messengers/zulip { }; + zulip-term = callPackage ../applications/networking/instant-messengers/zulip-term { }; + zulu8 = callPackage ../development/compilers/zulu/8.nix { }; zulu = callPackage ../development/compilers/zulu { };