GNU bug report logs - #52371
[PATCH 0/2] Update tdlib and emacs-telega.

Previous Next

Package: guix-patches;

Reported by: Andrew Tropin <andrew <at> trop.in>

Date: Wed, 8 Dec 2021 09:29:02 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52371 in the body.
You can then email your comments to 52371 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Wed, 08 Dec 2021 09:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrew Tropin <andrew <at> trop.in>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 08 Dec 2021 09:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: guix-patches <at> gnu.org
Cc: zevlg <at> yandex.ru
Subject: [PATCH 0/2] Update tdlib and emacs-telega.
Date: Wed, 08 Dec 2021 12:27:53 +0300
[Message part 1 (text/plain, inline)]
tdlib version 1.7.0 is deprecated and doesn't work anymore, there is no
1.7.9 tag in upstream repo, but the version is present in source code.
https://github.com/tdlib/td/blob/858078d89fcd2ad1d9860547e3f87c49d0f9abe9/CMakeLists.txt#L9

emacs-telega 0.7.031 is inteded for tdlib 1.7.0, but because this tdlib
version doesn't work anymore, Evgeny (author of telega.el) suggest to
use telega version from master branch.  I used 0.7.15 tag (closest tag
to the version in master branch I found) + revision + commit hash.

Without those updates tdlib and all clients based on it doesn't work,
it's quite unfortunate behavior from Telegram developers, IMHO of
course, but it's necessary to update to non-tagged versions to get it
work again.

Andrew Tropin (2):
  gnu: tdlib: Update to 1.7.9-1.858078d.
  gnu: emacs-telega: Update to 0.7.15-1.acf2d99.

 gnu/packages/emacs-xyz.scm                    | 100 +++++++++---------
 gnu/packages/messaging.scm                    |  80 +++++++-------
 .../emacs-telega-path-placeholder.patch       |  49 ++++-----
 .../patches/emacs-telega-test-env.patch       |  30 ++++--
 4 files changed, 134 insertions(+), 125 deletions(-)

-- 
2.34.0

[0001-gnu-tdlib-Update-to-1.7.9-1.858078d.patch (text/x-patch, inline)]
From 9a302410c4cc5ea09e656afdbce50e67127ddd9a Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 7 Dec 2021 14:15:32 +0300
Subject: [PATCH 1/2] gnu: tdlib: Update to 1.7.9-1.858078d.

