>From 5acce278858ee381702d3cae50235feadbbae9fe Mon Sep 17 00:00:00 2001
From: Adonay Felipe Nogueira
Date: Tue, 21 Nov 2017 23:35:08 -0200
Subject: [PATCH] Update opendht, argon2. Add kashmir, secp256k1,
opendht-with-msgpack-c++-11
This adds packages that are needed for GNU Ring, but which need less
adaptations specific for it.
* gnu/packages/cpp.scm (kashmir): New package.
* gnu/packages/crypto.scm
(secp256k1): New package.
(opendht): Update to 1.4.0-5.a789ffe.
(opendht-with-msgpack-c++-11): New package.
* gnu/packages/password-utils.scm (argon2): Update to 20161029-4.1eea010.
* gnu/packages/serialization.scm (msgpack-c++-11): New package.
---
gnu/packages/cpp.scm | 81 +++++++++++++++++++++++++++++-
gnu/packages/crypto.scm | 69 +++++++++++++++++++++++++-
gnu/packages/password-utils.scm | 106 +++++++++++++++++++++++++++-------------
gnu/packages/serialization.scm | 12 +++++
4 files changed, 233 insertions(+), 35 deletions(-)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 5ad9fd3..239046a 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ethan R. Jones
+;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira
;;;
;;; This file is part of GNU Guix.
;;;
@@ -21,8 +22,86 @@
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module (gnu packages)
- #:use-module (gnu packages autotools))
+ #:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages compression))
+
+(define-public kashmir
+ (let ((release "0")
+ (revision 1)
+ (commit "2f3913f49c4ac7f9bff9224db5178f6f8f0ff3ee"))
+ (package
+ (name "kashmir")
+ (version (string-append release
+ (if (and (defined? 'revision)
+ (not (zero? revision)))
+ (string-append "-"
+ (number->string revision))
+ "")
+ (if (defined? 'commit)
+ (string-append "."
+ (string-take commit 7))
+ "")))
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/Corvusoft/" name
+ "-dependency/archive/" commit ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0pwpl0m61qyrnnw9iaacg9sh9lqafqyaqmmas0swjakww1b968si"))))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils)
+ (ice-9 ftw)
+ (ice-9 regex))
+ (let ((gzip (assoc-ref %build-inputs "gzip"))
+ (source (assoc-ref %build-inputs "source"))
+ (tar (assoc-ref %build-inputs "tar"))
+ (dot-symlinks-regex (make-regexp "^\\.\\.?$"))
+ (license-text-file-regex (make-regexp "^LICENSE" regexp/icase)))
+ (setenv "PATH" (string-append gzip "/bin:"
+ tar "/bin"))
+ (mkdir-p %output)
+ (system* "tar" "-xv" "--strip-components=1" "-f" source "-C" %output)
+ (chdir %output)
+ (copy-recursively "kashmir"
+ (string-append "include/"
+ ,name))
+ (for-each (lambda (license-text-file)
+ (install-file license-text-file
+ (string-append "share/doc/"
+ ,name))
+ (delete-file license-text-file))
+ (scandir "."
+ (lambda (current-basename)
+ (regexp-exec license-text-file-regex
+ current-basename))))
+ (for-each (lambda (useless-basename)
+ (delete-file-recursively useless-basename))
+ (scandir "."
+ (lambda (current-basename)
+ (and (not (regexp-exec dot-symlinks-regex
+ current-basename))
+ (not (regexp-exec license-text-file-regex
+ current-basename))
+ (not (string-match "^(share|include)$"
+ current-basename))))))))))
+ (native-inputs
+ `(("source" ,source)
+ ("tar" ,tar)
+ ("gzip" ,gzip)))
+ (synopsis "C++ library providing I/O, MD5, SHA-1, random number string, and UUID operations")
+ (description "The Kashmir Library provides features allowing usage of
+I/O formatting and state saving; MD5 and SHA-1 hashing; random number streams,
+and UUID generation.")
+ (home-page "https://github.com/corvusoft/kashmir-dependency")
+ (license license:boost1.0))))
(define-public libzen
(package
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 7f02400..2b23933 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -7,6 +7,8 @@
;;; Copyright © 2016, 2017 ng0
;;; Copyright © 2016, 2017 Eric Bavier
;;; Copyright © 2017 Pierre Langlois
+;;; Copyright © 2017 Marius Bakke
+;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,10 +41,12 @@
#:use-module (gnu packages libbsd)
#:use-module (gnu packages libffi)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages multiprecision)
#:use-module (gnu packages nettle)
#:use-module (gnu packages password-utils)
#:use-module (gnu packages perl)
#:use-module (gnu packages perl-check)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages readline)
#:use-module (gnu packages search)
#:use-module (gnu packages serialization)
@@ -56,7 +60,9 @@
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
- #:use-module (guix build-system perl))
+ #:use-module (guix build-system perl)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-1))
(define-public libsodium
(package
@@ -112,6 +118,59 @@ communication, encryption, decryption, signatures, etc.")
license:public-domain))
(home-page "https://www.hadrons.org/software/libmd/")))
+(define-public secp256k1
+ (let ((release "0.1")
+ (revision 1)
+ (commit "0b7024185045a49a1a6a4c5615bf31c94f63d9c4"))
+ (package
+ (name "secp256k1")
+ (version (string-append release
+ (if (and (defined? 'revision)
+ (not (zero? revision)))
+ (string-append "-"
+ (number->string revision))
+ "")
+ (if (defined? 'commit)
+ (string-append "."
+ (string-take commit 7))
+ "")))
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/bitcoin-core/" name
+ "/archive/" commit ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "16xzxjc0y38k7cs6j1caipw03y8c7zycv3amb12r3jakz00b2ra6"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'run-autogen
+ (lambda _
+ (zero? (system* "./autogen.sh"))
+ #t)))))
+ (inputs
+ `(("gmp" ,gmp)))
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("libtool" ,libtool)))
+ (home-page "https://github.com/bitcoin-core/secp256k1/")
+ (synopsis "Optimized C library for EC operations on curve secp256k1")
+ (description "Library that has the following features:
address@hidden
address@hidden secp256k1 ECDSA signing/verification and key generation;
address@hidden adding/multiplying private/public keys;
address@hidden serialization/parsing of private keys, public keys, signatures;
address@hidden constant time, constant memory access signing and pubkey generation;
address@hidden derandomized DSA (via RFC6979 or with a caller provided function).
address@hidden itemize")
+ (license license:expat
+ ;; TODO Should we list *all* the licenses found?
+ ;; license:asl2.0
+ ))))
+
(define-public signify
(package
(name "signify")
@@ -205,6 +264,14 @@ be used to manage peer-to-peer network connections as needed for real time
communication.")
(license license:gpl3)))
+(define-public opendht-with-msgpack-c++-11
+ (package
+ (inherit opendht)
+ (name "opendht-with-msgpack-c++-11")
+ (propagated-inputs
+ `(("msgpack-c++-11" ,msgpack-c++-11)
+ ,@(alist-delete "msgpack" (package-propagated-inputs opendht))))))
+
(define-public encfs
(package
(name "encfs")
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index a758817..4c495d5 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2017 Jelle Licht
;;; Copyright © 2017 Eric Bavier
;;; Copyright © 2017 Nicolas Goaziou
+;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira
;;;
;;; This file is part of GNU Guix.
;;;
@@ -33,8 +34,10 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
+ #:use-module ((guix build utils) #:select (install-file substitute*))
#:use-module (guix download)
#:use-module (guix packages)
+ #:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages admin)
#:use-module (gnu packages aidc)
@@ -406,39 +409,76 @@ through the pass command.")
(license license:gpl2+)))
(define-public argon2
- (package
- (name "argon2")
- (version "20161029")
- (source
- (origin
- (method url-fetch)
- (uri
- (string-append "https://github.com/P-H-C/phc-winner-argon2/archive/"
- version ".tar.gz"))
- (file-name (string-append name "-" version ".tar.gz"))
- (sha256
- (base32
- "1rymikbysasdadm325jx69i0q19d9srqkny69jwmhswlidr4j07y"))))
- (build-system gnu-build-system)
- (arguments
- `(#:test-target "test"
- #:make-flags '("CC=gcc")
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (replace 'install
- (lambda _
- (let ((out (assoc-ref %outputs "out")))
- (install-file "argon2" (string-append out "/bin"))
- (install-file "libargon2.a" (string-append out "/lib"))
- (install-file "libargon2.so" (string-append out "/lib"))
- (copy-recursively "include"
- (string-append out "/include"))))))))
- (home-page "https://www.argon2.com/")
- (synopsis "Password hashing library")
- (description "Argon2 provides a key derivation function that was declared
-winner of the 2015 Password Hashing Competition.")
- (license license:cc0)))
+ (let ((release "20161029")
+ (revision 4)
+ (commit "1eea0104e7cb2a38c617cf90ffa46ce5db6aceda"))
+ (package
+ (name "argon2")
+ (version (string-append release
+ (if (and (defined? 'revision)
+ (not (zero? revision)))
+ (string-append "-"
+ (number->string revision))
+ "")
+ (if (defined? 'commit)
+ (string-append "."
+ (string-take commit 7))
+ "")))
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/P-H-C/phc-winner-argon2/archive/"
+ commit ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0rjy1hg8l6m2d1r1lyq2z3w43smxbq38qfmzvwf0ifxka64mn8is"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:test-target "test"
+ #:make-flags '("CC=gcc"
+ "OPTTARGET=no-opt")
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-pkg-config-and-makefile
+ (lambda _
+ (substitute* "libargon2.pc"
+ (("/usr")
+ (assoc-ref %outputs "out"))
+ (("@HOST_MULTIARCH@")
+ ,(or (%current-target-system)
+ (%current-system)))
+ (("@UPSTREAM_VER@")
+ ,release))
+ #t))
+ (replace 'install
+ (lambda _
+ (let ((out (assoc-ref %outputs "out")))
+ (install-file "argon2"
+ (string-append out
+ "/bin"))
+ (install-file "libargon2.a"
+ (string-append out
+ "/lib"))
+ (install-file "libargon2.so.0"
+ (string-append out
+ "/lib"))
+ (install-file "libargon2.pc"
+ (string-append out
+ "/lib/pkgconfig"))
+ (copy-recursively "include"
+ (string-append out
+ "/include"))
+ (symlink (string-append out
+ "/lib/libargon2.so.0")
+ (string-append out
+ "/lib/libargon2.so")))
+ #t)))))
+ (home-page "https://www.argon2.com/")
+ (synopsis "Password hashing library")
+ (description "Argon2 provides a key derivation function that was
+declared winner of the 2015 Password Hashing Competition.")
+ (license license:cc0))))
(define-public python-bcrypt
(package
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 03365ad..37b1231 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Gregor Giesen
;;; Copyright © 2017 Frederick M. Muriithi
;;; Copyright © 2017 ng0
+;;; Copyright © 2017 Adonay "adfeno" Felipe Nogueira
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,6 +32,7 @@
#:use-module (guix utils)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages boost)
@@ -137,6 +139,16 @@ such as compact binary encodings, XML, or JSON.")
serialization.")
(license license:boost1.0)))
+(define-public msgpack-c++-11
+ (package
+ (inherit msgpack)
+ (name "msgpack-c++-11")
+ (arguments
+ (substitute-keyword-arguments (package-arguments msgpack)
+ ((#:make-flags msgpack-make-flags)
+ `(append ,msgpack-make-flags
+ '("-DMSGPACK_CXX11=ON")))))))
+
(define-public libmpack
(package
(name "libmpack")
--
1.9.1