Patchwork Add opendht.

login
register
mail settings
Submitter Lukas Gradl
Date May 31, 2016, 2:17 p.m.
Message ID <87h9de2txi.fsf@openmailbox.org>
Download mbox | patch
Permalink /patch/12646/
State New
Headers show

Comments

Lukas Gradl - May 31, 2016, 2:17 p.m.
Hello Guix,

Attached is a patch to add the opendht library, a dependency of the
Ring.

Thank you!
Best,
Lukas
Leo Famulari - May 31, 2016, 10:04 p.m.
On Tue, May 31, 2016 at 09:17:29AM -0500, Lukas Gradl wrote:
> * gnu/packages/telephony.scm (opendht): New variable.

I wonder if there is a better module? Distributed hash tables aren't
specific to telephony.

> +(define-public opendht
> +  (let ((commit "13f8c13ac4ebb3b43474d91ca48b42a1019083f4"))
> +    ;; This is the commit used by the Ring Project.

If Ring works with the latest tagged release, then I think we should use
that instead of the Git commit. They released only 3 days ago, so it's
unlikely that Ring needs some feature that's not in the tarball.

> +      (inputs
> +       `(("gnutls" ,gnutls)
> +         ("nettle" ,nettle)
> +         ("msgpack" ,msgpack)
> +         ("readline" ,readline)))

I noticed they bundle Argon2, which is a password hashing library:
https://github.com/savoirfairelinux/opendht/tree/master/src/argon2

I think we should delete the bundled library in an origin snippet and
make opendht use an external package.

> +      (native-inputs
> +       `(("autoconf" ,autoconf)
> +         ("pkg-config" ,pkg-config)
> +         ("automake" ,automake)
> +         ("libtool" ,libtool)))
> +      (arguments
> +       `(#:configure-flags '("--disable-tools" "--disable-python")
> +         #:phases (modify-phases %standard-phases
> +                    (add-before 'configure 'autoconf
> +                      (lambda _
> +                        (zero? (system* "autoreconf" "-vfi")))))))

If we package a tagged release, it's possible that we won't need to
bootstrap.

> +      (license gpl3))))

I skimmed the source files, and most of them said "either version 3 of
the License, or (at your option) any later version.", so we should use
gpl3+.
Lukas Gradl - June 3, 2016, 3:27 p.m.
Hi Leo,


Thank you for your review!

Leo Famulari <leo@famulari.name> writes:

> On Tue, May 31, 2016 at 09:17:29AM -0500, Lukas Gradl wrote:
>> * gnu/packages/telephony.scm (opendht): New variable.
>
> I wonder if there is a better module? Distributed hash tables aren't
> specific to telephony.

I am thinking about putting it in crypto.scm.  Do you think that is more
appropriate? 

>
>> +(define-public opendht
>> +  (let ((commit "13f8c13ac4ebb3b43474d91ca48b42a1019083f4"))
>> +    ;; This is the commit used by the Ring Project.
>
> If Ring works with the latest tagged release, then I think we should use
> that instead of the Git commit. They released only 3 days ago, so it's
> unlikely that Ring needs some feature that's not in the tarball.
>

OK, Yes, I will look into that.


>> +      (inputs
>> +       `(("gnutls" ,gnutls)
>> +         ("nettle" ,nettle)
>> +         ("msgpack" ,msgpack)
>> +         ("readline" ,readline)))
>
> I noticed they bundle Argon2, which is a password hashing library:
> https://github.com/savoirfairelinux/opendht/tree/master/src/argon2
>
> I think we should delete the bundled library in an origin snippet and
> make opendht use an external package.

Oops! Sorry that I missed that.  I looked onto that and argon2 bundles
blake2.  I am working on patches for the two of those right now.

>
>> +      (native-inputs
>> +       `(("autoconf" ,autoconf)
>> +         ("pkg-config" ,pkg-config)
>> +         ("automake" ,automake)
>> +         ("libtool" ,libtool)))
>> +      (arguments
>> +       `(#:configure-flags '("--disable-tools" "--disable-python")
>> +         #:phases (modify-phases %standard-phases
>> +                    (add-before 'configure 'autoconf
>> +                      (lambda _
>> +                        (zero? (system* "autoreconf" "-vfi")))))))
>
> If we package a tagged release, it's possible that we won't need to
> bootstrap.
>
>> +      (license gpl3))))
>
> I skimmed the source files, and most of them said "either version 3 of
> the License, or (at your option) any later version.", so we should use
> gpl3+.