* gnu/packages/messaging.scm (tdlib): Update to 1.7.9-1.858078d.
---
 gnu/packages/messaging.scm | 80 +++++++++++++++++++-------------------
 1 file changed, 41 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 4856df732e..3151ab0b3f 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -2648,48 +2648,50 @@ (define-public telegram-purple
     (license license:gpl2+)))
 
 (define-public tdlib
-  (package
-    (name "tdlib")
-    (version "1.7.0")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/tdlib/td")
-                    (commit (string-append "v" version))))
-              (sha256
-               (base32
-                "0dfir57ljcn98mkg061c5642qb93wh2lm1n4nngpl3na9vvfk75i"))
-              (file-name (git-file-name name version))))
-    (build-system cmake-build-system)
-    (arguments
-     `(#:tests? #t
-       #:configure-flags
-       (list "-DCMAKE_BUILD_TYPE=Release"
-             "-DTD_ENABLE_LTO=OFF") ; FIXME: Get LTO to work.
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'remove-failing-tests
-           (lambda _
-             (substitute* "test/CMakeLists.txt"
-               ;; The test cases are compiled into a distinct binary
-               ;; which uses mtproto.cpp to attempt to connect to
-               ;; a remote server. Removing this file from the sources
-               ;; list disables those specific test cases.
-               (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/mtproto.cpp") ""))
-             #t)))))
-    (native-inputs
-     `(("gperf" ,gperf)
-       ("openssl" ,openssl)
-       ("zlib" ,zlib)
-       ("php" ,php)
-       ("doxygen" ,doxygen)))
-    (synopsis "Cross-platform library for building Telegram clients")
-    (description "Tdlib is a cross-platform library for creating custom
+  (let ((commit "858078d89fcd2ad1d9860547e3f87c49d0f9abe9")
+        (revision "1"))
+    (package
+      (name "tdlib")
+      (version (git-version "1.7.9" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/tdlib/td")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "1xwb2nb2ijdnz9q2v2mdaf7fsd2xzycxb3wmmf6dv63wl1h3hcwq"))
+                (file-name (git-file-name name version))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #t
+                  #:configure-flags
+                  (list "-DCMAKE_BUILD_TYPE=Release"
+                        "-DTD_ENABLE_LTO=OFF") ; FIXME: Get LTO to work.
+                  #:phases
+                  (modify-phases %standard-phases
+                    (add-after 'unpack 'remove-failing-tests
+                      (lambda _
+                        (substitute* "test/CMakeLists.txt"
+                          ;; The test cases are compiled into a distinct binary
+                          ;; which uses mtproto.cpp to attempt to connect to
+                          ;; a remote server. Removing this file from the sources
+                          ;; list disables those specific test cases.
+                          (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/mtproto.cpp") ""))
+                        #t)))))
+      (native-inputs
+       `(("gperf" ,gperf)
+         ("openssl" ,openssl)
+         ("zlib" ,zlib)
+         ("php" ,php)
+         ("doxygen" ,doxygen)))
+      (synopsis "Cross-platform library for building Telegram clients")
+      (description "Tdlib is a cross-platform library for creating custom
 Telegram clients following the official Telegram API.  It can be easily used
 from almost any programming language with a C-FFI and features first-class
 support for high performance Telegram Bot creation.")
-    (home-page "https://core.telegram.org/tdlib")
-    (license license:boost1.0)))
+      (home-page "https://core.telegram.org/tdlib")
+      (license license:boost1.0))))
 
 (define-public purple-mm-sms
   (package
-- 
2.34.0

[0002-gnu-emacs-telega-Update-to-0.7.15-1.acf2d99.patch (text/x-patch, inline)]
From 1e9d59573f7c6c76fb4f2e524d70a043b185a682 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 7 Dec 2021 16:05:22 +0300
Subject: [PATCH 2/2] gnu: emacs-telega: Update to 0.7.15-1.acf2d99.

* gnu/packages/emacs-xyz.scm (emacs-telega-server): Update to
0.7.15-1.acf2d99.
* gnu/packages/patches/emacs-telega-path-placeholder.patch: Match patch with
newer source code.
* gnu/packages/patches/emacs-telega-test-env.patch: Match patch with newer
source code.
---
 gnu/packages/emacs-xyz.scm                    | 100 +++++++++---------
 .../emacs-telega-path-placeholder.patch       |  49 ++++-----
 .../patches/emacs-telega-test-env.patch       |  30 ++++--
 3 files changed, 93 insertions(+), 86 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index e542da0c26..599790bc6e 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -27144,55 +27144,57 @@ (define-public emacs-helm-switch-to-repl
     (license license:gpl3+)))
 
 (define-public emacs-telega-server
-  (package
-    (name "emacs-telega-server")
-    (version "0.7.031")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/zevlg/telega.el")
-             (commit (string-append "v" version))))
-       (sha256
-        (base32 "05j82796s4k3yr0igl6hir3p8qj0cw66vvhbpbcy28d6q9v9vjjz"))
-       (file-name (git-file-name "emacs-telega" version))
-       (patches
-        (search-patches "emacs-telega-path-placeholder.patch"
-                        "emacs-telega-test-env.patch"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:make-flags
-       (list (string-append "CC=" ,(cc-for-target))
-             (string-append "INSTALL_PREFIX="
-                            (assoc-ref %outputs "out") "/bin"))
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'enter-subdirectory
-           (lambda _ (chdir "server") #t))
-         (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (substitute* "run_tests.py"
-                 (("^(TELEGA_SERVER = ).*$" _all prefix)
-                  (string-append prefix
-                                 "\"" out "/bin/telega-server\"\n"))))))
-         (delete 'check)
-         (add-after 'install 'check
-           (assoc-ref %standard-phases 'check))
-         (add-before 'install-license-files 'leave-subdirectory
-           (lambda _ (chdir "..") #t)))
-       #:test-target "test"))
-    (inputs
-     `(("tdlib" ,tdlib)
-       ("libappindicator" ,libappindicator)))
-    (native-inputs
-     `(("python" ,python)
-       ("pkg-config" ,pkg-config)))
-    (home-page "https://zevlg.github.io/telega.el/")
-    (synopsis "Server process of Telega")
-    (description "Telega-server is helper program to interact with Telegram
+  (let ((commit "acf2d99df25f15c104cd13d5bbdcb17078a353f9")
+        (revision "1"))
+    (package
+      (name "emacs-telega-server")
+      (version (git-version  "0.7.15" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/zevlg/telega.el")
+               (commit commit)))
+         (sha256
+          (base32 "1wxx77whwl5fw2fbq6k7082gqn6srvy8vckhdn0qd75xqm4axf93"))
+         (file-name (git-file-name "emacs-telega" version))
+         (patches
+          (search-patches "emacs-telega-path-placeholder.patch"
+                          "emacs-telega-test-env.patch"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:make-flags
+         (list (string-append "CC=" ,(cc-for-target))
+               (string-append "INSTALL_PREFIX="
+                              (assoc-ref %outputs "out") "/bin"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'configure 'enter-subdirectory
+             (lambda _ (chdir "server") #t))
+           (replace 'configure
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (substitute* "run_tests.py"
+                   (("^(TELEGA_SERVER = ).*$" _all prefix)
+                    (string-append prefix
+                                   "\"" out "/bin/telega-server\"\n"))))))
+           (delete 'check)
+           (add-after 'install 'check
+             (assoc-ref %standard-phases 'check))
+           (add-before 'install-license-files 'leave-subdirectory
+             (lambda _ (chdir "..") #t)))
+         #:test-target "test"))
+      (inputs
+       `(("tdlib" ,tdlib)
+         ("libappindicator" ,libappindicator)))
+      (native-inputs
+       `(("python" ,python)
+         ("pkg-config" ,pkg-config)))
+      (home-page "https://zevlg.github.io/telega.el/")
+      (synopsis "Server process of Telega")
+      (description "Telega-server is helper program to interact with Telegram
 service, and connect it with Emacs via inter-process communication.")
-    (license license:gpl3+)))
+      (license license:gpl3+))))
 
 (define-public emacs-telega
   (package
@@ -27226,7 +27228,7 @@ (define-public emacs-telega
                                  "\"" ffmpeg-bin "\")"))))))
          (add-after 'unpack 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (substitute* "telega-server.el"
+             (substitute* "telega-customize.el"
                (("@TELEGA_SERVER_BIN@")
                 (string-append (assoc-ref inputs "emacs-telega-server")
                                "/bin/telega-server")))
diff --git a/gnu/packages/patches/emacs-telega-path-placeholder.patch b/gnu/packages/patches/emacs-telega-path-placeholder.patch
index c20be36712..5829edd22a 100644
--- a/gnu/packages/patches/emacs-telega-path-placeholder.patch
+++ b/gnu/packages/patches/emacs-telega-path-placeholder.patch
@@ -1,36 +1,31 @@
-From 865b8c553722a971c68742c2e849e41eb0e2360c Mon Sep 17 00:00:00 2001
-From: Zhu Zihao <all_but_last <at> 163.com>
-Date: Thu, 24 Jun 2021 23:43:50 +0800
-Subject: [PATCH] Replace code that search path with placeholder for
- configuration.
+From bf95de21faa623e48bca00d6a2c9b33ab2c5d812 Mon Sep 17 00:00:00 2001
+From: Andrew Tropin <andrew <at> trop.in>
+Date: Wed, 8 Dec 2021 11:01:31 +0300
+Subject: [PATCH] Use absolute path for telega-server-command.
 
 ---
- telega-server.el | 6 +-----
- telega-util.el   | 2 +-
- 2 files changed, 2 insertions(+), 6 deletions(-)
+ telega-customize.el | 2 +-
+ telega-util.el      | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/telega-server.el b/telega-server.el
-index 999125d..0fa0817 100644
---- a/telega-server.el
-+++ b/telega-server.el
-@@ -142,11 +142,7 @@ Otherwise query user about building flags."
- (defun telega-server--find-bin ()
-   "Find telega-server executable.
- Raise error if not found."
--  (let ((exec-path (cons telega-directory exec-path)))
--    (or (executable-find "telega-server")
--        (progn (telega-server-build)
--               (executable-find "telega-server"))
--        (error "`telega-server' not found in exec-path"))))
-+  "@TELEGA_SERVER_BIN@")
+diff --git a/telega-customize.el b/telega-customize.el
+index 0af343f..cc2938c 100644
+--- a/telega-customize.el
++++ b/telega-customize.el
+@@ -591,7 +591,7 @@ In range [1..3].  Use 1."
+   :prefix "telega-server-"
+   :group 'telega)
  
- (defun telega-server-version ()
-   "Return telega-server version."
+-(defcustom telega-server-command "telega-server"
++(defcustom telega-server-command "@TELEGA_SERVER_BIN@"
+   "Command to run as telega server.
+ It should be absolute path or binary file searchable in `exec-path'."
+   :type 'string
 diff --git a/telega-util.el b/telega-util.el
-index 73a46b1..f53e20a 100644
+index 6340c27..01e3cb7 100644
 --- a/telega-util.el
 +++ b/telega-util.el
-@@ -464,7 +464,7 @@ N can't be 0."
+@@ -587,7 +587,7 @@ N can't be 0."
  
  (defun telega-etc-file (filename)
    "Return absolute path to FILENAME from etc/ directory in telega."
@@ -40,5 +35,5 @@ index 73a46b1..f53e20a 100644
  (defun telega-link-props (link-type link-to &optional face)
    "Generate props for link button openable with `telega-link--button-action'."
 -- 
-2.32.0
+2.34.0
 
diff --git a/gnu/packages/patches/emacs-telega-test-env.patch b/gnu/packages/patches/emacs-telega-test-env.patch
index 75fe2e12fc..c6b02be6ff 100644
--- a/gnu/packages/patches/emacs-telega-test-env.patch
+++ b/gnu/packages/patches/emacs-telega-test-env.patch
@@ -1,14 +1,24 @@
-Test Emacs environment on startup.
+From 237ea2471bb6521390bbac174ac2a8a5e9683e4d Mon Sep 17 00:00:00 2001
+From: Andrew Tropin <andrew <at> trop.in>
+Date: Tue, 7 Dec 2021 16:20:38 +0300
+Subject: [PATCH] Test Emacs environment on startup.
 
-Patch by Diego N. Barbato
+---
+ telega.el | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
---- a/telega.el	2020-02-07 17:07:18.549970090 +0100
-+++ b/telega.el	2020-02-07 17:10:08.383499765 +0100
-@@ -82,6 +82,7 @@
-   "Start telegramming.
- If prefix ARG is given, then will not pop to telega root buffer."
+diff --git a/telega.el b/telega.el
+index d6b28b5..40854ec 100644
+--- a/telega.el
++++ b/telega.el
+@@ -181,7 +181,7 @@ can't write to `telega-server-logfile'" logfile-dir)))
+ Pop to root buffer.
+ If `\\[universal-argument]' is specified, then do not pop to root buffer."
    (interactive "P")
+-
 +  (telega-test-env t)
-   (telega--create-hier)
- 
-   (unless (telega-server-live-p)
+   ;; For multiple accounts setup possibly select (if there is no
+   ;; default account declared) an account to use
+   (if (and telega-accounts (not (telega-account-current)))
+-- 
+2.34.0
-- 
2.34.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Thu, 09 Dec 2021 08:28:01 GMT) Full text and rfc822 format available.

Message #8 received at 52371 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Andrew Tropin <andrew <at> trop.in>
Cc: zevlg <at> yandex.ru, 52371 <at> debbugs.gnu.org
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Thu, 09 Dec 2021 09:27:13 +0100
Hello,

Andrew Tropin <andrew <at> trop.in> writes:

> tdlib version 1.7.0 is deprecated and doesn't work anymore, there is no
> 1.7.9 tag in upstream repo, but the version is present in source code.
> https://github.com/tdlib/td/blob/858078d89fcd2ad1d9860547e3f87c49d0f9abe9/CMakeLists.txt#L9
>
> emacs-telega 0.7.031 is inteded for tdlib 1.7.0, but because this tdlib
> version doesn't work anymore, Evgeny (author of telega.el) suggest to
> use telega version from master branch.  I used 0.7.15 tag (closest tag
> to the version in master branch I found) + revision + commit hash.
>
> Without those updates tdlib and all clients based on it doesn't work,
> it's quite unfortunate behavior from Telegram developers, IMHO of
> course, but it's necessary to update to non-tagged versions to get it
> work again.

Thank you.

Could you use commit a53cb30e99f937cfd64e0266fa558785a184a553 for tdlib.
It corresponds to release 0.7.10 so you don't have to use revision and
commit binding.

Also, could you send this in two separate patches, and provide a proper
commit message, specifying new patch files and registering them in
local.mk?

Also, you can remove trailing #t from phases.

Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Thu, 09 Dec 2021 10:24:03 GMT) Full text and rfc822 format available.

Message #11 received at 52371 <at> debbugs.gnu.org (full text, mbox):

From: Evgeny Zajcev <zevlg <at> yandex.ru>
To: mail <at> nicolasgoaziou.fr
Cc: 52371 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Thu, 9 Dec 2021 11:43:53 +0300
[Message part 1 (text/plain, inline)]
чт, 9 дек. 2021 г. в 11:27, Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:

> Hello,
>
> Andrew Tropin <andrew <at> trop.in> writes:
>
> > tdlib version 1.7.0 is deprecated and doesn't work anymore, there is no
> > 1.7.9 tag in upstream repo, but the version is present in source code.
> >
> https://github.com/tdlib/td/blob/858078d89fcd2ad1d9860547e3f87c49d0f9abe9/CMakeLists.txt#L9
> >
> > emacs-telega 0.7.031 is inteded for tdlib 1.7.0, but because this tdlib
> > version doesn't work anymore, Evgeny (author of telega.el) suggest to
> > use telega version from master branch.  I used 0.7.15 tag (closest tag
> > to the version in master branch I found) + revision + commit hash.
> >
> > Without those updates tdlib and all clients based on it doesn't work,
> > it's quite unfortunate behavior from Telegram developers, IMHO of
> > course, but it's necessary to update to non-tagged versions to get it
> > work again.
>
> Thank you.
>
> Could you use commit a53cb30e99f937cfd64e0266fa558785a184a553 for tdlib.
> It corresponds to release 0.7.10 so you don't have to use revision and
> commit binding.
>

If TDLib 1.7.10 will be used, then use 3dfa0f0 for telega.el, this commit
adds initial support for TDLib 1.7.10

TDLib 1.7.10 is not compatible with TDLib 1.7.9, and it won't work with
telega without TDLib 1.7.10 support.

-- 
lg
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Thu, 09 Dec 2021 11:44:01 GMT) Full text and rfc822 format available.

Message #14 received at 52371 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: zevlg <at> yandex.ru, 52371 <at> debbugs.gnu.org
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Thu, 09 Dec 2021 14:43:39 +0300
[Message part 1 (text/plain, inline)]
On 2021-12-09 09:27, Nicolas Goaziou wrote:

> Hello,
>
> Andrew Tropin <andrew <at> trop.in> writes:
>
>> tdlib version 1.7.0 is deprecated and doesn't work anymore, there is no
>> 1.7.9 tag in upstream repo, but the version is present in source code.
>> https://github.com/tdlib/td/blob/858078d89fcd2ad1d9860547e3f87c49d0f9abe9/CMakeLists.txt#L9
>>
>> emacs-telega 0.7.031 is inteded for tdlib 1.7.0, but because this tdlib
>> version doesn't work anymore, Evgeny (author of telega.el) suggest to
>> use telega version from master branch.  I used 0.7.15 tag (closest tag
>> to the version in master branch I found) + revision + commit hash.
>>
>> Without those updates tdlib and all clients based on it doesn't work,
>> it's quite unfortunate behavior from Telegram developers, IMHO of
>> course, but it's necessary to update to non-tagged versions to get it
>> work again.
>
> Thank you.
>
> Could you use commit a53cb30e99f937cfd64e0266fa558785a184a553 for tdlib.
> It corresponds to release 1.7.10 so you don't have to use revision and
> commit binding.

Will do.

>
> Also, could you send this in two separate patches, and provide a proper
> commit message, specifying new patch files and registering them in
> local.mk?

Not sure what you mean, there are already two inline patches with proper
commit messages (at least I hope it's proper :).

The patches for telegram.el are not new, so they already registered in
local.mk, I just updated the content to match current source code.

>
> Also, you can remove trailing #t from phases.
>
> Could you send an updated patch?
>
> Regards,

Yep.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Thu, 09 Dec 2021 15:38:01 GMT) Full text and rfc822 format available.

Message #17 received at 52371 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: zevlg <at> yandex.ru, 52371 <at> debbugs.gnu.org
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Thu, 09 Dec 2021 18:34:50 +0300
[Message part 1 (text/plain, inline)]
On 2021-12-09 09:27, Nicolas Goaziou wrote:

> Hello,
>
> Andrew Tropin <andrew <at> trop.in> writes:
>
>> tdlib version 1.7.0 is deprecated and doesn't work anymore, there is no
>> 1.7.9 tag in upstream repo, but the version is present in source code.
>> https://github.com/tdlib/td/blob/858078d89fcd2ad1d9860547e3f87c49d0f9abe9/CMakeLists.txt#L9
>>
>> emacs-telega 0.7.031 is inteded for tdlib 1.7.0, but because this tdlib
>> version doesn't work anymore, Evgeny (author of telega.el) suggest to
>> use telega version from master branch.  I used 0.7.15 tag (closest tag
>> to the version in master branch I found) + revision + commit hash.
>>
>> Without those updates tdlib and all clients based on it doesn't work,
>> it's quite unfortunate behavior from Telegram developers, IMHO of
>> course, but it's necessary to update to non-tagged versions to get it
>> work again.
>
> Thank you.
>
> Could you use commit a53cb30e99f937cfd64e0266fa558785a184a553 for tdlib.
> It corresponds to release 0.7.10 so you don't have to use revision and
> commit binding.

Updated tdlib and telega.

>
> Also, could you send this in two separate patches, and provide a proper
> commit message, specifying new patch files and registering them in
> local.mk?
>
> Also, you can remove trailing #t from phases.

Removed.

>
> Could you send an updated patch?
>
> Regards,

Attaching two patches.

[0001-gnu-tdlib-Update-to-1.7.10.patch (text/x-patch, inline)]
From 2fdb921a278558bab3076805951d8131c7a2e780 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 7 Dec 2021 14:15:32 +0300
Subject: [PATCH 1/2] gnu: tdlib: Update to 1.7.10.

* gnu/packages/messaging.scm (tdlib): Update to 1.7.10.
---
 gnu/packages/messaging.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 4856df732e..9f90dc94d0 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -2650,15 +2650,15 @@ (define-public telegram-purple
 (define-public tdlib
   (package
     (name "tdlib")
-    (version "1.7.0")
+    (version "1.7.10")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/tdlib/td")
-                    (commit (string-append "v" version))))
+                    (commit "34ba9b21f365b8d3bdc36808c2d665ca5cd128f6")))
               (sha256
                (base32
-                "0dfir57ljcn98mkg061c5642qb93wh2lm1n4nngpl3na9vvfk75i"))
+                "06fbdh1jypz0p1rf6xbpias4kx7xplq9xjd9vz177vwj9icq3wki"))
               (file-name (git-file-name name version))))
     (build-system cmake-build-system)
     (arguments
-- 
2.34.0

[0002-gnu-emacs-telega-Update-to-0.7.15-1.b4a5e20.patch (text/x-patch, inline)]
From 83d78a5f70351eeef7b7deb1edb96ed5cf2458cc Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew <at> trop.in>
Date: Tue, 7 Dec 2021 16:05:22 +0300
Subject: [PATCH 2/2] gnu: emacs-telega: Update to 0.7.15-1.b4a5e20.

* gnu/packages/emacs-xyz.scm (emacs-telega-server): Update to
0.7.15-1.b4a5e20.
* gnu/packages/patches/emacs-telega-path-placeholder.patch: Match patch with
newer source code.
* gnu/packages/patches/emacs-telega-test-env.patch: Match patch with newer
source code.
---
 gnu/packages/emacs-xyz.scm                    | 100 +++++++++---------
 .../emacs-telega-path-placeholder.patch       |  49 ++++-----
 .../patches/emacs-telega-test-env.patch       |  30 ++++--
 3 files changed, 93 insertions(+), 86 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index e542da0c26..52537b754e 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -27144,55 +27144,57 @@ (define-public emacs-helm-switch-to-repl
     (license license:gpl3+)))
 
 (define-public emacs-telega-server
-  (package
-    (name "emacs-telega-server")
-    (version "0.7.031")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/zevlg/telega.el")
-             (commit (string-append "v" version))))
-       (sha256
-        (base32 "05j82796s4k3yr0igl6hir3p8qj0cw66vvhbpbcy28d6q9v9vjjz"))
-       (file-name (git-file-name "emacs-telega" version))
-       (patches
-        (search-patches "emacs-telega-path-placeholder.patch"
-                        "emacs-telega-test-env.patch"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:make-flags
-       (list (string-append "CC=" ,(cc-for-target))
-             (string-append "INSTALL_PREFIX="
-                            (assoc-ref %outputs "out") "/bin"))
-       #:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'enter-subdirectory
-           (lambda _ (chdir "server") #t))
-         (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (substitute* "run_tests.py"
-                 (("^(TELEGA_SERVER = ).*$" _all prefix)
-                  (string-append prefix
-                                 "\"" out "/bin/telega-server\"\n"))))))
-         (delete 'check)
-         (add-after 'install 'check
-           (assoc-ref %standard-phases 'check))
-         (add-before 'install-license-files 'leave-subdirectory
-           (lambda _ (chdir "..") #t)))
-       #:test-target "test"))
-    (inputs
-     `(("tdlib" ,tdlib)
-       ("libappindicator" ,libappindicator)))
-    (native-inputs
-     `(("python" ,python)
-       ("pkg-config" ,pkg-config)))
-    (home-page "https://zevlg.github.io/telega.el/")
-    (synopsis "Server process of Telega")
-    (description "Telega-server is helper program to interact with Telegram
+  (let ((commit "b4a5e206bd259f3d7f7633a725b2990704d6a1e8")
+        (revision "1"))
+    (package
+      (name "emacs-telega-server")
+      (version (git-version  "0.7.15" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/zevlg/telega.el")
+               (commit commit)))
+         (sha256
+          (base32 "0gr4nmpk175hxmj357bpzaqywbjc6dmmvfxnyzkh884vyzbwdxlc"))
+         (file-name (git-file-name "emacs-telega" version))
+         (patches
+          (search-patches "emacs-telega-path-placeholder.patch"
+                          "emacs-telega-test-env.patch"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:make-flags
+         (list (string-append "CC=" ,(cc-for-target))
+               (string-append "INSTALL_PREFIX="
+                              (assoc-ref %outputs "out") "/bin"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'configure 'enter-subdirectory
+             (lambda _ (chdir "server")))
+           (replace 'configure
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (substitute* "run_tests.py"
+                   (("^(TELEGA_SERVER = ).*$" _all prefix)
+                    (string-append prefix
+                                   "\"" out "/bin/telega-server\"\n"))))))
+           (delete 'check)
+           (add-after 'install 'check
+             (assoc-ref %standard-phases 'check))
+           (add-before 'install-license-files 'leave-subdirectory
+             (lambda _ (chdir ".."))))
+         #:test-target "test"))
+      (inputs
+       `(("tdlib" ,tdlib)
+         ("libappindicator" ,libappindicator)))
+      (native-inputs
+       `(("python" ,python)
+         ("pkg-config" ,pkg-config)))
+      (home-page "https://zevlg.github.io/telega.el/")
+      (synopsis "Server process of Telega")
+      (description "Telega-server is helper program to interact with Telegram
 service, and connect it with Emacs via inter-process communication.")
-    (license license:gpl3+)))
+      (license license:gpl3+))))
 
 (define-public emacs-telega
   (package
@@ -27226,7 +27228,7 @@ (define-public emacs-telega
                                  "\"" ffmpeg-bin "\")"))))))
          (add-after 'unpack 'configure
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (substitute* "telega-server.el"
+             (substitute* "telega-customize.el"
                (("@TELEGA_SERVER_BIN@")
                 (string-append (assoc-ref inputs "emacs-telega-server")
                                "/bin/telega-server")))
diff --git a/gnu/packages/patches/emacs-telega-path-placeholder.patch b/gnu/packages/patches/emacs-telega-path-placeholder.patch
index c20be36712..5829edd22a 100644
--- a/gnu/packages/patches/emacs-telega-path-placeholder.patch
+++ b/gnu/packages/patches/emacs-telega-path-placeholder.patch
@@ -1,36 +1,31 @@
-From 865b8c553722a971c68742c2e849e41eb0e2360c Mon Sep 17 00:00:00 2001
-From: Zhu Zihao <all_but_last <at> 163.com>
-Date: Thu, 24 Jun 2021 23:43:50 +0800
-Subject: [PATCH] Replace code that search path with placeholder for
- configuration.
+From bf95de21faa623e48bca00d6a2c9b33ab2c5d812 Mon Sep 17 00:00:00 2001
+From: Andrew Tropin <andrew <at> trop.in>
+Date: Wed, 8 Dec 2021 11:01:31 +0300
+Subject: [PATCH] Use absolute path for telega-server-command.
 
 ---
- telega-server.el | 6 +-----
- telega-util.el   | 2 +-
- 2 files changed, 2 insertions(+), 6 deletions(-)
+ telega-customize.el | 2 +-
+ telega-util.el      | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/telega-server.el b/telega-server.el
-index 999125d..0fa0817 100644
---- a/telega-server.el
-+++ b/telega-server.el
-@@ -142,11 +142,7 @@ Otherwise query user about building flags."
- (defun telega-server--find-bin ()
-   "Find telega-server executable.
- Raise error if not found."
--  (let ((exec-path (cons telega-directory exec-path)))
--    (or (executable-find "telega-server")
--        (progn (telega-server-build)
--               (executable-find "telega-server"))
--        (error "`telega-server' not found in exec-path"))))
-+  "@TELEGA_SERVER_BIN@")
+diff --git a/telega-customize.el b/telega-customize.el
+index 0af343f..cc2938c 100644
+--- a/telega-customize.el
++++ b/telega-customize.el
+@@ -591,7 +591,7 @@ In range [1..3].  Use 1."
+   :prefix "telega-server-"
+   :group 'telega)
  
- (defun telega-server-version ()
-   "Return telega-server version."
+-(defcustom telega-server-command "telega-server"
++(defcustom telega-server-command "@TELEGA_SERVER_BIN@"
+   "Command to run as telega server.
+ It should be absolute path or binary file searchable in `exec-path'."
+   :type 'string
 diff --git a/telega-util.el b/telega-util.el
-index 73a46b1..f53e20a 100644
+index 6340c27..01e3cb7 100644
 --- a/telega-util.el
 +++ b/telega-util.el
-@@ -464,7 +464,7 @@ N can't be 0."
+@@ -587,7 +587,7 @@ N can't be 0."
  
  (defun telega-etc-file (filename)
    "Return absolute path to FILENAME from etc/ directory in telega."
@@ -40,5 +35,5 @@ index 73a46b1..f53e20a 100644
  (defun telega-link-props (link-type link-to &optional face)
    "Generate props for link button openable with `telega-link--button-action'."
 -- 
-2.32.0
+2.34.0
 
diff --git a/gnu/packages/patches/emacs-telega-test-env.patch b/gnu/packages/patches/emacs-telega-test-env.patch
index 75fe2e12fc..c6b02be6ff 100644
--- a/gnu/packages/patches/emacs-telega-test-env.patch
+++ b/gnu/packages/patches/emacs-telega-test-env.patch
@@ -1,14 +1,24 @@
-Test Emacs environment on startup.
+From 237ea2471bb6521390bbac174ac2a8a5e9683e4d Mon Sep 17 00:00:00 2001
+From: Andrew Tropin <andrew <at> trop.in>
+Date: Tue, 7 Dec 2021 16:20:38 +0300
+Subject: [PATCH] Test Emacs environment on startup.
 
-Patch by Diego N. Barbato
+---
+ telega.el | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
---- a/telega.el	2020-02-07 17:07:18.549970090 +0100
-+++ b/telega.el	2020-02-07 17:10:08.383499765 +0100
-@@ -82,6 +82,7 @@
-   "Start telegramming.
- If prefix ARG is given, then will not pop to telega root buffer."
+diff --git a/telega.el b/telega.el
+index d6b28b5..40854ec 100644
+--- a/telega.el
++++ b/telega.el
+@@ -181,7 +181,7 @@ can't write to `telega-server-logfile'" logfile-dir)))
+ Pop to root buffer.
+ If `\\[universal-argument]' is specified, then do not pop to root buffer."
    (interactive "P")
+-
 +  (telega-test-env t)
-   (telega--create-hier)
- 
-   (unless (telega-server-live-p)
+   ;; For multiple accounts setup possibly select (if there is no
+   ;; default account declared) an account to use
+   (if (and telega-accounts (not (telega-account-current)))
+-- 
+2.34.0
-- 
2.34.0

[Message part 4 (text/plain, inline)]

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Thu, 09 Dec 2021 19:40:02 GMT) Full text and rfc822 format available.

Message #20 received at 52371 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Andrew Tropin <andrew <at> trop.in>, Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: zevlg <at> yandex.ru, 52371 <at> debbugs.gnu.org
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Thu, 09 Dec 2021 20:39:36 +0100
Hi,

note to self: I'm not trying to build tdlib again.  Last build was not
finished after almost a day and power went out so I don't even know
whether it succeeded after I went to work or not.

Anyway,

> +-(defcustom telega-server-command "telega-server"
> ++(defcustom telega-server-command "@TELEGA_SERVER_BIN@"
[...]
> -             (substitute* "telega-server.el"
> +             (substitute* "telega-customize.el"
>                 (("@TELEGA_SERVER_BIN@")
>                  (string-append (assoc-ref inputs "emacs-telega-
> server")
>                                 "/bin/telega-server")))
> 
I know this has existed before your patch, but I'm pretty sure we have
emacs-based routines that could make this substitution in one go.  If
you're interested in further janitor work, you could do this either on
master, or you could do something in terms of (search-input-file) on c-
u-f.

Other than that LGTM on a quick glance.
Cheers





Information forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Fri, 10 Dec 2021 07:41:02 GMT) Full text and rfc822 format available.

Message #23 received at 52371 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, Nicolas Goaziou
 <mail <at> nicolasgoaziou.fr>
Cc: zevlg <at> yandex.ru, 52371 <at> debbugs.gnu.org
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Fri, 10 Dec 2021 10:40:24 +0300
[Message part 1 (text/plain, inline)]
On 2021-12-09 20:39, Liliana Marie Prikler wrote:

> Hi,
>
> note to self: I'm not trying to build tdlib again.  Last build was not
> finished after almost a day and power went out so I don't even know
> whether it succeeded after I went to work or not.

Ouch, IIRC it took a few dozens of minutes for my laptop.  Do you use
underpowered hardware or something was wrong with compilation process?

>
> Anyway,
>
>> +-(defcustom telega-server-command "telega-server"
>> ++(defcustom telega-server-command "@TELEGA_SERVER_BIN@"
> [...]
>> -             (substitute* "telega-server.el"
>> +             (substitute* "telega-customize.el"
>>                 (("@TELEGA_SERVER_BIN@")
>>                  (string-append (assoc-ref inputs "emacs-telega-
>> server")
>>                                 "/bin/telega-server")))
>> 
> I know this has existed before your patch, but I'm pretty sure we have
> emacs-based routines that could make this substitution in one go.

Do you mean emacs-substitute-sexps from (guix build emacs-utils) ?

> If you're interested in further janitor work, you could do this either
> on master, or you could do something in terms of (search-input-file)
> on c- u-f.
>
> Other than that LGTM on a quick glance.
> Cheers
>

Let's keep it as it is right now, probably I'll be updating this package
later again and will refactor it.

Also, I'll need to update emacs-telega package to include add-pkg-file
phase if the patch will be merged, so I'll cleanup the other stuff
around it.

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#52371; Package guix-patches. (Fri, 10 Dec 2021 19:32:02 GMT) Full text and rfc822 format available.

Message #26 received at 52371 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Andrew Tropin <andrew <at> trop.in>, Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: zevlg <at> yandex.ru, 52371 <at> debbugs.gnu.org
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Fri, 10 Dec 2021 20:31:25 +0100
Am Freitag, den 10.12.2021, 10:40 +0300 schrieb Andrew Tropin:
> On 2021-12-09 20:39, Liliana Marie Prikler wrote:
> 
> > Hi,
> > 
> > note to self: I'm not trying to build tdlib again.  Last build was
> > not finished after almost a day and power went out so I don't even
> > know whether it succeeded after I went to work or not.
> 
> Ouch, IIRC it took a few dozens of minutes for my laptop.  Do you use
> underpowered hardware or something was wrong with compilation
> process?
It's the check phase that's killing me, but that doesn't really rule
out weak hardware.  I'm not touching staging or core-updates for that
very reason.

> > Anyway,
> > 
> > > +-(defcustom telega-server-command "telega-server"
> > > ++(defcustom telega-server-command "@TELEGA_SERVER_BIN@"
> > [...]
> > > -             (substitute* "telega-server.el"
> > > +             (substitute* "telega-customize.el"
> > >                 (("@TELEGA_SERVER_BIN@")
> > >                  (string-append (assoc-ref inputs "emacs-telega-
> > > server")
> > >                                 "/bin/telega-server")))
> > > 
> > I know this has existed before your patch, but I'm pretty sure we
> > have
> > emacs-based routines that could make this substitution in one go.
> 
> Do you mean emacs-substitute-sexps from (guix build emacs-utils) ?
I think emacs-substitute-variables is the "correcter" option here, but
both are fine.

> > If you're interested in further janitor work, you could do this
> > either on master, or you could do something in terms of (search-
> > input-file) on c-u-f.
> > 
> > Other than that LGTM on a quick glance.
> > Cheers
> > 
> 
> Let's keep it as it is right now, probably I'll be updating this
> package later again and will refactor it.
> 
> Also, I'll need to update emacs-telega package to include add-pkg-
> file phase if the patch will be merged, so I'll cleanup the other
> stuff around it.
Very well, you do you.  I'll leave the final call to Nicolas then.

Thanks for your work and happy hacking :)





Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Sat, 11 Dec 2021 15:14:01 GMT) Full text and rfc822 format available.

Notification sent to Andrew Tropin <andrew <at> trop.in>:
bug acknowledged by developer. (Sat, 11 Dec 2021 15:14:01 GMT) Full text and rfc822 format available.

Message #31 received at 52371-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 52371-done <at> debbugs.gnu.org, zevlg <at> yandex.ru,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#52371] [PATCH 0/2] Update tdlib and emacs-telega.
Date: Sat, 11 Dec 2021 16:13:07 +0100
Hello,

Andrew Tropin <andrew <at> trop.in> writes:

> Let's keep it as it is right now, probably I'll be updating this package
> later again and will refactor it.
>
> Also, I'll need to update emacs-telega package to include add-pkg-file
> phase if the patch will be merged, so I'll cleanup the other stuff
> around it.

OK. Applied. Thank you.

Regards,
-- 
Nicolas Goaziou




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 09 Jan 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.