unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45954] Telegram-CLI
@ 2021-01-18  9:16 Raghav Gururajan
  2021-01-19 15:08 ` [bug#45954] Telegram-CLI (v2) Raghav Gururajan
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-01-18  9:16 UTC (permalink / raw)
  To: 45954

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Hello Guix!

Please find the attached patch-set to add telegram-cli and its 
dependencies into Guix.

Regards,
RG.

[-- Attachment #2: 0018-gnu-Add-telegram-client.patch --]
[-- Type: text/x-patch, Size: 4351 bytes --]

From 46d83425664d862f20fd6a4e671cf68a0b2eb5cf Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 18 Jan 2021 04:04:25 -0500
Subject: [PATCH 18/18] gnu: Add telegram-client.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 83 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 4c7e34a1ff..1c75168f21 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -41,13 +41,18 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -443,3 +448,81 @@ a part of telegram-cli, but now being maintained separately.")
     (description "TGL is the telegram library for telegram-cli.")
     (home-page "https://github.com/vysheng/tgl")
     (license license:lgpl2.1+)))
+
+(define-public telegram-cli
+  (package
+    (name "telegram-cli")
+    (version "1.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tg.git")
+         (commit "6547c0b21b977b327b3c5e8142963f4bc246187a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tgl-and-tlparser
+           (lambda _
+             (for-each delete-file
+                       (list
+                        "Makefile.tgl"
+                        "Makefile.tl-parser"))
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                "")
+               (("-I\\$\\{srcdir\\}/tgl")
+                (string-append "-I" (assoc-ref %build-inputs "tgl")
+                               "/include/tgl"))
+               (("AUTO=auto")
+                (string-append "AUTO=" (assoc-ref %build-inputs "tgl")
+                               "/include/tgl/auto"))
+               (("LIB=libs")
+                (string-append "LIB=" (assoc-ref %build-inputs "tgl")
+                               "/lib/tgl")))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (source (string-append (getenv "TEMP") "/source")))
+               ;; Install client.
+               (install-file
+                (string-append source "/bin/telegram-cli")
+                (string-append out "/bin"))
+               ;; Install server public-key.
+               (install-file
+                (string-append source "/server.pub")
+                (string-append out "/etc/telegram-cli")))
+             #t)))))
+    (native-inputs
+     `(("perl" ,perl)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("jansson" ,jansson)
+       ("libconfig" ,libconfig)
+       ("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("lua" ,lua)
+       ("openssl" ,openssl)
+       ("python" ,python)
+       ("readline" ,readline)
+       ("tgl" ,tgl)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Messenger CLI")
+    (description "TG is the command-line interface for Telegram Messenger.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:gpl2+)))
-- 
2.30.0


[-- Attachment #3: 0017-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 4820 bytes --]

From 8c4aca963cda5fe706905dc8e67cf205845c662b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 22:03:11 -0500
Subject: [PATCH 17/18] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 91 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 3c3aef4b9a..4c7e34a1ff 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -32,10 +32,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -53,6 +55,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
 (define-public tg_owt
@@ -352,3 +355,91 @@ messenger.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (package
+    (name "tgl")
+    (version "2.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tgl.git")
+         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl"
+        ;; Enable extended queries system.
+        "--enable-extf"
+        ;; Include libevent-based net and timers.
+        "--enable-libevent")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-tl-parser
+           (lambda _
+             (delete-file "Makefile.tl-parser")
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("\\$\\{EXE\\}/tl-parser")
+                "tl-parser"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-to (string-append out "/bin"))
+                    (include-to (string-append out "/include"))
+                    (lib-to (string-append out "/lib"))
+                    (source (string-append (getenv "TEMP") "/source"))
+                    (bin-from (string-append source "/bin"))
+                    (lib-from (string-append source "/libs")))
+               ;; Install executables.
+               (with-directory-excursion bin-from
+                 (for-each
+                  (lambda (file)
+                    (install-file file bin-to))
+                  (list
+                   "generate")))
+               ;; Install headers.
+               (with-directory-excursion source
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/crypto"))
+                    (delete-file file))
+                  (find-files "crypto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/auto"))
+                    (delete-file file))
+                  (find-files "auto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl"))
+                    (delete-file file))
+                  (find-files "." "\\.h$")))
+               ;; Install libraries.
+               (for-each
+                (lambda (file)
+                  (install-file file (string-append lib-to "/tgl")))
+                (find-files lib-from "\\.(a|so)$")))
+             #t)))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Library")
+    (description "TGL is the telegram library for telegram-cli.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:lgpl2.1+)))
-- 
2.30.0


[-- Attachment #4: 0016-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2596 bytes --]

From 656d1067c9c9c15fc69386071dd94c0b29040fd4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 12:16:34 -0500
Subject: [PATCH 16/18] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 9759a11873..3c3aef4b9a 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -303,3 +303,52 @@ messenger.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "1"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (build (string-append (getenv "TEMP") "/build")))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v2)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
@ 2021-01-19 15:08 ` Raghav Gururajan
  2021-01-20 10:44 ` [bug#45954] Telegram-CLI (v3) Raghav Gururajan
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-01-19 15:08 UTC (permalink / raw)
  To: 45954

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0018-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 5909 bytes --]

From 7ac04da6cf62d16531ac20658a1d6d441a6ef3ca Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 18 Jan 2021 04:04:25 -0500
Subject: [PATCH 18/18] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 117 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index c97289996c..13be4ae4fd 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -42,13 +42,18 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -451,3 +456,115 @@ a part of telegram-cli, but now being maintained separately.")
     (description "TGL is the telegram library for telegram-cli.")
     (home-page "https://github.com/vysheng/tgl")
     (license license:lgpl2.1+)))
