From 2a10583ec96e30fed9fb14e2314eef725c26af58 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sun, 17 Jan 2021 12:16:34 -0500
Subject: [PATCH 16/18] gnu: Add tl-parser.
* gnu/packages/telegram.scm (tl-parser): New variable.
---
gnu/packages/telegram.scm | 49 +++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
@@ -567,3 +567,52 @@ Telegram instant messager.")
license:lgpl2.1+
;; Others
license:gpl3+))))
+
+(define-public tl-parser
+ (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
+ (revision "1"))
+ (package
+ (name "tl-parser")
+ (version
+ (git-version "0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/vysheng/tl-parser.git")
+ (commit commit)))
+ (file-name
+ (git-file-name name version))
+ (sha256
+ (base32 "13cwi247kajzpkbl86hnwmn1sn2h6rqndz6khajbqj0mlw9mv4hq"))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:tests? #f ; No target
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (include (string-append out "/include"))
+ (source (string-append (getenv "TEMP") "/source"))
+ (build (string-append (getenv "TEMP") "/build")))
+ ;; Install executables.
+ (with-directory-excursion build
+ (for-each
+ (lambda (file)
+ (install-file file bin))
+ (list
+ "tl-parser")))
+ ;; Install headers.
+ (for-each
+ (lambda (file)
+ (install-file file (string-append include "/tl-parser")))
+ (find-files source "\\.h$")))
+ #t)))))
+ (synopsis "Parse tl scheme to tlo")
+ (description "TL-Parser is a tl scheme to tlo file parser. It was formely
+a part of telegram-cli, but now being maintained separately.")
+ (home-page "https://github.com/vysheng/tl-parser")
+ (license license:gpl2+))))
--
2.30.0