unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add opendht.
@ 2016-05-31 14:17 Lukas Gradl
  2016-05-31 22:04 ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Gradl @ 2016-05-31 14:17 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]



Hello Guix,

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

Thank you!
Best,
Lukas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-telephony-Add-opendht.patch --]
[-- Type: text/x-patch, Size: 2722 bytes --]

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add opendht.
  2016-05-31 14:17 [PATCH] Add opendht Lukas Gradl
@ 2016-05-31 22:04 ` Leo Famulari
  2016-06-03 15:27   ` Lukas Gradl
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2016-05-31 22:04 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

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+.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add opendht.
  2016-05-31 22:04 ` Leo Famulari
@ 2016-06-03 15:27   ` Lukas Gradl
  2016-06-03 19:53     ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Gradl @ 2016-06-03 15:27 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add opendht.
  2016-06-03 15:27   ` Lukas Gradl
@ 2016-06-03 19:53     ` Leo Famulari
  2016-06-05 20:50       ` Lukas Gradl
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2016-06-03 19:53 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

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 :)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add opendht.
  2016-06-03 19:53     ` Leo Famulari
@ 2016-06-05 20:50       ` Lukas Gradl
  2016-06-25 15:31         ` Leo Famulari
  0 siblings, 1 reply; 7+ messages in thread
From: Lukas Gradl @ 2016-06-05 20:50 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]


Leo Famulari <leo@famulari.name> writes:

> 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.
>

OK. I went with crypto.scm, but I do not have a strong opinion here.

>> > 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 :)

I sent a patch for argon2.  I think it actually does not bundle blake2
but rather provide its own implementation.

Attached is an updated patch.

Thank you!



[-- Attachment #2: 0001-gnu-Add-opendht.patch --]
[-- Type: text/x-patch, Size: 3454 bytes --]

From 5db0a8a59fa5a298cf15ec30194d0ba947f1c76c Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Sun, 5 Jun 2016 15:36:55 -0500
Subject: [PATCH] gnu: Add opendht.

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

diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 08eb146..965cc71 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,8 +21,14 @@
 
 (define-module (gnu packages crypto)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages libbsd)
+  #:use-module (gnu packages nettle)
+  #:use-module (gnu packages password-utils)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages serialization)
+  #:use-module (gnu packages tls)
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -88,3 +95,55 @@ OpenBSD tool of the same name.")
                    (non-copyleft "file://base64.c"
                                  "See base64.c in the distribution for
                                  the license from IBM.")))))
+
+
+(define-public opendht
+  (package
+    (name "opendht")
+    (version "0.6.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://github.com/savoirfairelinux/" name
+         "/archive/" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (delete-file-recursively "src/argon2")
+           (substitute* "src/Makefile.am"
+             (("./argon2/libargon2.la") "")
+             (("SUBDIRS = argon2") ""))
+           (substitute* "src/crypto.cpp"
+             (("argon2/argon2.h") "argon2.h"))
+           (substitute* "configure.ac"
+             (("src/argon2/Makefile") ""))))
+       (sha256
+        (base32
+         "09yvkmbqbym3b5md4n96qc1s9sf2n8ji404hagih45rmsj49599x"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("gnutls" ,gnutls)
+       ("nettle" ,nettle)
+       ("msgpack" ,msgpack)
+       ("readline" ,readline)
+       ("argon2" ,argon2)))
+    (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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add opendht.
  2016-06-05 20:50       ` Lukas Gradl
@ 2016-06-25 15:31         ` Leo Famulari
  2016-06-25 16:41           ` Lukas Gradl
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Famulari @ 2016-06-25 15:31 UTC (permalink / raw)
  To: Lukas Gradl; +Cc: guix-devel

On Sun, Jun 05, 2016 at 03:50:20PM -0500, Lukas Gradl wrote:
> Attached is an updated patch.

Pushed as 893d963a, thanks!

> 
> Thank you!
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Add opendht.
  2016-06-25 15:31         ` Leo Famulari
@ 2016-06-25 16:41           ` Lukas Gradl
  0 siblings, 0 replies; 7+ messages in thread
From: Lukas Gradl @ 2016-06-25 16:41 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari <leo@famulari.name> writes:

> On Sun, Jun 05, 2016 at 03:50:20PM -0500, Lukas Gradl wrote:
>> Attached is an updated patch.
>
> Pushed as 893d963a, thanks!


Thank you!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-25 16:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-31 14:17 [PATCH] Add opendht Lukas Gradl
2016-05-31 22:04 ` Leo Famulari
2016-06-03 15:27   ` Lukas Gradl
2016-06-03 19:53     ` Leo Famulari
2016-06-05 20:50       ` Lukas Gradl
2016-06-25 15:31         ` Leo Famulari
2016-06-25 16:41           ` Lukas Gradl

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).