Telegram-CLI

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Prikler
  • Raghav Gururajan
Owner
unassigned
Submitted by
Raghav Gururajan
Severity
normal
R
R
Raghav Gururajan wrote on 18 Jan 2021 10:16
(address . guix-patches@gnu.org)
b7e16c9e-1f9b-0e02-7185-eb9952511252@raghavgururajan.name
Hello Guix!

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

Regards,
RG.
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(+)

Toggle diff (107 lines)
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
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(+)

Toggle diff (119 lines)
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
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(+)

Toggle diff (59 lines)
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
R
R
Raghav Gururajan wrote on 19 Jan 2021 16:08
Telegram-CLI (v2)
(address . 45954@debbugs.gnu.org)
8faa59bb-369f-a6e5-f2bb-f2025cf41448@raghavgururajan.name

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(+)

Toggle diff (59 lines)
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
R
R
Raghav Gururajan wrote on 20 Jan 2021 11:44
Telegram-CLI (v3)
(address . 45954@debbugs.gnu.org)
dd69bdcb-cb37-5331-5f5d-e1c51d2c6680@raghavgururajan.name

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(+)

Toggle diff (59 lines)
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
R
R
Raghav Gururajan wrote on 22 Jan 2021 05:44
Telegram-CLI (v4)
(address . 45954@debbugs.gnu.org)
3d9e9520-a5c2-8bed-cb24-f7b1d3b58b52@raghavgururajan.name

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(+)

Toggle diff (118 lines)
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
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(+)

Toggle diff (59 lines)
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
R
R
Raghav Gururajan wrote on 28 Jan 2021 02:00
Telegram-CLI (v5)
(address . 45954@debbugs.gnu.org)
30b8abee-81cf-67de-6753-f3b127c6ba7a@raghavgururajan.name

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(+)

Toggle diff (59 lines)
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
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(+)

