From 86addd1eaea66e86c2bf33b86394312512f9c7bd Mon Sep 17 00:00:00 2001 From: Raghav Gururajan 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(+) 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