+
+(define-public telegram-cli
+  (package
+    (name "telegram-cli")
+    (version "1.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tg.git")
+         (commit "6547c0b21b977b327b3c5e8142963f4bc246187a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each delete-file
+                       (list
+                        "Makefile.tgl"
+                        "Makefile.tl-parser"))
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                "")
+               (("-I\\$\\{srcdir\\}/tgl")
+                (string-append "-I" (assoc-ref inputs "tgl")
+                               "/include/tgl"))
+               (("AUTO=auto")
+                (string-append "AUTO=" (assoc-ref inputs "tgl")
+                               "/include/tgl/auto"))
+               (("LIB=libs")
+                (string-append "LIB=" (assoc-ref inputs "tgl")
+                               "/lib/tgl")))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (source (string-append (getenv "TEMP") "/source")))
+               ;; Install client.
+               (install-file
+                (string-append source "/bin/telegram-cli")
+                (string-append out "/bin"))
+               ;; Install daemon.
+               (install-file
+                (string-append source "/start-telegram-daemon")
+                (string-append out "/bin"))
+               ;; Install daemon script.
+               (install-file
+                (string-append source "/telegram-daemon")
+                (string-append out "/etc/init.d"))
+               ;; Install server public-key.
+               (install-file
+                (string-append source "/server.pub")
+                (string-append out "/etc/telegram-cli")))
+             #t))
+         (add-after 'install 'patch-daemon-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (with-directory-excursion out
+                 (substitute* "etc/init.d/telegram-daemon"
+                   (("KOT\\'s meta engine")
+                    "Telegram Messaging System")
+                   (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin")
+                    "$PATH")
+                   (("\\$ROOT/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin"))
+                   (("/etc/init\\.d")
+                    (string-append out "/etc/init.d")))
+                 (substitute* "bin/start-telegram-daemon"
+                   (("msg-search-engine")
+                    "telegram-cli")
+                   (("\\$root/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin")))))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("jansson" ,jansson)
+       ("libconfig" ,libconfig)
+       ("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("lua" ,lua)
+       ("openssl" ,openssl)
+       ("perl" ,perl)
+       ("python" ,python)
+       ("readline" ,readline)
+       ("tgl" ,tgl)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Messenger CLI")
+    (description "TG is the command-line interface for Telegram Messenger.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:gpl2+)))
-- 
2.30.0


[-- Attachment #3: 0017-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 5333 bytes --]

From 3f8c1445e5486145d215a1f31962ca06e982e333 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 22:03:11 -0500
Subject: [PATCH 17/18] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 99 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 3c3aef4b9a..c97289996c 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -21,6 +21,7 @@
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
@@ -32,10 +33,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -53,6 +56,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
 (define-public tg_owt
@@ -352,3 +356,98 @@ messenger.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (package
+    (name "tgl")
+    (version "2.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tgl.git")
+         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl"
+        ;; Enable extended queries system.
+        "--enable-extf"
+        ;; Include libevent-based net and timers.
+        "--enable-libevent")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tl-parser
+           (lambda _
+             (delete-file "Makefile.tl-parser")
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("\\$\\{EXE\\}/tl-parser")
+                "tl-parser"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-to (string-append out "/bin"))
+                    (include-to (string-append out "/include"))
+                    (lib-to (string-append out "/lib"))
+                    (source (string-append (getenv "TEMP") "/source"))
+                    (bin-from (string-append source "/bin"))
+                    (lib-from (string-append source "/libs")))
+               ;; Install executables.
+               (with-directory-excursion bin-from
+                 (for-each
+                  (lambda (file)
+                    (install-file file bin-to))
+                  (list
+                   "generate")))
+               ;; Install headers.
+               (with-directory-excursion source
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/crypto"))
+                    (delete-file file))
+                  (find-files "crypto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/auto"))
+                    (delete-file file))
+                  (find-files "auto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl"))
+                    (delete-file file))
+                  (find-files "." "\\.h$")))
+               ;; Install libraries.
+               (for-each
+                (lambda (file)
+                  (install-file file (string-append lib-to "/tgl")))
+                (find-files lib-from "\\.(a|so)$")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Library")
+    (description "TGL is the telegram library for telegram-cli.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:lgpl2.1+)))
-- 
2.30.0


[-- Attachment #4: 0016-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2596 bytes --]

From 656d1067c9c9c15fc69386071dd94c0b29040fd4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 12:16:34 -0500
Subject: [PATCH 16/18] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 9759a11873..3c3aef4b9a 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -303,3 +303,52 @@ messenger.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "1"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (build (string-append (getenv "TEMP") "/build")))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v3)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
  2021-01-19 15:08 ` [bug#45954] Telegram-CLI (v2) Raghav Gururajan
@ 2021-01-20 10:44 ` Raghav Gururajan
  2021-01-22  4:44 ` [bug#45954] Telegram-CLI (v4) Raghav Gururajan
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-01-20 10:44 UTC (permalink / raw)
  To: 45954

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0018-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 5909 bytes --]

From c05ff4de2767a38b0a038f34194dfea83654526b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 18 Jan 2021 04:04:25 -0500
Subject: [PATCH 18/18] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 117 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index b63af0d409..3235ea3dc6 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -42,13 +42,18 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -679,3 +684,115 @@ a part of telegram-cli, but now being maintained separately.")
     (description "TGL is the telegram library for telegram-cli.")
     (home-page "https://github.com/vysheng/tgl")
     (license license:lgpl2.1+)))
+
+(define-public telegram-cli
+  (package
+    (name "telegram-cli")
+    (version "1.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tg.git")
+         (commit "6547c0b21b977b327b3c5e8142963f4bc246187a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each delete-file
+                       (list
+                        "Makefile.tgl"
+                        "Makefile.tl-parser"))
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                "")
+               (("-I\\$\\{srcdir\\}/tgl")
+                (string-append "-I" (assoc-ref inputs "tgl")
+                               "/include/tgl"))
+               (("AUTO=auto")
+                (string-append "AUTO=" (assoc-ref inputs "tgl")
+                               "/include/tgl/auto"))
+               (("LIB=libs")
+                (string-append "LIB=" (assoc-ref inputs "tgl")
+                               "/lib/tgl")))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (source (string-append (getenv "TEMP") "/source")))
+               ;; Install client.
+               (install-file
+                (string-append source "/bin/telegram-cli")
+                (string-append out "/bin"))
+               ;; Install daemon.
+               (install-file
+                (string-append source "/start-telegram-daemon")
+                (string-append out "/bin"))
+               ;; Install daemon script.
+               (install-file
+                (string-append source "/telegram-daemon")
+                (string-append out "/etc/init.d"))
+               ;; Install server public-key.
+               (install-file
+                (string-append source "/server.pub")
+                (string-append out "/etc/telegram-cli")))
+             #t))
+         (add-after 'install 'patch-daemon-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (with-directory-excursion out
+                 (substitute* "etc/init.d/telegram-daemon"
+                   (("KOT\\'s meta engine")
+                    "Telegram Messaging System")
+                   (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin")
+                    "$PATH")
+                   (("\\$ROOT/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin"))
+                   (("/etc/init\\.d")
+                    (string-append out "/etc/init.d")))
+                 (substitute* "bin/start-telegram-daemon"
+                   (("msg-search-engine")
+                    "telegram-cli")
+                   (("\\$root/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin")))))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("jansson" ,jansson)
+       ("libconfig" ,libconfig)
+       ("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("lua" ,lua)
+       ("openssl" ,openssl)
+       ("perl" ,perl)
+       ("python" ,python)
+       ("readline" ,readline)
+       ("tgl" ,tgl)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Messenger CLI")
+    (description "TG is the command-line interface for Telegram Messenger.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:gpl2+)))
-- 
2.30.0


[-- Attachment #3: 0017-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 5349 bytes --]

From 59cfe5ad75f1ad4bb266443a405792fdddd077c1 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 20 Jan 2021 04:54:54 -0500
Subject: [PATCH 17/18] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 99 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index b77ae97358..b63af0d409 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -21,6 +21,7 @@
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
@@ -32,10 +33,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -53,6 +56,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system qt))
 
 (define-public tg-owt
@@ -580,3 +584,98 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (package
+    (name "tgl")
+    (version "2.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tgl.git")
+         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl"
+        ;; Enable extended queries system.
+        "--enable-extf"
+        ;; Include libevent-based net and timers.
+        "--enable-libevent")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tl-parser
+           (lambda _
+             (delete-file "Makefile.tl-parser")
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("\\$\\{EXE\\}/tl-parser")
+                "tl-parser"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-to (string-append out "/bin"))
+                    (include-to (string-append out "/include"))
+                    (lib-to (string-append out "/lib"))
+                    (source (string-append (getenv "TEMP") "/source"))
+                    (bin-from (string-append source "/bin"))
+                    (lib-from (string-append source "/libs")))
+               ;; Install executables.
+               (with-directory-excursion bin-from
+                 (for-each
+                  (lambda (file)
+                    (install-file file bin-to))
+                  (list
+                   "generate")))
+               ;; Install headers.
+               (with-directory-excursion source
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/crypto"))
+                    (delete-file file))
+                  (find-files "crypto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/auto"))
+                    (delete-file file))
+                  (find-files "auto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl"))
+                    (delete-file file))
+                  (find-files "." "\\.h$")))
+               ;; Install libraries.
+               (for-each
+                (lambda (file)
+                  (install-file file (string-append lib-to "/tgl")))
+                (find-files lib-from "\\.(a|so)$")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Library")
+    (description "TGL is the telegram library for telegram-cli.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:lgpl2.1+)))
-- 
2.30.0


[-- Attachment #4: 0016-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2612 bytes --]

From 294b64749c5762757acc60860186e215f9e13387 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 12:16:34 -0500
Subject: [PATCH 16/18] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 1d4e819a44..b77ae97358 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -531,3 +531,52 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "1"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (build (string-append (getenv "TEMP") "/build")))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v4)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
  2021-01-19 15:08 ` [bug#45954] Telegram-CLI (v2) Raghav Gururajan
  2021-01-20 10:44 ` [bug#45954] Telegram-CLI (v3) Raghav Gururajan
@ 2021-01-22  4:44 ` Raghav Gururajan
  2021-01-28  1:00 ` [bug#45954] Telegram-CLI (v5) Raghav Gururajan
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-01-22  4:44 UTC (permalink / raw)
  To: 45954

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0018-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 5909 bytes --]

From 8d70270726efb0c1b144df9154daf2119116d39d Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 18 Jan 2021 04:04:25 -0500
Subject: [PATCH 18/18] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 117 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 00efeeec39..44666a43ac 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -42,13 +42,18 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -713,3 +718,115 @@ a part of telegram-cli, but now being maintained separately.")
     (description "TGL is the telegram library for telegram-cli.")
     (home-page "https://github.com/vysheng/tgl")
     (license license:lgpl2.1+)))
+
+(define-public telegram-cli
+  (package
+    (name "telegram-cli")
+    (version "1.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tg.git")
+         (commit "6547c0b21b977b327b3c5e8142963f4bc246187a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each delete-file
+                       (list
+                        "Makefile.tgl"
+                        "Makefile.tl-parser"))
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                "")
+               (("-I\\$\\{srcdir\\}/tgl")
+                (string-append "-I" (assoc-ref inputs "tgl")
+                               "/include/tgl"))
+               (("AUTO=auto")
+                (string-append "AUTO=" (assoc-ref inputs "tgl")
+                               "/include/tgl/auto"))
+               (("LIB=libs")
+                (string-append "LIB=" (assoc-ref inputs "tgl")
+                               "/lib/tgl")))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (source (string-append (getenv "TEMP") "/source")))
+               ;; Install client.
+               (install-file
+                (string-append source "/bin/telegram-cli")
+                (string-append out "/bin"))
+               ;; Install daemon.
+               (install-file
+                (string-append source "/start-telegram-daemon")
+                (string-append out "/bin"))
+               ;; Install daemon script.
+               (install-file
+                (string-append source "/telegram-daemon")
+                (string-append out "/etc/init.d"))
+               ;; Install server public-key.
+               (install-file
+                (string-append source "/server.pub")
+                (string-append out "/etc/telegram-cli")))
+             #t))
+         (add-after 'install 'patch-daemon-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (with-directory-excursion out
+                 (substitute* "etc/init.d/telegram-daemon"
+                   (("KOT\\'s meta engine")
+                    "Telegram Messaging System")
+                   (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin")
+                    "$PATH")
+                   (("\\$ROOT/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin"))
+                   (("/etc/init\\.d")
+                    (string-append out "/etc/init.d")))
+                 (substitute* "bin/start-telegram-daemon"
+                   (("msg-search-engine")
+                    "telegram-cli")
+                   (("\\$root/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin")))))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("jansson" ,jansson)
+       ("libconfig" ,libconfig)
+       ("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("lua" ,lua)
+       ("openssl" ,openssl)
+       ("perl" ,perl)
+       ("python" ,python)
+       ("readline" ,readline)
+       ("tgl" ,tgl)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Messenger CLI")
+    (description "TG is the command-line interface for Telegram Messenger.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:gpl2+)))
-- 
2.30.0


[-- Attachment #3: 0017-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 4818 bytes --]

From 86addd1eaea66e86c2bf33b86394312512f9c7bd Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 21 Jan 2021 23:23:29 -0500
Subject: [PATCH 17/18] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 97 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index baea47bd57..00efeeec39 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -33,10 +33,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -616,3 +618,98 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (package
+    (name "tgl")
+    (version "2.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tgl.git")
+         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl"
+        ;; Enable extended queries system.
+        "--enable-extf"
+        ;; Include libevent-based net and timers.
+        "--enable-libevent")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tl-parser
+           (lambda _
+             (delete-file "Makefile.tl-parser")
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("\\$\\{EXE\\}/tl-parser")
+                "tl-parser"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-to (string-append out "/bin"))
+                    (include-to (string-append out "/include"))
+                    (lib-to (string-append out "/lib"))
+                    (source (string-append (getenv "TEMP") "/source"))
+                    (bin-from (string-append source "/bin"))
+                    (lib-from (string-append source "/libs")))
+               ;; Install executables.
+               (with-directory-excursion bin-from
+                 (for-each
+                  (lambda (file)
+                    (install-file file bin-to))
+                  (list
+                   "generate")))
+               ;; Install headers.
+               (with-directory-excursion source
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/crypto"))
+                    (delete-file file))
+                  (find-files "crypto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/auto"))
+                    (delete-file file))
+                  (find-files "auto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl"))
+                    (delete-file file))
+                  (find-files "." "\\.h$")))
+               ;; Install libraries.
+               (for-each
+                (lambda (file)
+                  (install-file file (string-append lib-to "/tgl")))
+                (find-files lib-from "\\.(a|so)$")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Library")
+    (description "TGL is the telegram library for telegram-cli.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:lgpl2.1+)))
-- 
2.30.0


[-- Attachment #4: 0016-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2612 bytes --]

From 2a10583ec96e30fed9fb14e2314eef725c26af58 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 12:16:34 -0500
Subject: [PATCH 16/18] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 9534433424..baea47bd57 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -567,3 +567,52 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "1"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (build (string-append (getenv "TEMP") "/build")))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v5)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
                   ` (2 preceding siblings ...)
  2021-01-22  4:44 ` [bug#45954] Telegram-CLI (v4) Raghav Gururajan
@ 2021-01-28  1:00 ` Raghav Gururajan
  2021-01-31 19:46 ` [bug#45954] Telegram-CLI (v6) Raghav Gururajan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-01-28  1:00 UTC (permalink / raw)
  To: 45954

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0016-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2612 bytes --]

From a6a01b3ff31febee3a0175340dcb89f111550cae Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 12:16:34 -0500
Subject: [PATCH 16/18] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index c827516a51..12dfdfdbb8 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -555,3 +555,52 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "1"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (build (string-append (getenv "TEMP") "/build")))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #3: 0017-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 4818 bytes --]

From bdd5cd4eee1aa6a61dd76039d22c5a462b4393d5 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 21 Jan 2021 23:23:29 -0500
Subject: [PATCH 17/18] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 97 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 12dfdfdbb8..5b391d9dfd 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -34,10 +34,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -604,3 +606,98 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (package
+    (name "tgl")
+    (version "2.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tgl.git")
+         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl"
+        ;; Enable extended queries system.
+        "--enable-extf"
+        ;; Include libevent-based net and timers.
+        "--enable-libevent")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tl-parser
+           (lambda _
+             (delete-file "Makefile.tl-parser")
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("\\$\\{EXE\\}/tl-parser")
+                "tl-parser"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-to (string-append out "/bin"))
+                    (include-to (string-append out "/include"))
+                    (lib-to (string-append out "/lib"))
+                    (source (string-append (getenv "TEMP") "/source"))
+                    (bin-from (string-append source "/bin"))
+                    (lib-from (string-append source "/libs")))
+               ;; Install executables.
+               (with-directory-excursion bin-from
+                 (for-each
+                  (lambda (file)
+                    (install-file file bin-to))
+                  (list
+                   "generate")))
+               ;; Install headers.
+               (with-directory-excursion source
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/crypto"))
+                    (delete-file file))
+                  (find-files "crypto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/auto"))
+                    (delete-file file))
+                  (find-files "auto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl"))
+                    (delete-file file))
+                  (find-files "." "\\.h$")))
+               ;; Install libraries.
+               (for-each
+                (lambda (file)
+                  (install-file file (string-append lib-to "/tgl")))
+                (find-files lib-from "\\.(a|so)$")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Library")
+    (description "TGL is the telegram library for telegram-cli.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:lgpl2.1+)))
-- 
2.30.0


[-- Attachment #4: 0018-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 5949 bytes --]

From dc5ea54ebb2f16923717eae9427fe7ff1bc7f433 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 19:56:23 -0500
Subject: [PATCH 18/18] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 117 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 5b391d9dfd..d4e8252126 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -43,14 +43,19 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -701,3 +706,115 @@ a part of telegram-cli, but now being maintained separately.")
     (description "TGL is the telegram library for telegram-cli.")
     (home-page "https://github.com/vysheng/tgl")
     (license license:lgpl2.1+)))
+
+(define-public telegram-cli
+  (package
+    (name "telegram-cli")
+    (version "1.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tg.git")
+         (commit "6547c0b21b977b327b3c5e8142963f4bc246187a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each delete-file
+                       (list
+                        "Makefile.tgl"
+                        "Makefile.tl-parser"))
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                "")
+               (("-I\\$\\{srcdir\\}/tgl")
+                (string-append "-I" (assoc-ref inputs "tgl")
+                               "/include/tgl"))
+               (("AUTO=auto")
+                (string-append "AUTO=" (assoc-ref inputs "tgl")
+                               "/include/tgl/auto"))
+               (("LIB=libs")
+                (string-append "LIB=" (assoc-ref inputs "tgl")
+                               "/lib/tgl")))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (source (string-append (getenv "TEMP") "/source")))
+               ;; Install client.
+               (install-file
+                (string-append source "/bin/telegram-cli")
+                (string-append out "/bin"))
+               ;; Install daemon.
+               (install-file
+                (string-append source "/start-telegram-daemon")
+                (string-append out "/bin"))
+               ;; Install daemon script.
+               (install-file
+                (string-append source "/telegram-daemon")
+                (string-append out "/etc/init.d"))
+               ;; Install server public-key.
+               (install-file
+                (string-append source "/server.pub")
+                (string-append out "/etc/telegram-cli")))
+             #t))
+         (add-after 'install 'patch-daemon-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (with-directory-excursion out
+                 (substitute* "etc/init.d/telegram-daemon"
+                   (("KOT\\'s meta engine")
+                    "Telegram Messaging System")
+                   (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin")
+                    "$PATH")
+                   (("\\$ROOT/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin"))
+                   (("/etc/init\\.d")
+                    (string-append out "/etc/init.d")))
+                 (substitute* "bin/start-telegram-daemon"
+                   (("msg-search-engine")
+                    "telegram-cli")
+                   (("\\$root/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin")))))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("jansson" ,jansson)
+       ("libconfig" ,libconfig)
+       ("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("lua" ,lua)
+       ("openssl" ,openssl)
+       ("perl" ,perl)
+       ("python" ,python)
+       ("readline" ,readline)
+       ("tgl" ,tgl)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Messenger CLI")
+    (description "TG is the command-line interface for Telegram Messenger.")
+    (home-page "https://github.com/vysheng/tg")
+    (license license:gpl2+)))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v6)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
                   ` (3 preceding siblings ...)
  2021-01-28  1:00 ` [bug#45954] Telegram-CLI (v5) Raghav Gururajan
@ 2021-01-31 19:46 ` Raghav Gururajan
  2021-02-01  8:30   ` Leo Prikler
  2021-02-01 22:08 ` [bug#45954] Telegram-CLI (v7) Raghav Gururajan
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Raghav Gururajan @ 2021-01-31 19:46 UTC (permalink / raw)
  To: 45954


[-- Attachment #1.1.1: Type: text/plain, Size: 58 bytes --]

P.S. Just in case if v5 doesn't apply on current master.

[-- Attachment #1.1.2: 0001-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2680 bytes --]

From c0aecf538cdc3318cf3906965ef55633963fb661 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 12:16:34 -0500
Subject: [PATCH 1/3] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 66b94baf28..8e03283593 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -555,3 +555,52 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "1"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (build (string-append (getenv "TEMP") "/build")))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 4945 bytes --]

From 8ca84d054418feb4ceb3a2001ed082abeb2d5dbb Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Thu, 21 Jan 2021 23:23:29 -0500
Subject: [PATCH 2/3] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 97 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 8e03283593..a5f04eab65 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -34,10 +34,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -604,3 +606,98 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (package
+    (name "tgl")
+    (version "2.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tgl.git")
+         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl"
+        ;; Enable extended queries system.
+        "--enable-extf"
+        ;; Include libevent-based net and timers.
+        "--enable-libevent")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tl-parser
+           (lambda _
+             (delete-file "Makefile.tl-parser")
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("\\$\\{EXE\\}/tl-parser")
+                "tl-parser"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin-to (string-append out "/bin"))
+                    (include-to (string-append out "/include"))
+                    (lib-to (string-append out "/lib"))
+                    (source (string-append (getenv "TEMP") "/source"))
+                    (bin-from (string-append source "/bin"))
+                    (lib-from (string-append source "/libs")))
+               ;; Install executables.
+               (with-directory-excursion bin-from
+                 (for-each
+                  (lambda (file)
+                    (install-file file bin-to))
+                  (list
+                   "generate")))
+               ;; Install headers.
+               (with-directory-excursion source
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/crypto"))
+                    (delete-file file))
+                  (find-files "crypto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl/auto"))
+                    (delete-file file))
+                  (find-files "auto" "\\.h$"))
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include-to "/tgl"))
+                    (delete-file file))
+                  (find-files "." "\\.h$")))
+               ;; Install libraries.
+               (for-each
+                (lambda (file)
+                  (install-file file (string-append lib-to "/tgl")))
+                (find-files lib-from "\\.(a|so)$")))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Library")
+    (description "TGL is the telegram library for telegram-cli.")
+    (home-page "https://github.com/vysheng/tgl")
+    (license license:lgpl2.1+)))
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 6100 bytes --]

