[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25787: [PATCH 3/6] gnu: Add cryptopp.
From: |
Marius Bakke |
Subject: |
bug#25787: [PATCH 3/6] gnu: Add cryptopp. |
Date: |
Wed, 22 Feb 2017 16:53:19 +0100 |
User-agent: |
Notmuch/0.23.5 (https://notmuchmail.org) Emacs/25.1.1 (x86_64-unknown-linux-gnu) |
Pierre Langlois <address@hidden> writes:
> * gnu/packages/crypto.scm (cryptopp): New variable.
I've actually been sitting on this package for a while, hoping they
would release a version with this fix:
https://github.com/weidai11/cryptopp/pull/347
Can you try to extract out the commit and add it as a patch?
> diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
> index fd2b5a36b..a8756e2ab 100644
> --- a/gnu/packages/crypto.scm
> +++ b/gnu/packages/crypto.scm
> @@ -6,6 +6,7 @@
> ;;; Copyright © 2016 Tobias Geerinckx-Rice <address@hidden>
> ;;; Copyright © 2016 ng0 <address@hidden>
> ;;; Copyright © 2016 Eric Bavier <address@hidden>
> +;;; Copyright © 2017 Pierre Langlois <address@hidden>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -414,3 +415,46 @@ utility as a demonstration of the @code{scrypt} key
> derivation function.
> @code{Scrypt} is designed to be far more resistant against hardware
> brute-force
> attacks than alternative functions such as @code{PBKDF2} or @code{bcrypt}.")
> (license license:bsd-2)))
> +
> +(define-public cryptopp
> + (let ((version "5.6.5"))
I don't think it's necessary to bind the "version" variable outside the
package scope.
> + (package
> + (name "cryptopp")
I would call this "crypto++" both here and in the variable name. It
matches the upstream project name more closely, and is also how it is
known in the Common Platform Enumerations (CPE) database.[0]
https://lists.gnu.org/archive/html/guix-devel/2017-02/msg00587.html
> + (version version)
> + (source (origin
> + (method url-fetch)
> + (uri (string-append
> +
> "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_"
> + (string-join (string-split version #\.) "_")
> ".tar.gz"))
Please download from the home page when possible:
https://cryptopp.com/cryptopp565.zip
> + (file-name (string-append name "-" version ".tar.gz"))
> + (sha256
> + (base32
> + "11p6mak784mx8hjasg9alwk4g3q5bsfrik9lv73a34dinca5bzbr"))))
> + (build-system cmake-build-system)
> + (arguments
> + '(#:phases
> + (modify-phases %standard-phases
> + ;; A libcrypto++.pc file is not included, create it.
Nice!
> + (add-after 'install 'install-pkg-config
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let* ((out (assoc-ref outputs "out"))
> + (pkgconfig-path (string-append out
> "/lib/pkgconfig")))
> + (mkdir-p pkgconfig-path)
> + (with-output-to-file
> + (string-append pkgconfig-path "/libcrypto++.pc")
> + (lambda _
> + (format #t
> + "address@hidden@
> + libdir=${prefix}/lib~@
> + includedir=${prefix}/include~@
> + Name: address@hidden@
> + Description: Class library of cryptographic
> schemes~@
> + Version: address@hidden@
> + Libs: -L${libdir} -lcryptopp~@
> + Cflags: -I${includedir}~%"
> + out version)))))))))
Ahh.. This is why it was let-bound. You can "unquote" version here to
make it be evaluated without binding it at the top level. Note: You
probably also have to "quasiquote" the arguments with ` instead of ' (on
the line that contains #:phases).
> + (home-page "https://cryptopp.com/")
> + (synopsis "C++ class library of cryptographic schemes")
> + (description "Crypto++ is a free C++ class library of cryptographic
> +schemes.")
> + (license (list license:boost1.0 license:public-domain)))))
This needs a comment explaining what is covered by which license.
Can you send an updated patch? :)
signature.asc
Description: PGP signature
- bug#25787: [PATCH 0/6] Add Clementine music player., Pierre Langlois, 2017/02/18
- bug#25787: [PATCH 5/6] gnu: sqlite: Enable FTS3., Pierre Langlois, 2017/02/18
- bug#25787: [PATCH 1/6] gnu: Add qjson., Pierre Langlois, 2017/02/18
- bug#25787: [PATCH 2/6] gnu: Add libechonest., Pierre Langlois, 2017/02/18
- bug#25787: [PATCH 4/6] gnu: nss: Update to 3.28.1., Pierre Langlois, 2017/02/18
- bug#25787: [PATCH 3/6] gnu: Add cryptopp., Pierre Langlois, 2017/02/18
- bug#25787: [PATCH 3/6] gnu: Add cryptopp.,
Marius Bakke <=
- bug#25787: [PATCH 6/6] gnu: Add Clementine., Pierre Langlois, 2017/02/18
- bug#25787: [PATCH 6/6], Thomas Danckaert, 2017/02/20
- bug#25787: [PATCH 0/6] Add Clementine music player., Marius Bakke, 2017/02/22