diff mbox

Add msgpack

Message ID 87vb128x3y.fsf@openmailbox.org
State New
Headers show

Commit Message

Lukas Gradl June 21, 2016, 1:55 p.m. UTC
Leo Famulari <leo@famulari.name> writes:

> On Sat, Jun 18, 2016 at 10:44:16PM -0500, Lukas Gradl wrote:
>> Lukas Gradl <lgradl@openmailbox.org> writes:
>> 
>> > So the flags -I, -L, -l for zlib are all there for both dynamic and
>> > static linking.  But still no store reference.
>> 
>> I think the reason why there is no reference is that msgpack uses
>> zbuffer only for tests.  Before compilation, the file only references
>> the name "zlib" and does not mention the hash in the path of zlib in the
>> store.  During compilation (during "check"), this mere name "zlib" gets
>> somehow resolved to the path of zlib in the store.  The binary file
>> resulting from compiling zbuffer should therefore contain a reference to
>> zlib, which should be detectable by guix gc --references.  I think
>> however, that this binary file does not get installed as it is only used
>> for tests.  All the files that do get installed in the output path of
>> msgpack in the store do not contain the hash part of the store-path of
>> zlib.  They only refer to zlib by name.  IIUC this can not be detected
>> by guix gc --references since it only searches for the hash part of
>> the store-path of zlib.
>> 
>> This is what I grasp from looking at libstore/references.cc and
>> libstore/store-api.cc.  I am not sure about this though.
>
> That's my understanding as well.
>
> Thanks for trying all the things you described in your previous email.
>
> Since we are still stuck on this, I think we should continue with Ring
> and see if this becomes a problem later on. If so, let's contact the
> msgpack maintainers and ask for advice.

OK, sounds good.

>
> We should add a caveat in a comment in msgpack's package definition, for
> future readers.

I added a comment in the attached patch.

>
> I'm curious — how close are you to a Ring package definition?

Yes, packaging Ring is taking longer than I expected (on my side that
is).  I will send a detailed update within the next two hours.

Thank you for all your work on this.  I would have never even noticed
that issue!  Thank you!

Best,
Lukas

Comments

Leo Famulari June 21, 2016, 4:06 p.m. UTC | #1
On Tue, Jun 21, 2016 at 08:55:45AM -0500, Lukas Gradl wrote:
> Leo Famulari <leo@famulari.name> writes:
> > I'm curious — how close are you to a Ring package definition?
> 
> Yes, packaging Ring is taking longer than I expected (on my side that
> is).  I will send a detailed update within the next two hours.

I didn't mean to make you feel rushed. I was just curious :)

> Thank you for all your work on this.  I would have never even noticed
> that issue!  Thank you!

Thank *you* for working on it, too!
diff mbox

Patch

From ae4a2a66b39059463eb16b8094e2d598249bf9c6 Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Tue, 21 Jun 2016 08:46:15 -0500
Subject: [PATCH] gnu: Add msgpack.

* gnu/packages/serialization.scm (msgpack): New variable.
---
 gnu/packages/serialization.scm | 53 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 52 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 8dfd21d..6ab0d59 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -1,5 +1,6 @@ 
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,8 +22,13 @@ 
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
-  #:use-module (gnu packages documentation))
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages documentation)
+  #:use-module (gnu packages pkg-config))
 
 (define-public cereal
   (package
@@ -72,3 +78,48 @@ 
 arbitrary data types and reversibly turns them into different representations,
 such as compact binary encodings, XML, or JSON.")
     (license license:bsd-3)))
+
+
+(define-public msgpack
+  (package
+    (name "msgpack")
+    (version "1.4.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/msgpack/msgpack-c/releases/download/"
+         "cpp-" version "/msgpack-" version ".tar.gz"))
+       (snippet
+        '(let ((p (open-file "msgpack.pc.in" "a")))
+           (begin
+             (display
+              (string-append "Requires: " "zlib" "\n") p)
+             (close-output-port p))))
+       (sha256
+        (base32
+         "0bpjfh9vz0n2k93mph3x15clmigkgs223xfn8h12ymrh5gsi5ica"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("googletest" ,googletest)
+       ("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("zlib" ,zlib))) ;; Msgpack installs two headers (zbuffer.h,
+    ;; zbuffer.hpp) which #include <zlib.h>.  However, 'guix gc --references'
+    ;; does not detect a store reference to zlib since these headers are not
+    ;; compiled. 
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autoconf
+           (lambda _
+             (system* "autoreconf" "-vfi"))))))
+    (home-page "http://www.msgpack.org")
+    (synopsis "Binary serialization library")
+    (description "Msgpack is a library for C/C++ that implements binary
+serialization.")
+    (license license:boost1.0)))
-- 
2.7.4