From 44b079fd0e89a106a4212adc38abb916222ecb5b Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Wed, 27 Jan 2021 19:56:23 -0500
Subject: [PATCH 3/3] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 117 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index a5f04eab65..7b607476a8 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -43,14 +43,19 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -701,3 +706,115 @@ a part of telegram-cli, but now being maintained separately.")
     (description "TGL is the telegram library for telegram-cli.")
     (home-page "https://github.com/vysheng/tgl")
     (license license:lgpl2.1+)))
+
+(define-public telegram-cli
+  (package
+    (name "telegram-cli")
+    (version "1.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/vysheng/tg.git")
+         (commit "6547c0b21b977b327b3c5e8142963f4bc246187a")))
+       (file-name
+        (git-file-name name version))
+       (sha256
+        (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No target
+       #:configure-flags
+       (list
+        ;; Use gcrypt instead of openssl.
+        "--disable-openssl")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'trigger-bootstrap
+           (lambda _
+             (delete-file "configure")
+             #t))
+         (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each delete-file
+                       (list
+                        "Makefile.tgl"
+                        "Makefile.tl-parser"))
+             (substitute* "Makefile.in"
+               (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                "")
+               (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                "")
+               (("-I\\$\\{srcdir\\}/tgl")
+                (string-append "-I" (assoc-ref inputs "tgl")
+                               "/include/tgl"))
+               (("AUTO=auto")
+                (string-append "AUTO=" (assoc-ref inputs "tgl")
+                               "/include/tgl/auto"))
+               (("LIB=libs")
+                (string-append "LIB=" (assoc-ref inputs "tgl")
+                               "/lib/tgl")))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (source (string-append (getenv "TEMP") "/source")))
+               ;; Install client.
+               (install-file
+                (string-append source "/bin/telegram-cli")
+                (string-append out "/bin"))
+               ;; Install daemon.
+               (install-file
+                (string-append source "/start-telegram-daemon")
+                (string-append out "/bin"))
+               ;; Install daemon script.
+               (install-file
+                (string-append source "/telegram-daemon")
+                (string-append out "/etc/init.d"))
+               ;; Install server public-key.
+               (install-file
+                (string-append source "/server.pub")
+                (string-append out "/etc/telegram-cli")))
+             #t))
+         (add-after 'install 'patch-daemon-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (with-directory-excursion out
+                 (substitute* "etc/init.d/telegram-daemon"
+                   (("KOT\\'s meta engine")
+                    "Telegram Messaging System")
+                   (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin")
+                    "$PATH")
+                   (("\\$ROOT/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin"))
+                   (("/etc/init\\.d")
+                    (string-append out "/etc/init.d")))
+                 (substitute* "bin/start-telegram-daemon"
+                   (("msg-search-engine")
+                    "telegram-cli")
+                   (("\\$root/usr/share/telegram-daemon/bin")
+                    (string-append out "/bin")))))
+             #t)))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("jansson" ,jansson)
+       ("libconfig" ,libconfig)
+       ("libevent" ,libevent)
+       ("libgcrypt" ,libgcrypt)
+       ("lua" ,lua)
+       ("openssl" ,openssl)
+       ("perl" ,perl)
+       ("python" ,python)
+       ("readline" ,readline)
+       ("tgl" ,tgl)
+       ("tl-parser" ,tl-parser)
+       ("zlib" ,zlib)))
+    (synopsis "Telegram Messenger CLI")
+    (description "TG is the command-line interface for Telegram Messenger.")
+    (home-page "https://github.com/vysheng/tg")
+    (license license:gpl2+)))
-- 
2.30.0


