gnu: Add cl-rdkafka.
authorKatherine Cox-Buday <cox.katherine.e@gmail.com>
Sun, 7 Jun 2020 08:56:59 +0000 (10:56 +0200)
committerGuillaume Le Vaillant <glv@posteo.net>
Sun, 7 Jun 2020 09:05:04 +0000 (11:05 +0200)
* gnu/packages/lisp-xyz.scm (sbcl-cl-rdkafka, cl-rdkafka): New variables.

Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
gnu/packages/lisp-xyz.scm

index d8009c2..0bf2dec 100644 (file)
@@ -11938,3 +11938,51 @@ tables.")
 
 (define-public ecl-cl-ascii-table
   (sbcl-package->ecl-package sbcl-cl-ascii-table))
+
+(define-public sbcl-cl-rdkafka
+  (package
+    (name "sbcl-cl-rdkafka")
+    (version "1.0.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/SahilKang/cl-rdkafka.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1qcgfd4h7syilzmrmd4z2vknbvawda3q3ykw7xm8n381syry4g82"))))
+    (build-system asdf-build-system/sbcl)
+    (arguments
+     `(#:tests? #f ; Attempts to connect to locally running Kafka
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/low-level/librdkafka-bindings.lisp"
+               (("librdkafka" all)
+                (string-append (assoc-ref inputs "librdkafka") "/lib/"
+                               all)))))
+         (add-before 'cleanup 'move-bundle
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (actual (string-append out "/lib/sbcl/src/cl-rdkafka.fasl"))
+                    (expected (string-append
+                               out "/lib/sbcl/cl-rdkafka--system.fasl")))
+               (copy-file actual expected)
+               #t))))))
+    (inputs
+     `(("bordeaux-threads" ,sbcl-bordeaux-threads)
+       ("cffi" ,sbcl-cffi)
+       ("cffi-grovel" ,sbcl-cffi-grovel)
+       ("librdkafka" ,librdkafka)
+       ("lparallel" ,sbcl-lparallel)
+       ("trivial-garbage" ,sbcl-trivial-garbage)))
+    (home-page "https://github.com/SahilKang/cl-rdkafka")
+    (synopsis "Common Lisp client library for Apache Kafka")
+    (description "A Common Lisp client library for Apache Kafka.")
+    (license license:gpl3)))
+
+(define-public cl-rdkafka
+  (sbcl-package->cl-source-package sbcl-cl-rdkafka))