guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#32727] [PATCH] gnu: Add telegram-purple.


From: Tomáš Čech
Subject: [bug#32727] [PATCH] gnu: Add telegram-purple.
Date: Sun, 21 Oct 2018 18:18:13 +0200

* gnu/packages/messaging.scm (telegram-purple): New variable.
---
 gnu/packages/messaging.scm | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index d50732dfc..b3ee19953 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1720,4 +1720,77 @@ QMatrixClient project.")
     (license (list license:gpl3+ ; all source code
                    license:lgpl3+)))) ; icons/breeze
 
+(define-public telegram-purple
+  (package
+    (name "telegram-purple")
+    (version "1.3.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/majn/telegram-purple";)
+                    (commit (string-append "v" version))
+                    (recursive? #t)))
+              (sha256
+               (base32
+                "0p93jpjpx7hszwffzgixw04zkrpsiyzz4za3gfr4j07krc4771fp"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("which" ,which)))
+    (inputs
+     `(("pidgin" ,pidgin)
+       ("libgcrypt" ,libgcrypt)
+       ("libwebp" ,libwebp)
+       ("glib" ,glib)
+       ("gettext" ,gnu-gettext)
+       ("gtk+" ,gtk+-2)
+       ("zlib" ,zlib)))
+    (arguments
+     `(;; disable tests for now - tests are failing on pidgin path
+       ;; verification but it seems to be harmless
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         ;; We're using release tag for repository checkout - let's prepare
+         ;; header defining GIT_COMMIT manually instead of running git to
+         ;; identify version which is being compiled. Git repository
+         ;; is removed anyway and only source code is kept.
+         (add-after 'unpack 'prepare-commit.h
+           (lambda _
+             (with-output-to-file "./commit.h"
+               (lambda ()
+                 (display
+                  (string-append "//generated by guix, use version instead of "
+                                 "commit\n"
+                                 "#ifndef GIT_COMMIT\n"
+                                 "#  define GIT_COMMIT \"v"
+                                 ,version "\"\n"
+                                 "#endif\n"))))))
+         (replace 'configure
+           ;; configure does not work followed by both "SHELL=..." and
+           ;; "CONFIG_SHELL=..."; set environment variables instead
+           (lambda* (#:key outputs configure-flags #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bash (which "bash"))
+                    (flags `(,(string-append "--prefix=" out)
+                             ,@configure-flags)))
+               (setenv "SHELL" bash)
+               (setenv "CONFIG_SHELL" bash)
+               (apply invoke "./configure" flags))))
+         (replace 'install
+           ;; install is trying to use pidgin's lib directory instead of
+           ;; its own
+           (lambda* (#:key outputs configure-flags #:allow-other-keys)
+             (let* ((tgt (string-append (assoc-ref outputs "out")
+                                        "/lib/purple-2/")))
+               (mkdir-p tgt)
+               (install-file "bin/telegram-purple.so"
+                             tgt)))))))
+    ;; gettext
+    (home-page "https://github.com/majn/telegram-purple";)
+    (synopsis "Telegram support for pidgin")
+    (description "Telegram-purple is a Libpurple protocol plugin that adds
+support for the Telegram messenger.")
+    (license license:gpl2+)))
+
 ;;; messaging.scm ends here
-- 
2.19.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]