diff mbox

[5/10] opendht: Propagate argon2.

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

Commit Message

Lukas Gradl Sept. 25, 2016, 11:43 p.m. UTC
Danny Milosavljevic <dannym@scratchpost.org> writes:

> Hi Lukas,
>
> On Sun, 25 Sep 2016 17:54:36 -0500
> Lukas Gradl <lgradl@openmailbox.org> wrote:
>
>> I noticed that some linker flags are set incorrectly.  The result was
>> that the output of
>> "objdump -p /gnu/store/...-opendht-0.6.1/lib/libopendht.so"
>> was missing a 'NEEDED' line for 'libargon2.so.0'.
>> The attached patch fixes that.
>
> I'd also add a comment that the purpose of all that is to unbundle argon2 and then re-add the installed argon2 library.

Done.  An updated patch is attached.  Thank you!

Best,
Lukas
diff mbox

Patch

From fd1f5d43844ad80fe516607f869dcbda82b23a1f Mon Sep 17 00:00:00 2001
From: Lukas Gradl <lgradl@openmailbox.org>
Date: Tue, 9 Aug 2016 17:00:52 -0500
Subject: [PATCH 05/10] gnu: opendht: Propagate argon2.

* gnu/packages/crypto.scm (opendht)[source]: Add argon2 to pkg-config file.
[inputs]: Remove argon2.
[propagated-inputs]: Add argon2.
---
 gnu/packages/crypto.scm | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index ff5b0db..5f5e0c2 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -127,15 +127,26 @@  OpenBSD tool of the same name.")
        (file-name (string-append name "-" version ".tar.gz"))
        (modules '((guix build utils)))
        (snippet
+        ;; These changes remove the bundled 'argon2' and instead use the
+        ;; package argon2.
         '(begin
            (delete-file-recursively "src/argon2")
            (substitute* "src/Makefile.am"
              (("./argon2/libargon2.la") "")
-             (("SUBDIRS = argon2") ""))
+             (("SUBDIRS = argon2") "")
+             (("libopendht_la_LDFLAGS = @LDFLAGS@")
+              "libopendht_la_LDFLAGS = @LDFLAGS@ @argon2_LIBS@"))
            (substitute* "src/crypto.cpp"
              (("argon2/argon2.h") "argon2.h"))
            (substitute* "configure.ac"
-             (("src/argon2/Makefile") ""))))
+             (("src/argon2/Makefile") "")
+             (("PKG_CHECK_MODULES..GNUTLS.. .gnutls .. 3.1..")
+              "PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.1])\n\
+PKG_CHECK_MODULES([argon2], [argon2 >= 1.0])"))
+           (substitute* "opendht.pc.in"
+             (("Libs: -L..libdir. -lopendht")
+              (string-append "Libs: -L${libdir} -lopendht\n"
+                             "Requires: argon2")))))
        (sha256
         (base32
          "09yvkmbqbym3b5md4n96qc1s9sf2n8ji404hagih45rmsj49599x"))))
@@ -144,8 +155,9 @@  OpenBSD tool of the same name.")
      `(("gnutls" ,gnutls)
        ("nettle" ,nettle)
        ("msgpack" ,msgpack)
-       ("readline" ,readline)
-       ("argon2" ,argon2)))
+       ("readline" ,readline)))
+    (propagated-inputs
+     `(("argon2" ,argon2)))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("pkg-config" ,pkg-config)
-- 
2.9.0