[-- Attachment #1.1.5: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v6)
  2021-01-31 19:46 ` [bug#45954] Telegram-CLI (v6) Raghav Gururajan
@ 2021-02-01  8:30   ` Leo Prikler
  2021-02-01 22:18     ` Raghav Gururajan
  0 siblings, 1 reply; 19+ messages in thread
From: Leo Prikler @ 2021-02-01  8:30 UTC (permalink / raw)
  To: Raghav Gururajan, 45954

Am Sonntag, den 31.01.2021, 14:46 -0500 schrieb Raghav Gururajan:
> +(define-public tgl
> +  (package
> +    (name "tgl")
> +    (version "2.0.1")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri
> +        (git-reference
> +         (url "https://github.com/vysheng/tgl.git")
> +         (commit "ffb04caca71de0cddf28cd33a4575922900a59ed")))
The commit does not match up with the version.  If this is intended,
use git-version instead.

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin-to (string-append out "/bin"))
> +                    (include-to (string-append out "/include"))
> +                    (lib-to (string-append out "/lib"))
> +                    (source (string-append (getenv "TEMP")
> "/source"))
> +                    (bin-from (string-append source "/bin"))
> +                    (lib-from (string-append source "/libs")))
> +               ;; Install executables.
> +               (with-directory-excursion bin-from
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file bin-to))
> +                  (list
> +                   "generate")))
> +               ;; Install headers.
> +               (with-directory-excursion source
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file (string-append include-to
> "/tgl/crypto"))
> +                    (delete-file file))
> +                  (find-files "crypto" "\\.h$"))
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file (string-append include-to
> "/tgl/auto"))
> +                    (delete-file file))
> +                  (find-files "auto" "\\.h$"))
> +                 (for-each
> +                  (lambda (file)
> +                    (install-file file (string-append include-to
> "/tgl"))
> +                    (delete-file file))
> +                  (find-files "." "\\.h$")))
> +               ;; Install libraries.
> +               (for-each
> +                (lambda (file)
> +                  (install-file file (string-append lib-to "/tgl")))
> +                (find-files lib-from "\\.(a|so)$")))
> +             #t)))))
You might want to write that in terms of copy-build-system.

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (source (string-append (getenv "TEMP")
> "/source")))
> +               ;; Install client.
> +               (install-file
> +                (string-append source "/bin/telegram-cli")
> +                (string-append out "/bin"))
> +               ;; Install daemon.
> +               (install-file
> +                (string-append source "/start-telegram-daemon")
> +                (string-append out "/bin"))
> +               ;; Install daemon script.
> +               (install-file
> +                (string-append source "/telegram-daemon")
> +                (string-append out "/etc/init.d"))
> +               ;; Install server public-key.
> +               (install-file
> +                (string-append source "/server.pub")
> +                (string-append out "/etc/telegram-cli")))
> +             #t))
Same here.  Also, I'm not sure if SysV init scripts are that compatible
with Guix running on Shepherd.  Is there a more direct way of launching
the daemon?

> +                   (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr
> /sbin:/usr/bin")
> +                    "$PATH")
Not that it makes much of a difference, as I doubt this file will still
be needed, but PATH=$PATH is a noop.  Perhaps you want (getenv "PATH")
instead?

Regards,
Leo





^ permalink raw reply	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v7)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
                   ` (4 preceding siblings ...)
  2021-01-31 19:46 ` [bug#45954] Telegram-CLI (v6) Raghav Gururajan
@ 2021-02-01 22:08 ` Raghav Gururajan
  2021-02-01 22:39   ` Leo Prikler
  2021-02-02  2:25 ` [bug#45954] Telegram-CLI (v8) Raghav Gururajan
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-01 22:08 UTC (permalink / raw)
  To: 45954; +Cc: Leo Prikler


[-- Attachment #1.1.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #1.1.2: 0001-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2680 bytes --]

From 597f4fe496a3bd9653ea1d2c6afb8bcf098da64f Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:38:25 -0500
Subject: [PATCH 1/3] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 66b94baf28..ab8b9362f2 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -555,3 +555,52 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "21"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (build (string-append (getenv "TEMP") "/build")))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 5224 bytes --]

From 8bd200771ed33ca12cbb815948f6d7a5576d4e57 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:42:24 -0500
Subject: [PATCH 2/3] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 100 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index ab8b9362f2..2ff30c209e 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -34,10 +34,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -604,3 +606,101 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed")
+        (revision "181"))
+    (package
+      (name "tgl")
+      (version
+       (git-version "2.0.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tgl.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl"
+          ;; Enable extended queries system.
+          "--enable-extf"
+          ;; Include libevent-based net and timers.
+          "--enable-libevent")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tl-parser
+             (lambda _
+               (delete-file "Makefile.tl-parser")
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("\\$\\{EXE\\}/tl-parser")
+                  "tl-parser"))
+               #t))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin-to (string-append out "/bin"))
+                      (include-to (string-append out "/include"))
+                      (lib-to (string-append out "/lib"))
+                      (source (string-append (getenv "TEMP") "/source"))
+                      (bin-from (string-append source "/bin"))
+                      (lib-from (string-append source "/libs")))
+                 ;; Install executables.
+                 (with-directory-excursion bin-from
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin-to))
+                    (list
+                     "generate")))
+                 ;; Install headers.
+                 (with-directory-excursion source
+                   (for-each
+                    (lambda (file)
+                      (install-file file (string-append include-to "/tgl/crypto"))
+                      (delete-file file))
+                    (find-files "crypto" "\\.h$"))
+                   (for-each
+                    (lambda (file)
+                      (install-file file (string-append include-to "/tgl/auto"))
+                      (delete-file file))
+                    (find-files "auto" "\\.h$"))
+                   (for-each
+                    (lambda (file)
+                      (install-file file (string-append include-to "/tgl"))
+                      (delete-file file))
+                    (find-files "." "\\.h$")))
+                 ;; Install libraries.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append lib-to "/tgl")))
+                  (find-files lib-from "\\.(a|so)$")))
+               #t)))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Library")
+      (description "TGL is the telegram library for telegram-cli.")
+      (home-page "https://github.com/vysheng/tgl")
+      (license license:lgpl2.1+))))
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 6418 bytes --]

