Subject: [PATCH 2/3] gnu: Add emacs-zmq.

From: Vinicius Monego <[email-masked]>
Date: Mon, 19 Jul 2021 03:51:52 +0000

* gnu/packages/emacs-xyz.scm (emacs-zmq): New variable.
---
 gnu/packages/emacs-xyz.scm | 46 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 037e7b71c2..e7fb0df5da 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -155,6 +155,7 @@
   #:use-module (gnu packages ibus)
   #:use-module (gnu packages java)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages telephony)
@@ -5989,6 +5990,51 @@ view the build status of those servers' build jobs, and possibly to trigger
 build jobs.")
     (license license:gpl3+)))
 
+(define-public emacs-zmq
+  (package
+    (name "emacs-zmq")
+    (version "0.10.10")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/nnicandro/emacs-zmq")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0ngxm5mm0kqgvn8977ryrngamx0khzlw86d8vz5s0jhm2kgwnqp8"))))
+    (build-system emacs-build-system)
+    (arguments
+     `(#:tests? #f ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'configure
+           (lambda _
+             (invoke "make" "src/configure")
+             (substitute* "src/configure"
+               (("/bin/sh") (which "sh"))
+               (("/usr/bin/file") (which "file")))
+             (invoke "make")))
+         (add-after 'install 'install-shared-object
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (site-lisp (string-append out "/share/emacs/site-lisp"))
+                    (libdir (string-append site-lisp "/zmq-0.10.10")))
+               (copy-file "emacs-zmq.so"
+                          (string-append libdir "/emacs-zmq.so"))))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("zeromq" ,zeromq)))
+    (home-page "https://github.com/nnicandro/emacs-zmq")
+    (synopsis "Emacs bindings to ØMQ")
+    (description "This package provides Emacs bindings to ØMQ.")
+    (license (list license:gpl2+     ;zmq.el
+                   license:gpl3+)))) ;src/emacs-module.h
+
 (define-public emacs-tup-mode
   (package
     (name "emacs-tup-mode")
-- 
2.30.2