Subject: Re: [PATCH 0/4] Update tdlib and telega packages

From: Andrew Tropin <[email-masked]>
Date: Thu, 27 Jan 2022 10:54:14 +0300

CCed: avityazev, zevlg

On 2022-01-22 16:14, Liliana Marie Prikler wrote:

> Hi Andrew, 
>
> Am Donnerstag, dem 20.01.2022 um 14:45 +0300 schrieb Andrew Tropin:
>> tdlib and telega are inteded to be used from specific commits not
>> tags, I keep revision and commit parameters for those packages to
>> make it easier to update them to untagged commits in the future.
>> 
>> https://github.com/tdlib/td/issues/1790
>> 
>> Also, updated the style for arguments.
> It appears Telega was already updated through a different patch.  The
> style adjustments are still relevant, but fail to apply currently.
>

Updated patches.

> 
> As for commit vs. tag, I've CC'd Nicolas to make a more informed
> decision.  I do understand your reasoning, but OTOH I disagree with
> Telegram's "every commit is as good as a release" stance, particularly
> if there's a widely used client whose releases fail in CI :)

I agree, tdlib rolling release seems a little strange to me and I
personally not in a favor of it.  I still propose to keep commit and
revision variables for both tdlib and telega to be able to update them
from time to time to a fresh version, which surely won't have a release
tag.

From 78e24c360cbd9c9cd791f56aeb290fffbc29ebae Mon Sep 17 00:00:00 2001
From: Andrew Tropin <[email-masked]>
Date: Thu, 20 Jan 2022 14:09:14 +0300
Subject: [PATCH 1/2] gnu: telega: Use new package style.

* gnu/packages/emacs-xyz.scm (emacs-telega, emacs-telega-contrib): Use gexps,
remove trailing #t.
---
 gnu/packages/emacs-xyz.scm | 82 +++++++++++++++++++-------------------
 1 file changed, 42 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 387f1b93fd..d456a6cd52 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -27030,39 +27030,40 @@ (define-public emacs-telega
     (name "emacs-telega")
     (build-system emacs-build-system)
     (arguments
-     `(#:emacs ,(if (target-64bit?)
-                    emacs-minimal
-                    ;; Require wide-int support for 32-bit platform.
-                    emacs-wide-int)
-       #:include (cons "^etc\\/" %default-include)
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'patch-sources
-           (lambda* (#:key inputs #:allow-other-keys)
-             ;; Hard-code paths to `ffplay` and `ffmpeg`.
-             (let* ((ffplay-bin (search-input-file inputs "/bin/ffplay"))
-                    (ffmpeg-bin (search-input-file inputs "/bin/ffmpeg")))
-               (substitute* '("telega-ffplay.el" "telega-vvnote.el")
-                 (("(shell-command-to-string\|concat) \"(ffmpeg\|ffprobe)"
-                   all func cmd)
-                  (string-append func " \""
-                                 (search-input-file
-                                  inputs (string-append "/bin/" cmd))))
-                 (("\\(executable-find \"ffplay\"\\)")
-                  (string-append "(and (file-executable-p \"" ffplay-bin "\")"
-                                 "\"" ffplay-bin "\")"))
-                 (("\\(executable-find \"ffmpeg\"\\)")
-                  (string-append "(and (file-executable-p \"" ffmpeg-bin "\")"
-                                 "\"" ffmpeg-bin "\")"))))))
-         (add-after 'unpack 'configure
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (substitute* "telega-customize.el"
-               (("@TELEGA_SERVER_BIN@")
-                (search-input-file inputs "/bin/telega-server")))
-             (substitute* "telega-util.el"
-               (("@TELEGA_SHARE@")
-                (string-append (elpa-directory (assoc-ref outputs "out"))
-                               "/etc"))))))))
+     (list
+      #:emacs (if (target-64bit?)
+                  emacs-minimal
+                  ;; Require wide-int support for 32-bit platform.
+                  emacs-wide-int)
+      #:include #~(cons "^etc\\/" %default-include)
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-sources
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; Hard-code paths to `ffplay` and `ffmpeg`.
+              (let* ((ffplay-bin (search-input-file inputs "/bin/ffplay"))
+                     (ffmpeg-bin (search-input-file inputs "/bin/ffmpeg")))
+                (substitute* '("telega-ffplay.el" "telega-vvnote.el")
+                  (("(shell-command-to-string\|concat) \"(ffmpeg\|ffprobe)"
+                    all func cmd)
+                   (string-append func " \""
+                                  (search-input-file
+                                   inputs (string-append "/bin/" cmd))))
+                  (("\\(executable-find \"ffplay\"\\)")
+                   (string-append "(and (file-executable-p \"" ffplay-bin "\")"
+                                  "\"" ffplay-bin "\")"))
+                  (("\\(executable-find \"ffmpeg\"\\)")
+                   (string-append "(and (file-executable-p \"" ffmpeg-bin "\")"
+                                  "\"" ffmpeg-bin "\")"))))))
+          (add-after 'unpack 'configure
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (substitute* "telega-customize.el"
+                (("@TELEGA_SERVER_BIN@")
+                 (search-input-file inputs "/bin/telega-server")))
+              (substitute* "telega-util.el"
+                (("@TELEGA_SHARE@")
+                 (string-append (elpa-directory (assoc-ref outputs "out"))
+                                "/etc"))))))))
     (inputs
      (list emacs-telega-server ffmpeg))
     (native-inputs '())
@@ -27078,13 +27079,14 @@ (define-public emacs-telega-contrib
     (inherit emacs-telega)
     (name "emacs-telega-contrib")
     (arguments
-     `(#:exclude '("telega-live-location.el")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'enter-subdirectory
-           (lambda _ (chdir "contrib") #t))
-         (add-before 'install-license-files 'leave-subdirectory
-           (lambda _ (chdir "..") #t)))))
+     (list
+      #:exclude '("telega-live-location.el")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'enter-subdirectory
+            (lambda _ (chdir "contrib")))
+          (add-before 'install-license-files 'leave-subdirectory
+            (lambda _ (chdir ".."))))))
     (inputs '())
     (native-inputs '())
     (propagated-inputs
-- 
2.34.0

From 90a77ee77aa4f339c9cee978e96ee72e1316bcd9 Mon Sep 17 00:00:00 2001
From: Andrew Tropin <[email-masked]>
Date: Thu, 20 Jan 2022 13:27:15 +0300
Subject: [PATCH 2/2] gnu: tdlib: Use new package style.

* gnu/packages/messaging.scm (tdlib): Use gexps, remove trailing #t.
---
 gnu/packages/messaging.scm | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 768642f119..01316f8bd2 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -2612,20 +2612,21 @@ (define-public tdlib
        (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") "")))))))
+     (list
+      #: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") "")))))))
     (native-inputs
      (list gperf openssl zlib php doxygen))
     (synopsis "Cross-platform library for building Telegram clients")
-- 
2.34.0

-- 
Best regards,
Andrew Tropin