From f7bb371f28dfac22dc52e2091c7fc5adb88dd3a4 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:49:04 -0500
Subject: [PATCH 3/3] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 120 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 120 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 2ff30c209e..1e83e33dfa 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -43,14 +43,19 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -704,3 +709,118 @@ a part of telegram-cli, but now being maintained separately.")
       (description "TGL is the telegram library for telegram-cli.")
       (home-page "https://github.com/vysheng/tgl")
       (license license:lgpl2.1+))))
+
+(define-public telegram-cli
+  (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a")
+        (revision "324"))
+    (package
+      (name "telegram-cli")
+      (version
+       (git-version "1.3.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tg.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+             (lambda* (#:key inputs #:allow-other-keys)
+               (for-each delete-file
+                         (list
+                          "Makefile.tgl"
+                          "Makefile.tl-parser"))
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                  "")
+                 (("-I\\$\\{srcdir\\}/tgl")
+                  (string-append "-I" (assoc-ref inputs "tgl")
+                                 "/include/tgl"))
+                 (("AUTO=auto")
+                  (string-append "AUTO=" (assoc-ref inputs "tgl")
+                                 "/include/tgl/auto"))
+                 (("LIB=libs")
+                  (string-append "LIB=" (assoc-ref inputs "tgl")
+                                 "/lib/tgl")))
+               #t))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (source (string-append (getenv "TEMP") "/source")))
+                 ;; Install client.
+                 (install-file
+                  (string-append source "/bin/telegram-cli")
+                  (string-append out "/bin"))
+                 ;; Install daemon.
+                 (install-file
+                  (string-append source "/start-telegram-daemon")
+                  (string-append out "/bin"))
+                 ;; Install daemon script.
+                 (install-file
+                  (string-append source "/telegram-daemon")
+                  (string-append out "/etc/init.d"))
+                 ;; Install server public-key.
+                 (install-file
+                  (string-append source "/server.pub")
+                  (string-append out "/etc/telegram-cli")))
+               #t))
+           (add-after 'install 'patch-daemon-files
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out")))
+                 (with-directory-excursion out
+                   (substitute* "etc/init.d/telegram-daemon"
+                     (("KOT\\'s meta engine")
+                      "Telegram Messaging System")
+                     (("/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin")
+                      "$PATH")
+                     (("\\$ROOT/usr/share/telegram-daemon/bin")
+                      (string-append out "/bin"))
+                     (("/etc/init\\.d")
+                      (string-append out "/etc/init.d")))
+                   (substitute* "bin/start-telegram-daemon"
+                     (("msg-search-engine")
+                      "telegram-cli")
+                     (("\\$root/usr/share/telegram-daemon/bin")
+                      (string-append out "/bin")))))
+               #t)))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("jansson" ,jansson)
+         ("libconfig" ,libconfig)
+         ("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("lua" ,lua)
+         ("openssl" ,openssl)
+         ("perl" ,perl)
+         ("python" ,python)
+         ("readline" ,readline)
+         ("tgl" ,tgl)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Messenger CLI")
+      (description "TG is the command-line interface for Telegram Messenger.")
+      (home-page "https://github.com/vysheng/tg")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v6)
  2021-02-01  8:30   ` Leo Prikler
@ 2021-02-01 22:18     ` Raghav Gururajan
  0 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-01 22:18 UTC (permalink / raw)
  To: Leo Prikler, 45954


[-- Attachment #1.1.1: Type: text/plain, Size: 1138 bytes --]

Hi Leo!

> The commit does not match up with the version.  If this is intended,
> use git-version instead.

Changed in v7.

> You might want to write that in terms of copy-build-system.

Hmm. I tried but couldn't come up with a way to do it like that. :(

> Same here.  Also, I'm not sure if SysV init scripts are that compatible
> with Guix running on Shepherd.  Is there a more direct way of launching
> the daemon?

Updated git-version in v7.

The script may only be used on foreign-distro for now. For guix system, 
we need to define a service for it.

Also, running telegram-cli doesn't require daemon, but vice-versa. The 
daemon is intended to be a complimentary feature to run telegram-cli on 
headless server.

> Not that it makes much of a difference, as I doubt this file will still
> be needed, but PATH=$PATH is a noop.  Perhaps you want (getenv "PATH")
> instead?

I don't think so. The file is a run-time script. So the script will use 
the value of env-var PATH provided by the system. Using (getenv "PATH") 
will instead use the value of PATH inside the build environment.

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v7)
  2021-02-01 22:08 ` [bug#45954] Telegram-CLI (v7) Raghav Gururajan
@ 2021-02-01 22:39   ` Leo Prikler
  2021-02-02  2:33     ` Raghav Gururajan
  0 siblings, 1 reply; 19+ messages in thread
From: Leo Prikler @ 2021-02-01 22:39 UTC (permalink / raw)
  To: Raghav Gururajan, 45954

Am Montag, den 01.02.2021, 17:08 -0500 schrieb Raghav Gururajan:
> +(define-public telegram-cli
> +  (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a")
> +        (revision "324"))
> +    (package
> +      (name "telegram-cli")
> +      (version
> +       (git-version "1.3.1" revision commit))
I didn't notice this before, but is there a reason to package this
version over 1.3.1?

> (getenv "TEMP")
Please stop trying to use this as a snippet to mean "the root of the
source and build directory".  It is extremely obscure and people are
already using "../source" just fine.  (Just do an rgrep if you aren't
convinced.)

> > You might want to write that in terms of copy-build-system.
> 
> Hmm. I tried but couldn't come up with a way to do it like that. :(
You can still try harder for v8 ;)

> The script may only be used on foreign-distro for now. For guix
> system, 
> we need to define a service for it.
> 
> Also, running telegram-cli doesn't require daemon, but vice-versa.
> The 
> daemon is intended to be a complimentary feature to run telegram-cli
> on 
> headless server.
In that case, does the daemon script have any value of its own?  Given
that the latest release of telegram-cli is about six years old, I doubt
there is – foreign distros should already have it in their repos and
Guix as a package manager makes no claim to manage system stuff like
services on foreign distros.

> The file is a run-time script.
That means literally nothing.  The wrap phase exists for a reason, some
programs and script are even wrapped twice.

> Using (getenv "PATH") will instead use the value of PATH inside the
> build environment.
So you'll inadvertently have some native-inputs in it, is what you're
trying to say?  Of course, there are better ways of wrapping PATH, but
in this case wouldn't it be wise to limit it to just the expected
paths?  Again, assuming that there is even merit in shipping this file,
which is yet to be proven.

Regards,
Leo





^ permalink raw reply	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v8)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
                   ` (5 preceding siblings ...)
  2021-02-01 22:08 ` [bug#45954] Telegram-CLI (v7) Raghav Gururajan
@ 2021-02-02  2:25 ` Raghav Gururajan
  2021-02-03  1:56 ` [bug#45954] Telegram-CLI (v9) Raghav Gururajan
  2021-02-03 17:50 ` [bug#45954] Telegram-CLI (v10) Raghav Gururajan
  8 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-02  2:25 UTC (permalink / raw)
  To: 45954; +Cc: Leo Prikler


[-- Attachment #1.1.1: Type: text/plain, Size: 2 bytes --]



[-- Attachment #1.1.2: 0001-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2618 bytes --]

From 694ddc229f4fd6b1a18ae4d1a56a6a2fb43c6988 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:38:25 -0500
Subject: [PATCH 1/3] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 66b94baf28..d05670fc51 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -555,3 +555,52 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "21"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (include (string-append out "/include"))
+                      (source "../source")
+                      (build (getcwd)))
+                 ;; Install executables.
+                 (with-directory-excursion build
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin))
+                    (list
+                     "tl-parser")))
+                 ;; Install headers.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append include "/tl-parser")))
+                  (find-files source "\\.h$")))
+               #t)))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 5194 bytes --]

