Subject: [PATCH 2/3] gnu: emacs-telega: Separate server and lisp packages.

From: Sergey Trofimov <[email-masked]>
Date: Mon, 1 Jul 2024 22:53:14 +0200

* gnu/packages/emacs-xyz.scm (emacs-telega-server): Use own version.
(emacs-telega): Remove inheritance.
---
 gnu/packages/emacs-xyz.scm | 123 ++++++++++++++++++++-----------------
 1 file changed, 68 insertions(+), 55 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index ab6a4cf4ab..57f1cfece4 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -35388,11 +35388,11 @@ (define-public emacs-helm-switch-to-repl
     (license license:gpl3+)))
 
 (define-public emacs-telega-server
-  (let ((commit "009e5ce9d393aa049bb3b1182306db4b5b85833b")
+  (let ((commit "879a8c7afc8967942613b6b898d9ea8c1f3641bf")
         (revision "0"))
     (package
       (name "emacs-telega-server")
-      (version (git-version "0.8.290" revision commit))
+      (version (git-version "0.8.2" revision commit))
       (source
        (origin
          (method git-fetch)
@@ -35400,11 +35400,8 @@ (define-public emacs-telega-server
                (url "https://github.com/zevlg/telega.el")
                (commit commit)))
          (sha256
-          (base32 "06k2qkxzq3l3cdqr70zrxrnm3q6qp9nw3zgm3p65nmx86ky1q72f"))
-         (file-name (git-file-name "emacs-telega" version))
-         (patches
-          (search-patches "emacs-telega-path-placeholder.patch"
-                          "emacs-telega-test-env.patch"))))
+          (base32 "1ic14hzzgjxpky1r3mz4v72si9hw8cw72420a9lnpdaiw99l8q7h"))
+         (file-name (git-file-name "emacs-telega" version))))
       (build-system gnu-build-system)
       (arguments
        (list
@@ -35438,54 +35435,70 @@ (define-public emacs-telega-server
       (license license:gpl3+))))
 
 (define-public emacs-telega
-  (package
-    (inherit emacs-telega-server)
-    (name "emacs-telega")
-    (build-system emacs-build-system)
-    (arguments
-     (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-core.el"
-                (("@TELEGA_SHARE@")
-                 (string-append (elpa-directory (assoc-ref outputs "out"))
-                                "/etc"))))))))
-    (inputs
-     (list emacs-telega-server ffmpeg))
-    (native-inputs '())
-    (propagated-inputs
-     (list emacs-visual-fill-column emacs-company
-           emacs-rainbow-identifiers))
-    (synopsis "GNU Emacs client for the Telegram messenger")
-    (description "Telega is a full-featured, unofficial GNU Emacs-based client
-for the Telegram messaging platform.")))
+  (let ((commit "009e5ce9d393aa049bb3b1182306db4b5b85833b")
+        (revision "1"))
+    (package
+      (name "emacs-telega")
+      (version (git-version "0.8.290" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/zevlg/telega.el")
+               (commit commit)))
+         (sha256
+          (base32 "06k2qkxzq3l3cdqr70zrxrnm3q6qp9nw3zgm3p65nmx86ky1q72f"))
+         (file-name (git-file-name "emacs-telega" version))
+         (patches
+          (search-patches "emacs-telega-path-placeholder.patch"
+                          "emacs-telega-test-env.patch"))))
+      (build-system emacs-build-system)
+      (arguments
+       (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-core.el"
+                  (("@TELEGA_SHARE@")
+                   (string-append (elpa-directory (assoc-ref outputs "out"))
+                                  "/etc"))))))))
+      (inputs
+       (list emacs-telega-server ffmpeg))
+      (native-inputs '())
+      (propagated-inputs
+       (list emacs-visual-fill-column emacs-company
+             emacs-rainbow-identifiers))
+      (home-page "https://zevlg.github.io/telega.el/")
+      (synopsis "GNU Emacs client for the Telegram messenger")
+      (description "Telega is a full-featured, unofficial GNU Emacs-based client
+for the Telegram messaging platform.")
+      (license license:gpl3+))))
 
 (define-public emacs-telega-contrib
   (package
-- 
2.45.2