Patchwork [v5,14/17] gnu: Add perl-crypt-openssl-bignum.

login
register
mail settings
Submitter Danny Milosavljevic
Date July 28, 2016, 9:38 p.m.
Message ID <20160728213833.22057-15-dannym@scratchpost.org>
Download mbox | patch
Permalink /patch/14127/
State New
Headers show

Comments

Danny Milosavljevic - July 28, 2016, 9:38 p.m.
gnu: Add perl-crypt-openssl-bignum.

* gnu/packages/tls.scm (perl-crypt-openssl-bignum, perl-crypt-openssl-arguments): New variables.
---
 gnu/packages/tls.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
Leo Famulari - Aug. 8, 2016, 7:54 p.m.
On Thu, Jul 28, 2016 at 11:38:30PM +0200, Danny Milosavljevic wrote:
> 
> gnu: Add perl-crypt-openssl-bignum.
> 
> * gnu/packages/tls.scm (perl-crypt-openssl-bignum, perl-crypt-openssl-arguments): New variables.
> ---
>  gnu/packages/tls.scm | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 

> diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> index d992c51..fba130b 100644
> --- a/gnu/packages/tls.scm
> +++ b/gnu/packages/tls.scm
> @@ -556,3 +556,39 @@ servers or clients for more complicated applications.")
>      "RSA encoding and decoding, using the openSSL libraries")
>    (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the OpenSSL libraries).")
>    (license (package-license perl))))
> +
> +(define perl-crypt-arguments
> +   `(#:phases (modify-phases %standard-phases
> +      (add-before 'configure 'patch-Makefile.PL
> +        (lambda* (#:key inputs #:allow-other-keys)
> +          (substitute* "Makefile.PL"
> +            (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
> +                                             (assoc-ref inputs "openssl")
> +                                             "/lib -lcrypto'],")))
> +          #t)))))

I see this variable is also used in perl-crypt-openssl-random. I don't
have a very strong sense of Scheme style yet, but so far I've seen
things like this duplicated between package definitions. I think it's
better to reduce the proliferation of non-package variables in
gnu/packages...  what do you think?

I can amend the patches if you agree.
Danny Milosavljevic - Aug. 8, 2016, 9:18 p.m.
> I think it's better to reduce the proliferation of non-package variables in gnu/packages...  what do you think?

I'm fine with it either way. It's not that much.

> I can amend the patches if you agree.

Yes please.
Leo Famulari - Aug. 9, 2016, 1:06 a.m.
On Mon, Aug 08, 2016 at 11:18:09PM +0200, Danny Milosavljevic wrote:
> > I think it's better to reduce the proliferation of non-package variables in gnu/packages...  what do you think?
> 
> I'm fine with it either way. It's not that much.

I decided instead to reduce the proliferation of things I have to do ;)
I will leave it as is.

Patch

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index d992c51..fba130b 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -556,3 +556,39 @@  servers or clients for more complicated applications.")
     "RSA encoding and decoding, using the openSSL libraries")
   (description "Crypt::OpenSSL::RSA does RSA encoding and decoding (using the OpenSSL libraries).")
   (license (package-license perl))))
+
+(define perl-crypt-arguments
+   `(#:phases (modify-phases %standard-phases
+      (add-before 'configure 'patch-Makefile.PL
+        (lambda* (#:key inputs #:allow-other-keys)
+          (substitute* "Makefile.PL"
+            (("'LIBS'.*=>.*") (string-append "'LIBS' => ['-L"
+                                             (assoc-ref inputs "openssl")
+                                             "/lib -lcrypto'],")))
+          #t)))))
+
+(define-public perl-crypt-openssl-bignum
+ (package
+  (name "perl-crypt-openssl-bignum")
+  (version "0.06")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append
+             "mirror://cpan/authors/id/K/KM/KMX/Crypt-OpenSSL-Bignum-"
+             version
+             ".tar.gz"))
+      (sha256
+        (base32
+          "05yzrdglrrzp191krf77zrwfkmzrfwrsrx1vyskbj94522lszk67"))))
+  (build-system perl-build-system)
+  (inputs `(("openssl" ,openssl)))
+  (arguments perl-crypt-arguments)
+  (home-page
+    "http://search.cpan.org/dist/Crypt-OpenSSL-Bignum")
+  (synopsis
+    "OpenSSL's multiprecision integer arithmetic in Perl")
+  (description "Crypt::OpenSSL::Bignum provides multiprecision integer
+arithmetic in Perl.")
+  ;; At your option either gpl1+ or the Artistic License
+  (license (package-license perl))))