From 4fe2b461cc07ffac3de2bd37775e01a217d485df Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:42:24 -0500
Subject: [PATCH 2/3] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 100 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index d05670fc51..d61fdf21eb 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -34,10 +34,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -604,3 +606,101 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed")
+        (revision "181"))
+    (package
+      (name "tgl")
+      (version
+       (git-version "2.0.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tgl.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl"
+          ;; Enable extended queries system.
+          "--enable-extf"
+          ;; Include libevent-based net and timers.
+          "--enable-libevent")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tl-parser
+             (lambda _
+               (delete-file "Makefile.tl-parser")
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("\\$\\{EXE\\}/tl-parser")
+                  "tl-parser"))
+               #t))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin-to (string-append out "/bin"))
+                      (include-to (string-append out "/include"))
+                      (lib-to (string-append out "/lib"))
+                      (source "../source")
+                      (bin-from (string-append source "/bin"))
+                      (lib-from (string-append source "/libs")))
+                 ;; Install executables.
+                 (with-directory-excursion bin-from
+                   (for-each
+                    (lambda (file)
+                      (install-file file bin-to))
+                    (list
+                     "generate")))
+                 ;; Install headers.
+                 (with-directory-excursion source
+                   (for-each
+                    (lambda (file)
+                      (install-file file (string-append include-to "/tgl/crypto"))
+                      (delete-file file))
+                    (find-files "crypto" "\\.h$"))
+                   (for-each
+                    (lambda (file)
+                      (install-file file (string-append include-to "/tgl/auto"))
+                      (delete-file file))
+                    (find-files "auto" "\\.h$"))
+                   (for-each
+                    (lambda (file)
+                      (install-file file (string-append include-to "/tgl"))
+                      (delete-file file))
+                    (find-files "." "\\.h$")))
+                 ;; Install libraries.
+                 (for-each
+                  (lambda (file)
+                    (install-file file (string-append lib-to "/tgl")))
+                  (find-files lib-from "\\.(a|so)$")))
+               #t)))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Library")
+      (description "TGL is the telegram library for telegram-cli.")
+      (home-page "https://github.com/vysheng/tgl")
+      (license license:lgpl2.1+))))
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 4989 bytes --]

From 6f3621496e19b8b71c04e126de22f6f837714d5e Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:49:04 -0500
Subject: [PATCH 3/3] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 93 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index d61fdf21eb..fdafa7fdbf 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -43,14 +43,19 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -704,3 +709,91 @@ a part of telegram-cli, but now being maintained separately.")
       (description "TGL is the telegram library for telegram-cli.")
       (home-page "https://github.com/vysheng/tgl")
       (license license:lgpl2.1+))))
