summary refs log tree commit diff
diff options
context:
space:
mode:
authorRaghav Gururajan <rg@raghavgururajan.name>2021-02-01 16:42:24 -0500
committerLeo Prikler <leo.prikler@student.tugraz.at>2021-02-03 18:55:02 +0100
commitd1e7a01cea4eae3f3a62a1e109e4ed4a55dcd559 (patch)
tree0d8b08fff4f245b0155bcf8b073756fdcd51d376
parent8b4e89336862525fe9296d2554b234165e54f59f (diff)
downloadguix-d1e7a01cea4eae3f3a62a1e109e4ed4a55dcd559.tar.gz
gnu: Add tgl.
* gnu/packages/telegram.scm (tgl): New variable.

Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at>
-rw-r--r--gnu/packages/telegram.scm78
1 files changed, 78 insertions, 0 deletions
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+))))