Toggle diff (118 lines)
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
R
R
Raghav Gururajan wrote on 31 Jan 2021 20:46
Telegram-CLI (v6)
(address . 45954@debbugs.gnu.org)(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
5f1840a5-37b2-731d-b3fe-eff1f33e2550@raghavgururajan.name
P.S. Just in case if v5 doesn't apply on current master.
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(+)

Toggle diff (59 lines)
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
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(+)

Toggle diff (118 lines)
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: OpenPGP_signature
L
L
Leo Prikler wrote on 1 Feb 2021 09:30
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
f2529b6a7dfd934349b57bf1d52802fa7f41a532.camel@student.tugraz.at
Am Sonntag, den 31.01.2021, 14:46 -0500 schrieb Raghav Gururajan:
Toggle quote (11 lines)
> +(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.

Toggle quote (43 lines)
> + (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.

Toggle quote (22 lines)
> + (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?

Toggle quote (3 lines)
> + (("/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
R
R
Raghav Gururajan wrote on 1 Feb 2021 23:08
Telegram-CLI (v7)
(address . 45954@debbugs.gnu.org)
a00b3a55-c5da-2ff3-14d9-ccc2b58d15f2@raghavgururajan.name

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(+)

Toggle diff (59 lines)
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: OpenPGP_signature
R
R
Raghav Gururajan wrote on 1 Feb 2021 23:18
Re: Telegram-CLI (v6)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
494758df-748b-7f1d-5f69-45d80cdaa0e8@raghavgururajan.name
Hi Leo!

Toggle quote (3 lines)
> The commit does not match up with the version. If this is intended,
> use git-version instead.

Changed in v7.

Toggle quote (2 lines)
> 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. :(

Toggle quote (4 lines)
> 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.

Toggle quote (4 lines)
> 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: OpenPGP_signature
L
L
Leo Prikler wrote on 1 Feb 2021 23:39
Re: Telegram-CLI (v7)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
515542411e38fa921ef936fe116bd3e0fb2a44d1.camel@student.tugraz.at
Am Montag, den 01.02.2021, 17:08 -0500 schrieb Raghav Gururajan:
Toggle quote (7 lines)
> +(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?

Toggle quote (1 lines)
> (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.)

Toggle quote (3 lines)
> > 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 ;)

Toggle quote (9 lines)
> 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.

Toggle quote (1 lines)
> 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.

Toggle quote (2 lines)
> 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
R
R
Raghav Gururajan wrote on 2 Feb 2021 03:25
Telegram-CLI (v8)
(address . 45954@debbugs.gnu.org)
8bc01610-44a7-875a-20da-1f0693811851@raghavgururajan.name

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(+)

Toggle diff (59 lines)
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
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(+)

Toggle diff (118 lines)
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: OpenPGP_signature
R
R
Raghav Gururajan wrote on 2 Feb 2021 03:33
Re: Telegram-CLI (v7)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
596596fa-35d4-a7db-d890-153f51728780@raghavgururajan.name
Hi Leo!

Toggle quote (3 lines)
> 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.

Toggle quote (5 lines)
> 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.

Toggle quote (3 lines)
>> 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. :-)

Toggle quote (27 lines)
>> 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: OpenPGP_signature
L
L
Leo Prikler wrote on 2 Feb 2021 10:50
Re: Telegram-CLI (v7/v8)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
aacccd6940385c6c31771e118e530beaf76f9012.camel@student.tugraz.at
Hi Raghav,

Am Montag, den 01.02.2021, 21:33 -0500 schrieb Raghav Gururajan:
Toggle quote (6 lines)
> 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?

Toggle quote (9 lines)
> > 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.

Toggle quote (11 lines)
> > > 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.

Toggle quote (3 lines)
> 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
R
R
Raghav Gururajan wrote on 3 Feb 2021 02:56
Telegram-CLI (v9)
(address . 45954@debbugs.gnu.org)
1828c834-eb18-5ee6-deeb-c3b55bbe248a@raghavgururajan.name

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(+)

Toggle diff (64 lines)
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
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(+)

Toggle diff (99 lines)
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
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(+)

Toggle diff (122 lines)
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: OpenPGP_signature
R
R
Raghav Gururajan wrote on 3 Feb 2021 03:41
Re: Telegram-CLI (v7/v8)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
e75a5d6f-c63a-2a37-3534-893a2bff12ea@raghavgururajan.name
Hi Leo!

Toggle quote (2 lines)
> Anything particularly worth noting?

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

Toggle quote (53 lines)
>>> 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: OpenPGP_signature
L
L
Leo Prikler wrote on 3 Feb 2021 09:16
Re: Telegram-CLI (v9)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
4467685fc58b1f3da3305711bc19345819a06d6c.camel@student.tugraz.at
Hello Raghav,

Am Dienstag, den 02.02.2021, 20:56 -0500 schrieb Raghav Gururajan:
Toggle quote (7 lines)
> + (,@%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.
Toggle quote (2 lines)
> + ((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
R
R
Raghav Gururajan wrote on 3 Feb 2021 18:50
Telegram-CLI (v10)
(address . 45954@debbugs.gnu.org)
8a4daaa9-2e86-b0fd-cdc5-164621e54037@raghavgururajan.name

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(+)

Toggle diff (64 lines)
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
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(+)

Toggle diff (99 lines)
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
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(+)

Toggle diff (122 lines)
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: OpenPGP_signature
R
R
Raghav Gururajan wrote on 3 Feb 2021 18:52
Re: Telegram-CLI (v9)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
653d4414-d1df-81ad-759c-f46d3534e8a7@raghavgururajan.name
Hi Leo!

Toggle quote (8 lines)
> 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: OpenPGP_signature
L
L
Leo Prikler wrote on 3 Feb 2021 19:18
Re: Telegram-CLI (v10)
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
a2bf85f882157817f444ba639df86eaf39264fe4.camel@student.tugraz.at
Thanks, pushed!
Closed
?