+
+(define-public telegram-cli
+  (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a")
+        (revision "324"))
+    (package
+      (name "telegram-cli")
+      (version
+       (git-version "1.3.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tg.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+             (lambda* (#:key inputs #:allow-other-keys)
+               (for-each delete-file
+                         (list
+                          "Makefile.tgl"
+                          "Makefile.tl-parser"))
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                  "")
+                 (("-I\\$\\{srcdir\\}/tgl")
+                  (string-append "-I" (assoc-ref inputs "tgl")
+                                 "/include/tgl"))
+                 (("AUTO=auto")
+                  (string-append "AUTO=" (assoc-ref inputs "tgl")
+                                 "/include/tgl/auto"))
+                 (("LIB=libs")
+                  (string-append "LIB=" (assoc-ref inputs "tgl")
+                                 "/lib/tgl")))
+               #t))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (source "../source"))
+                 ;; Install client.
+                 (install-file
+                  (string-append source "/bin/telegram-cli")
+                  (string-append out "/bin"))
+                 ;; Install server public-key.
+                 (install-file
+                  (string-append source "/server.pub")
+                  (string-append out "/etc/telegram-cli")))
+               #t)))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("jansson" ,jansson)
+         ("libconfig" ,libconfig)
+         ("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("lua" ,lua)
+         ("openssl" ,openssl)
+         ("perl" ,perl)
+         ("python" ,python)
+         ("readline" ,readline)
+         ("tgl" ,tgl)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Messenger CLI")
+      (description "TG is the command-line interface for Telegram Messenger.")
+      (home-page "https://github.com/vysheng/tg")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #1.1.5: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v7)
  2021-02-01 22:39   ` Leo Prikler
@ 2021-02-02  2:33     ` Raghav Gururajan
  2021-02-02  9:50       ` [bug#45954] Telegram-CLI (v7/v8) Leo Prikler
  0 siblings, 1 reply; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-02  2:33 UTC (permalink / raw)
  To: Leo Prikler, 45954


[-- Attachment #1.1.1: Type: text/plain, Size: 2235 bytes --]

Hi Leo!

> I didn't notice this before, but is there a reason to package this
> version over 1.3.1?

Yeah, there are quite a lot of improvements after the 1.3.1 release.

> Please stop trying to use this as a snippet to mean "the root of the
> source and build directory".  It is extremely obscure and people are
> already using "../source" just fine.  (Just do an rgrep if you aren't
> convinced.)

Fixed in v8.

>> Hmm. I tried but couldn't come up with a way to do it like that. :(
> You can still try harder for v8 ;)

I tried different ways but the arguments key-words between gnu and copy 
differ a lot. I am unable use key-words from both build systems at the 
same time. Like using #:configure-flags (from gnu) and #:install (from 
copy).

Also, I spent significant amount time to come up the phase I have. So if 
there are no critical issues, I would like to keep it as-is. :-)

>> The script may only be used on foreign-distro for now. For guix
>> system,
>> we need to define a service for it.
>>
>> Also, running telegram-cli doesn't require daemon, but vice-versa.
>> The
>> daemon is intended to be a complimentary feature to run telegram-cli
>> on
>> headless server.
> In that case, does the daemon script have any value of its own?  Given
> that the latest release of telegram-cli is about six years old, I doubt
> there is – foreign distros should already have it in their repos and
> Guix as a package manager makes no claim to manage system stuff like
> services on foreign distros.
> 
>> The file is a run-time script.
> That means literally nothing.  The wrap phase exists for a reason, some
> programs and script are even wrapped twice.
> 
>> Using (getenv "PATH") will instead use the value of PATH inside the
>> build environment.
> So you'll inadvertently have some native-inputs in it, is what you're
> trying to say?  Of course, there are better ways of wrapping PATH, but
> in this case wouldn't it be wise to limit it to just the expected
> paths?  Again, assuming that there is even merit in shipping this file,
> which is yet to be proven.

I don't know what I was thinking. XD. It is pretty useless to ship. I 
removed it in v8.

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v7/v8)
  2021-02-02  2:33     ` Raghav Gururajan
@ 2021-02-02  9:50       ` Leo Prikler
  2021-02-03  2:41         ` Raghav Gururajan
  0 siblings, 1 reply; 19+ messages in thread
From: Leo Prikler @ 2021-02-02  9:50 UTC (permalink / raw)
  To: Raghav Gururajan, 45954

Hi Raghav,

Am Montag, den 01.02.2021, 21:33 -0500 schrieb Raghav Gururajan:
> Hi Leo!
> 
> > I didn't notice this before, but is there a reason to package this
> > version over 1.3.1?
> 
> Yeah, there are quite a lot of improvements after the 1.3.1 release.
Anything particularly worth noting?

> > Please stop trying to use this as a snippet to mean "the root of
> > the
> > source and build directory".  It is extremely obscure and people
> > are
> > already using "../source" just fine.  (Just do an rgrep if you
> > aren't
> > convinced.)
> 
> Fixed in v8.
"Fixed".  While it is true, that you're no longer using getenv, binding
source for string-append later on is not a particularly elegant
solution either.

> > > Hmm. I tried but couldn't come up with a way to do it like that.
> > > :(
> > You can still try harder for v8 ;)
> 
> I tried different ways but the arguments key-words between gnu and
> copy 
> differ a lot. I am unable use key-words from both build systems at
> the 
> same time. Like using #:configure-flags (from gnu) and #:install
> (from 
> copy).
Use something along the lines of
  (replace 'install 
    (lambda args
      (apply (assoc-ref copy:%standard-phases 'install)
             #:install-plan <your install plan>
             args)))
Phases should be written in a way, that gratuitous arguments will not
be read, but passing it in arguments through the package-arguments
fields remains tricky.  Though even if it were possible, the snippet
above has better locality.

> Also, I spent significant amount time to come up the phase I have. So
> if 
> there are no critical issues, I would like to keep it as-is. :-)
I personally regard readability as a severe issue in this case.  Of
course there would be ways of doing this without invoking copy-build-
system, but in my personal opinion an install plan would likely be the
most concise here.

For instance instead of using string-append source everywhere, you
could just use a directory excursion.  But more importantly, why is it,
that all of the stuff you're installing is located in the source
directory?  Do you even build anything that ends up in the
installation?  Would it make more sense to have #:out-of-source? #f?

In tgl, you use several directory excursions when arguably only one
would be needed.  Try to simplify your install process, so that you
need to bind as few variables as possible.

Regards,
Leo





^ permalink raw reply	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v9)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
                   ` (6 preceding siblings ...)
  2021-02-02  2:25 ` [bug#45954] Telegram-CLI (v8) Raghav Gururajan
@ 2021-02-03  1:56 ` Raghav Gururajan
  2021-02-03  8:16   ` Leo Prikler
  2021-02-03 17:50 ` [bug#45954] Telegram-CLI (v10) Raghav Gururajan
  8 siblings, 1 reply; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-03  1:56 UTC (permalink / raw)
  To: 45954; +Cc: Leo Prikler


[-- Attachment #1.1.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #1.1.2: 0001-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2725 bytes --]

From d4e345b0d04b0bfd3d60bf9734be4f4e80ef1066 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:38:25 -0500
Subject: [PATCH 1/3] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 66b94baf28..ed0484366c 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -55,6 +55,7 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -555,3 +556,49 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "21"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:imported-modules
+         (,@%cmake-build-system-modules
+          (guix build copy-build-system))
+         #:modules
+         ((guix build cmake-build-system)
+          ((guix build copy-build-system)
+           #:prefix copy:)
+          (guix build utils))
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda args
+               (apply (assoc-ref copy:%standard-phases 'install)
+                      #:install-plan
+                      '(("." "bin"
+                         #:include ("tl-parser"))
+                        ("../source" "include/tl-parser"
+                         #:include-regexp ("\\.h$")))
+                      args))))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 3981 bytes --]

From 0fa448a90e6759c96f0185b275b2c52b5c96aaf3 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:42:24 -0500
Subject: [PATCH 2/3] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 78 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index ed0484366c..526f6878e4 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -34,10 +34,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -602,3 +604,79 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed")
+        (revision "181"))
+    (package
+      (name "tgl")
+      (version
+       (git-version "2.0.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tgl.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:imported-modules
+         (,@%gnu-build-system-modules
+          (guix build copy-build-system))
+         #:modules
+         ((guix build gnu-build-system)
+          ((guix build copy-build-system)
+           #:prefix copy:)
+          (guix build utils))
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl"
+          ;; Enable extended queries system.
+          "--enable-extf"
+          ;; Include libevent-based net and timers.
+          "--enable-libevent")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tl-parser
+             (lambda _
+               (delete-file "Makefile.tl-parser")
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("\\$\\{EXE\\}/tl-parser")
+                  "tl-parser"))
+               #t))
+           (replace 'install
+             (lambda args
+               (apply (assoc-ref copy:%standard-phases 'install)
+                      #:install-plan
+                      '(("bin" "bin")
+                        ("." "include/tgl"
+                         #:include-regexp ("\\.h$"))
+                        ("libs" "lib/tgl"))
+                      args))))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Library")
+      (description "TGL is the telegram library for telegram-cli.")
+      (home-page "https://github.com/vysheng/tgl")
+      (license license:lgpl2.1+))))
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 5074 bytes --]

From d9b04976499e2639b2058c0b349f9fa4e2749772 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:49:04 -0500
Subject: [PATCH 3/3] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 97 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 526f6878e4..cbce76b3e9 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -43,14 +43,19 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -680,3 +685,95 @@ a part of telegram-cli, but now being maintained separately.")
       (description "TGL is the telegram library for telegram-cli.")
       (home-page "https://github.com/vysheng/tgl")
       (license license:lgpl2.1+))))
+
+(define-public telegram-cli
+  (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a")
+        (revision "324"))
+    (package
+      (name "telegram-cli")
+      (version
+       (git-version "1.3.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tg.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:imported-modules
+         (,@%gnu-build-system-modules
+          (guix build copy-build-system))
+         #:modules
+         ((guix build gnu-build-system)
+          ((guix build copy-build-system)
+           #:prefix copy:)
+          (guix build utils))
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+             (lambda* (#:key inputs #:allow-other-keys)
+               (for-each delete-file
+                         (list
+                          "Makefile.tgl"
+                          "Makefile.tl-parser"))
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                  "")
+                 (("-I\\$\\{srcdir\\}/tgl")
+                  (string-append "-I" (assoc-ref inputs "tgl")
+                                 "/include/tgl"))
+                 (("AUTO=auto")
+                  (string-append "AUTO=" (assoc-ref inputs "tgl")
+                                 "/include/tgl/auto"))
+                 (("LIB=libs")
+                  (string-append "LIB=" (assoc-ref inputs "tgl")
+                                 "/lib/tgl")))
+               #t))
+           (replace 'install
+             (lambda args
+               (apply (assoc-ref copy:%standard-phases 'install)
+                      #:install-plan
+                      '(("bin" "bin")
+                        ("." "etc/telegram-cli"
+                         #:include-regexp ("\\.pub$")
+                         #:exclude ("tg-server.pub")))
+                      args))))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("jansson" ,jansson)
+         ("libconfig" ,libconfig)
+         ("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("lua" ,lua)
+         ("openssl" ,openssl)
+         ("perl" ,perl)
+         ("python" ,python)
+         ("readline" ,readline)
+         ("tgl" ,tgl)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Messenger CLI")
+      (description "TG is the command-line interface for Telegram Messenger.")
+      (home-page "https://github.com/vysheng/tg")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v7/v8)
  2021-02-02  9:50       ` [bug#45954] Telegram-CLI (v7/v8) Leo Prikler
@ 2021-02-03  2:41         ` Raghav Gururajan
  0 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-03  2:41 UTC (permalink / raw)
  To: Leo Prikler, 45954


[-- Attachment #1.1: Type: text/plain, Size: 2406 bytes --]

Hi Leo!

> Anything particularly worth noting?

Not sure. But based on commit messages, it seems lot of bug fixes.

>>> Please stop trying to use this as a snippet to mean "the root of
>>> the
>>> source and build directory".  It is extremely obscure and people
>>> are
>>> already using "../source" just fine.  (Just do an rgrep if you
>>> aren't
>>> convinced.)
>>
>> Fixed in v8.
> "Fixed".  While it is true, that you're no longer using getenv, binding
> source for string-append later on is not a particularly elegant
> solution either.
> 
>>>> Hmm. I tried but couldn't come up with a way to do it like that.
>>>> :(
>>> You can still try harder for v8 ;)
>>
>> I tried different ways but the arguments key-words between gnu and
>> copy
>> differ a lot. I am unable use key-words from both build systems at
>> the
>> same time. Like using #:configure-flags (from gnu) and #:install
>> (from
>> copy).
> Use something along the lines of
>    (replace 'install
>      (lambda args
>        (apply (assoc-ref copy:%standard-phases 'install)
>               #:install-plan <your install plan>
>               args)))
> Phases should be written in a way, that gratuitous arguments will not
> be read, but passing it in arguments through the package-arguments
> fields remains tricky.  Though even if it were possible, the snippet
> above has better locality.
> 
>> Also, I spent significant amount time to come up the phase I have. So
>> if
>> there are no critical issues, I would like to keep it as-is. :-)
> I personally regard readability as a severe issue in this case.  Of
> course there would be ways of doing this without invoking copy-build-
> system, but in my personal opinion an install plan would likely be the
> most concise here.
> 
> For instance instead of using string-append source everywhere, you
> could just use a directory excursion.  But more importantly, why is it,
> that all of the stuff you're installing is located in the source
> directory?  Do you even build anything that ends up in the
> installation?  Would it make more sense to have #:out-of-source? #f?
> 
> In tgl, you use several directory excursions when arguably only one
> would be needed.  Try to simplify your install process, so that you
> need to bind as few variables as possible.

Agreed. I have updated the pack-def in v9. :-)

Regards,
RG.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v9)
  2021-02-03  1:56 ` [bug#45954] Telegram-CLI (v9) Raghav Gururajan
@ 2021-02-03  8:16   ` Leo Prikler
  2021-02-03 17:52     ` Raghav Gururajan
  0 siblings, 1 reply; 19+ messages in thread
From: Leo Prikler @ 2021-02-03  8:16 UTC (permalink / raw)
  To: Raghav Gururajan, 45954

Hello Raghav,

Am Dienstag, den 02.02.2021, 20:56 -0500 schrieb Raghav Gururajan:
> +         (,@%gnu-build-system-modules
> +          (guix build copy-build-system))
> +         #:modules
> +         ((guix build gnu-build-system)
> +          ((guix build copy-build-system)
> +           #:prefix copy:)
> +          (guix build utils))
It is Guix convention to put the added component in front of the
others, i.e. 
> +         ((guix build copy-build-system)
> +          ,@%gnu-build-system-modules)
and so on.  Otherwise LGTM so far; I'll be doing functionality tests
later today.  If you don't send v10 by then, I can also make that
change for you.

Regards,
Leo





^ permalink raw reply	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v10)
  2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
                   ` (7 preceding siblings ...)
  2021-02-03  1:56 ` [bug#45954] Telegram-CLI (v9) Raghav Gururajan
@ 2021-02-03 17:50 ` Raghav Gururajan
  2021-02-03 18:18   ` bug#45954: " Leo Prikler
  8 siblings, 1 reply; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-03 17:50 UTC (permalink / raw)
  To: 45954; +Cc: Leo Prikler


[-- Attachment #1.1.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #1.1.2: 0001-gnu-Add-tl-parser.patch --]
[-- Type: text/x-patch, Size: 2725 bytes --]

From d06c864e9afef080e1e12e33e50d751494853d07 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:38:25 -0500
Subject: [PATCH 1/3] gnu: Add tl-parser.

* gnu/packages/telegram.scm (tl-parser): New variable.
---
 gnu/packages/telegram.scm | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 66b94baf28..fcc22949df 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -55,6 +55,7 @@
   #:use-module (guix packages)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -555,3 +556,49 @@ Telegram instant messager.")
       license:lgpl2.1+
       ;; Others
       license:gpl3+))))
+
+(define-public tl-parser
+  (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+        (revision "21"))
+    (package
+      (name "tl-parser")
+      (version
+       (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tl-parser.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:imported-modules
+         ((guix build copy-build-system)
+          ,@%cmake-build-system-modules)
+         #:modules
+         (((guix build copy-build-system)
+           #:prefix copy:)
+          (guix build cmake-build-system)
+          (guix build utils))
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'install
+             (lambda args
+               (apply (assoc-ref copy:%standard-phases 'install)
+                      #:install-plan
+                      '(("." "bin"
+                         #:include ("tl-parser"))
+                        ("../source" "include/tl-parser"
+                         #:include-regexp ("\\.h$")))
+                      args))))))
+      (synopsis "Parse tl scheme to tlo")
+      (description "TL-Parser is a tl scheme to tlo file parser.  It was formely
+a part of telegram-cli, but now being maintained separately.")
+      (home-page "https://github.com/vysheng/tl-parser")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #1.1.3: 0002-gnu-Add-tgl.patch --]
[-- Type: text/x-patch, Size: 3981 bytes --]

From 2026d222aa1f9f376f70717b4a4348bd920107c2 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:42:24 -0500
Subject: [PATCH 2/3] gnu: Add tgl.

* gnu/packages/telegram.scm (tgl): New variable.
---
 gnu/packages/telegram.scm | 78 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index fcc22949df..73eeb80535 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -34,10 +34,12 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gnupg)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
+  #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
@@ -602,3 +604,79 @@ Telegram instant messager.")
 a part of telegram-cli, but now being maintained separately.")
       (home-page "https://github.com/vysheng/tl-parser")
       (license license:gpl2+))))
+
+(define-public tgl
+  (let ((commit "ffb04caca71de0cddf28cd33a4575922900a59ed")
+        (revision "181"))
+    (package
+      (name "tgl")
+      (version
+       (git-version "2.0.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tgl.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0cf5s7ygslb5klg1qv9qdc3hivhspmvh3zkacyyhd2yyikb5p0f9"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:imported-modules
+         ((guix build copy-build-system)
+          ,@%gnu-build-system-modules)
+         #:modules
+         (((guix build copy-build-system)
+           #:prefix copy:)
+          (guix build gnu-build-system)
+          (guix build utils))
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl"
+          ;; Enable extended queries system.
+          "--enable-extf"
+          ;; Include libevent-based net and timers.
+          "--enable-libevent")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tl-parser
+             (lambda _
+               (delete-file "Makefile.tl-parser")
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("\\$\\{EXE\\}/tl-parser")
+                  "tl-parser"))
+               #t))
+           (replace 'install
+             (lambda args
+               (apply (assoc-ref copy:%standard-phases 'install)
+                      #:install-plan
+                      '(("bin" "bin")
+                        ("." "include/tgl"
+                         #:include-regexp ("\\.h$"))
+                        ("libs" "lib/tgl"))
+                      args))))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Library")
+      (description "TGL is the telegram library for telegram-cli.")
+      (home-page "https://github.com/vysheng/tgl")
+      (license license:lgpl2.1+))))
-- 
2.30.0


[-- Attachment #1.1.4: 0003-gnu-Add-telegram-cli.patch --]
[-- Type: text/x-patch, Size: 5074 bytes --]

From 9ea10b70d4fc15f4ccfacc6ee2c64e9aaccbfc47 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Mon, 1 Feb 2021 16:49:04 -0500
Subject: [PATCH 3/3] gnu: Add telegram-cli.

* gnu/packages/telegram.scm (telegram-cli): New variable.
---
 gnu/packages/telegram.scm | 97 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 73eeb80535..9b27b86e50 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -43,14 +43,19 @@
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
+  #:use-module (gnu packages lua)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages textutils)
   #:use-module (gnu packages telephony)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -680,3 +685,95 @@ a part of telegram-cli, but now being maintained separately.")
       (description "TGL is the telegram library for telegram-cli.")
       (home-page "https://github.com/vysheng/tgl")
       (license license:lgpl2.1+))))
+
+(define-public telegram-cli
+  (let ((commit "6547c0b21b977b327b3c5e8142963f4bc246187a")
+        (revision "324"))
+    (package
+      (name "telegram-cli")
+      (version
+       (git-version "1.3.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri
+          (git-reference
+           (url "https://github.com/vysheng/tg.git")
+           (commit commit)))
+         (file-name
+          (git-file-name name version))
+         (sha256
+          (base32 "0c1w7jgska71jjbvg1y09v52549pwa4zkdjly18yxywn7gayd2p6"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; No target
+         #:imported-modules
+         ((guix build copy-build-system)
+          ,@%gnu-build-system-modules)
+         #:modules
+         (((guix build copy-build-system)
+           #:prefix copy:)
+          (guix build gnu-build-system)
+          (guix build utils))
+         #:configure-flags
+         (list
+          ;; Use gcrypt instead of openssl.
+          "--disable-openssl")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'trigger-bootstrap
+             (lambda _
+               (delete-file "configure")
+               #t))
+           (add-after 'trigger-bootstrap 'patch-tgl-and-tlparser
+             (lambda* (#:key inputs #:allow-other-keys)
+               (for-each delete-file
+                         (list
+                          "Makefile.tgl"
+                          "Makefile.tl-parser"))
+               (substitute* "Makefile.in"
+                 (("include \\$\\{srcdir\\}/Makefile\\.tl-parser")
+                  "")
+                 (("include \\$\\{srcdir\\}/Makefile\\.tgl")
+                  "")
+                 (("-I\\$\\{srcdir\\}/tgl")
+                  (string-append "-I" (assoc-ref inputs "tgl")
+                                 "/include/tgl"))
+                 (("AUTO=auto")
+                  (string-append "AUTO=" (assoc-ref inputs "tgl")
+                                 "/include/tgl/auto"))
+                 (("LIB=libs")
+                  (string-append "LIB=" (assoc-ref inputs "tgl")
+                                 "/lib/tgl")))
+               #t))
+           (replace 'install
+             (lambda args
+               (apply (assoc-ref copy:%standard-phases 'install)
+                      #:install-plan
+                      '(("bin" "bin")
+                        ("." "etc/telegram-cli"
+                         #:include-regexp ("\\.pub$")
+                         #:exclude ("tg-server.pub")))
+                      args))))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("libtool" ,libtool)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("jansson" ,jansson)
+         ("libconfig" ,libconfig)
+         ("libevent" ,libevent)
+         ("libgcrypt" ,libgcrypt)
+         ("lua" ,lua)
+         ("openssl" ,openssl)
+         ("perl" ,perl)
+         ("python" ,python)
+         ("readline" ,readline)
+         ("tgl" ,tgl)
+         ("tl-parser" ,tl-parser)
+         ("zlib" ,zlib)))
+      (synopsis "Telegram Messenger CLI")
+      (description "TG is the command-line interface for Telegram Messenger.")
+      (home-page "https://github.com/vysheng/tg")
+      (license license:gpl2+))))
-- 
2.30.0


[-- Attachment #1.1.5: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [bug#45954] Telegram-CLI (v9)
  2021-02-03  8:16   ` Leo Prikler
@ 2021-02-03 17:52     ` Raghav Gururajan
  0 siblings, 0 replies; 19+ messages in thread
From: Raghav Gururajan @ 2021-02-03 17:52 UTC (permalink / raw)
  To: Leo Prikler, 45954


[-- Attachment #1.1.1: Type: text/plain, Size: 386 bytes --]

Hi Leo!

> It is Guix convention to put the added component in front of the
> others, i.e.
>> +         ((guix build copy-build-system)
>> +          ,@%gnu-build-system-modules)
> and so on.  Otherwise LGTM so far; I'll be doing functionality tests
> later today.  If you don't send v10 by then, I can also make that
> change for you.

I have sent v10. :-)

Regards,
RG.

[-- Attachment #1.1.2: OpenPGP_0x5F5816647F8BE551.asc --]
[-- Type: application/pgp-keys, Size: 2649 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#45954: Telegram-CLI (v10)
  2021-02-03 17:50 ` [bug#45954] Telegram-CLI (v10) Raghav Gururajan
@ 2021-02-03 18:18   ` Leo Prikler
  0 siblings, 0 replies; 19+ messages in thread
From: Leo Prikler @ 2021-02-03 18:18 UTC (permalink / raw)
  To: Raghav Gururajan, 45954-done

Thanks, pushed!





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-02-03 18:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18  9:16 [bug#45954] Telegram-CLI Raghav Gururajan
2021-01-19 15:08 ` [bug#45954] Telegram-CLI (v2) Raghav Gururajan
2021-01-20 10:44 ` [bug#45954] Telegram-CLI (v3) Raghav Gururajan
2021-01-22  4:44 ` [bug#45954] Telegram-CLI (v4) Raghav Gururajan
2021-01-28  1:00 ` [bug#45954] Telegram-CLI (v5) Raghav Gururajan
2021-01-31 19:46 ` [bug#45954] Telegram-CLI (v6) Raghav Gururajan
2021-02-01  8:30   ` Leo Prikler
2021-02-01 22:18     ` Raghav Gururajan
2021-02-01 22:08 ` [bug#45954] Telegram-CLI (v7) Raghav Gururajan
2021-02-01 22:39   ` Leo Prikler
2021-02-02  2:33     ` Raghav Gururajan
2021-02-02  9:50       ` [bug#45954] Telegram-CLI (v7/v8) Leo Prikler
2021-02-03  2:41         ` Raghav Gururajan
2021-02-02  2:25 ` [bug#45954] Telegram-CLI (v8) Raghav Gururajan
2021-02-03  1:56 ` [bug#45954] Telegram-CLI (v9) Raghav Gururajan
2021-02-03  8:16   ` Leo Prikler
2021-02-03 17:52     ` Raghav Gururajan
2021-02-03 17:50 ` [bug#45954] Telegram-CLI (v10) Raghav Gururajan
2021-02-03 18:18   ` bug#45954: " Leo Prikler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).