unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Raghav Gururajan <rg@raghavgururajan.name>
Cc: 47274@debbugs.gnu.org, Danny Milosavljevic <dannym@scratchpost.org>
Subject: [bug#47274] Linphone Packages
Date: Tue, 23 Mar 2021 22:25:35 -0400	[thread overview]
Message-ID: <871rc5uw2o.fsf@gmail.com> (raw)
In-Reply-To: <2f3561d8-dfbd-992a-53c0-0856680a8552@raghavgururajan.name> (Raghav Gururajan's message of "Sat, 20 Mar 2021 00:26:42 -0400")

Hi!

Raghav Gururajan <rg@raghavgururajan.name> writes:

> * gnu/packages/crypto.scm (libdecaf): New variable.
> ---
>  gnu/packages/crypto.scm | 63 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
>
> diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
> index 0000e7fbf2..3959464d56 100644
> --- a/gnu/packages/crypto.scm
> +++ b/gnu/packages/crypto.scm
> @@ -47,9 +47,11 @@
>    #:use-module (gnu packages compression)
>    #:use-module (gnu packages crates-io)
>    #:use-module (gnu packages cryptsetup)
> +  #:use-module (gnu packages documentation)
>    #:use-module (gnu packages gettext)
>    #:use-module (gnu packages gnupg)
>    #:use-module (gnu packages golang)
> +  #:use-module (gnu packages graphviz)
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages kerberos)
>    #:use-module (gnu packages libbsd)
> @@ -88,6 +90,67 @@
>    #:use-module (srfi srfi-1)
>    #:use-module (srfi srfi-26))
>  
> +(define-public libdecaf
> +  (package
> +    (name "libdecaf")
> +    (version "1.0.1")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "git://git.code.sf.net/p/ed448goldilocks/code")
> +                    (commit
> +                     (string-append "v" version))))
> +              (file-name
> +               (git-file-name name version))
> +              (sha256
> +               (base32 "1ajgmyvc6a4m1h2hg1g4wz7ibx10x1xys9m6ancnmmf1f2srlfly"))))
> +    (build-system cmake-build-system)
> +    (outputs '("out" "python" "doc"))
> +    (arguments
> +     `(#:configure-flags '("-DENABLE_STATIC=OFF")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch-python-binding
> +           (lambda _
> +             (substitute* "python/setup.py"
> +               (("gmake")
> +                "make")
> +               (("'\\.\\.', 'build', 'lib', 'libdecaf\\.so'")
> +                "'..', '..', 'build', 'src', 'libdecaf.so'"))
> +             #t))

Ending phases with #t is no longer required on core-updates, and we can
stop doing it on master and staging already too, to save us the hassle
of editing them out at some later point in time :-)

> +         (add-after 'install 'install-python-binding
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (with-directory-excursion "../source/python"
> +               (invoke "python" "setup.py" "install"
> +                       (string-append "--prefix=" (assoc-ref outputs "python"))
> +                       "--root=/"))
> +             #t))
> +         (add-after 'install-python-binding 'install-documentation
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (invoke "make" "doc")
> +             (let* ((doc (assoc-ref outputs "doc"))
> +                    (dest (string-append doc "/share/doc")))
> +               (copy-recursively "doc" dest))
> +             #t)))))
> +    (native-inputs
> +     `(("dot" ,graphviz)
> +       ("doxygen" ,doxygen)
> +       ("python" ,python-wrapper)))
> +    (inputs
> +     `(("python2" ,python-2.7)
> +       ("python3" ,python)))

This inputs field seems unnecessary, especially we don't want to add a
dependency to Python 2, which is slowly being carved out of Guix.

> +    (synopsis "Decaf Elliptic Curve Library")
> +    (description "The libdecaf library is an implementation of elliptic curve
> +cryptography using the Montgomery and Edwards curves Curve25519, Ed25519,
> +Ed448-Goldilocks and Curve448, using the Decaf encoding.")
> +    (home-page "http://ed448goldilocks.sourceforge.net/")
> +    (license
> +     (list
> +      ;; Library.
> +      license:expat
> +      ;; Binding.
> +      license:bsd-2))))

I personally prefer the more compact (and common?) indentation of the
licenses list as:

    (license (list license:expat        ;library
                   license:bsd-2))))    ;python bindings

It's down to personal preferences, but I tend to value compactness in
thousand lines long modules :-).

I've made the following changes:

--8<---------------cut here---------------start------------->8---
1 file changed, 5 insertions(+), 15 deletions(-)
gnu/packages/crypto.scm | 20 +++++---------------

modified   gnu/packages/crypto.scm
@@ -116,40 +116,30 @@
                (("gmake")
                 "make")
                (("'\\.\\.', 'build', 'lib', 'libdecaf\\.so'")
-                "'..', '..', 'build', 'src', 'libdecaf.so'"))
-             #t))
+                "'..', '..', 'build', 'src', 'libdecaf.so'"))))
          (add-after 'install 'install-python-binding
            (lambda* (#:key outputs #:allow-other-keys)
              (with-directory-excursion "../source/python"
                (invoke "python" "setup.py" "install"
                        (string-append "--prefix=" (assoc-ref outputs "python"))
-                       "--root=/"))
-             #t))
+                       "--root=/"))))
          (add-after 'install-python-binding 'install-documentation
            (lambda* (#:key outputs #:allow-other-keys)
              (invoke "make" "doc")
              (let* ((doc (assoc-ref outputs "doc"))
                     (dest (string-append doc "/share/doc")))
-               (copy-recursively "doc" dest))
-             #t)))))
+               (copy-recursively "doc" dest)))))))
     (native-inputs
      `(("dot" ,graphviz)
        ("doxygen" ,doxygen)
        ("python" ,python-wrapper)))
-    (inputs
-     `(("python2" ,python-2.7)
-       ("python3" ,python)))
     (synopsis "Decaf Elliptic Curve Library")
     (description "The libdecaf library is an implementation of elliptic curve
 cryptography using the Montgomery and Edwards curves Curve25519, Ed25519,
 Ed448-Goldilocks and Curve448, using the Decaf encoding.")
     (home-page "http://ed448goldilocks.sourceforge.net/")
-    (license
-     (list
-      ;; Library.
-      license:expat
-      ;; Binding.
-      license:bsd-2))))
+    (license (list license:expat        ;library
+                   license:bsd-2))))    ;python bindings
 
 (define-public libsodium
   (package
--8<---------------cut here---------------end--------------->8---

And pushed as commit c221d49510.

Thank you!

Maxim




  parent reply	other threads:[~2021-03-24  2:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20  4:26 [bug#47274] Linphone Packages Raghav Gururajan via Guix-patches via
2021-03-21  6:13 ` Raghav Gururajan via Guix-patches via
2021-03-22  1:48   ` Raghav Gururajan via Guix-patches via
2021-03-22  4:44     ` Raghav Gururajan via Guix-patches via
2021-03-22  4:59       ` Raghav Gururajan via Guix-patches via
2021-03-29  4:03         ` Maxim Cournoyer
2021-03-29  6:05           ` Raghav Gururajan via Guix-patches via
2021-03-29 18:38             ` Maxim Cournoyer
2021-03-29 18:47               ` Raghav Gururajan via Guix-patches via
2021-03-24  4:12       ` Maxim Cournoyer
2021-03-25 13:07       ` Maxim Cournoyer
2021-03-29  5:16         ` Raghav Gururajan via Guix-patches via
2021-03-27  2:13       ` Maxim Cournoyer
2021-03-29  5:52         ` Raghav Gururajan via Guix-patches via
2021-03-27  5:05       ` Maxim Cournoyer
2021-03-29  5:53         ` Raghav Gururajan via Guix-patches via
2021-03-27  5:11       ` Maxim Cournoyer
2021-03-28  4:05         ` Raghav Gururajan via Guix-patches via
2021-03-28  4:43           ` Maxim Cournoyer
2021-03-29  6:02             ` Raghav Gururajan via Guix-patches via
2021-03-29  5:53         ` Raghav Gururajan via Guix-patches via
2021-03-28  0:52       ` Maxim Cournoyer
2021-03-29  5:55         ` Raghav Gururajan via Guix-patches via
2021-03-29  5:44       ` bug#47274: " Maxim Cournoyer
2021-03-29  6:13         ` [bug#47274] " Raghav Gururajan via Guix-patches via
2021-03-29 18:39           ` Maxim Cournoyer
2021-03-25  1:55     ` Maxim Cournoyer
2021-03-29  5:13       ` Raghav Gururajan via Guix-patches via
2021-03-28  4:01     ` Maxim Cournoyer
2021-03-29  6:01       ` Raghav Gururajan via Guix-patches via
2021-03-29  5:19     ` Maxim Cournoyer
2021-03-29  6:12       ` Raghav Gururajan via Guix-patches via
2021-03-24  2:25 ` Maxim Cournoyer [this message]
2021-03-29  5:07   ` Raghav Gururajan via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rc5uw2o.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=47274@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    --cc=rg@raghavgururajan.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).