Ah, OK.  I just looked at their README which just says GPL3.  I will
change that.

I am planning to submit a new patch after argon2 + blake2.  Hopefully
that will happen this weekend.

Thank you!
Best,
Lukas
Leo Famulari - June 3, 2016, 7:53 p.m.
On Fri, Jun 03, 2016 at 10:27:32AM -0500, Lukas Gradl wrote:
> Leo Famulari <leo@famulari.name> writes:
> > On Tue, May 31, 2016 at 09:17:29AM -0500, Lukas Gradl wrote:
> >> * gnu/packages/telephony.scm (opendht): New variable.
> >
> > I wonder if there is a better module? Distributed hash tables aren't
> > specific to telephony.
> 
> I am thinking about putting it in crypto.scm.  Do you think that is more
> appropriate? 

I didn't find any module that fits perfectly. The networking module is
another option in my opinion. I leave it up to you.

> > I think we should delete the bundled library in an origin snippet and
> > make opendht use an external package.
> 
> Oops! Sorry that I missed that.  I looked onto that and argon2 bundles
> blake2.  I am working on patches for the two of those right now.

Thanks! I know it means more work :)

Patch

From 392ea1f9194d299d73af5b21ee7f76e34653556a Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Tue, 31 May 2016 09:14:21 -0500
Subject: [PATCH] gnu: telephony: Add opendht.

* gnu/packages/telephony.scm (opendht): New variable.
---
 gnu/packages/telephony.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 0f43e79..1fd9665 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -25,7 +25,10 @@ 
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages nettle)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages serialization)
   #:use-module (gnu packages tls)
   #:use-module (guix licenses)
   #:use-module (guix packages)
@@ -247,3 +250,44 @@  and a supporting cryptographic kernel.")
       (description "LibIAX implements the Inter-Asterisk-Protocol for relaying
 Voice-over-IP (VoIP) communications.")
       (license lgpl2.0))))
+
+(define-public opendht
+  (let ((commit "13f8c13ac4ebb3b43474d91ca48b42a1019083f4"))
+    ;; This is the commit used by the Ring Project.
+    (package
+      (name "opendht")
+      (version (string-append "0.0.0-1." (string-take commit 7)))
+      (source
+       (origin
+         (method url-fetch)
+         (uri
+          (string-append
+           "https://github.com/savoirfairelinux/opendht/archive/"
+           commit ".tar.gz"))
+         (file-name (string-append name "-" version ".tar.gz"))
+         (sha256
+          (base32
+           "12yn2cladxph8n87nkm7xwfn25kc8rjr2wabq84ik4lhpd82vdn4"))))
+      (build-system gnu-build-system)
+      (inputs
+       `(("gnutls" ,gnutls)
+         ("nettle" ,nettle)
+         ("msgpack" ,msgpack)
+         ("readline" ,readline)))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("pkg-config" ,pkg-config)
+         ("automake" ,automake)
+         ("libtool" ,libtool)))
+      (arguments
+       `(#:configure-flags '("--disable-tools" "--disable-python")
+         #:phases (modify-phases %standard-phases
+                    (add-before 'configure 'autoconf
+                      (lambda _
+                        (zero? (system* "autoreconf" "-vfi")))))))
+      (home-page "https://github.com/savoirfairelinux/opendht/")
+      (synopsis "Distributed Hash Table (DHT) library")
+      (description "OpenDHT is a Distributed Hash Table (DHT) library.  It may
+be used to manage peer-to-peer network connections as needed for real time
+communication.")
+      (license gpl3))))
-- 
2.7.4