diff mbox series

[bug#48091,v2,11/11] gnu: Add tgcli.

Message ID 20210430113438.6379-11-rg@raghavgururajan.name
State Accepted
Headers show
Series [bug#48091,v2,01/11] gnu: Add python-colorful. | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Raghav Gururajan April 30, 2021, 11:34 a.m. UTC
* gnu/packages/telegram.scm (tgcli): New variable.
---
 gnu/packages/telegram.scm | 52 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index c4414287a7..7d98c5874e 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -50,6 +50,9 @@ 
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-check)
+  #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages textutils)
@@ -68,6 +71,7 @@ 
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system python)
   #:use-module (guix build-system qt))
 
 (define-public webrtc-for-telegram-desktop
@@ -813,3 +817,51 @@  formerly a part of telegram-cli, but now being maintained separately.")
       (description "TG is the command-line interface for Telegram Messenger.")
       (home-page "https://github.com/vysheng/tg")
       (license license:gpl2+))))
+
+(define-public tgcli
+  (package
+    (name "tgcli")
+    (version "0.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/erayerdin/tgcli")
+         (commit (string-append "v" version))))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "082zim7rh4r8qyscqimjh2sz7998vv9j1i2y2wwz2rgrlhkhly5r"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Test requirements referes to specific versions of packages,
+         ;; which are too old. So we patch to refer to any later versions.
+         (add-after 'unpack 'patch-test-requirements
+           (lambda _
+             (substitute* "dev.requirements.txt"
+               (("==") ">="))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "pytest" "tests")))))))
+    (native-inputs
+     `(("coveralls" ,python-coveralls)
+       ("pytest" ,python-pytest)
+       ("pytest-click" ,python-pytest-click)
+       ("pytest-cov" ,python-pytest-cov)
+       ("mkdocs" ,python-mkdocs)
+       ("mkdocs-material" ,python-mkdocs-material)
+       ("requests-mock" ,python-requests-mock)))
+    (propagated-inputs
+     `(("click" ,python-click)
+       ("colorful" ,python-colorful)
+       ("requests" ,python-requests)
+       ("yaspin" ,python-yaspin)))
+    (home-page "https://tgcli.readthedocs.io")
+    (synopsis "Telegram Terminal Application")
+    (description "TgCli is a telegram client to automate repetitive tasks.")
+    (license license:asl2.0)))