guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

444/470: gnu: rust-ring-0.14: Remove pregenerated files.


From: guix-commits
Subject: 444/470: gnu: rust-ring-0.14: Remove pregenerated files.
Date: Thu, 16 Mar 2023 03:02:37 -0400 (EDT)

efraim pushed a commit to branch rust-team
in repository guix.

commit 172534fc832a3637b5b39ea7547fd122bc386ee1
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Mon Mar 13 13:27:08 2023 +0200

    gnu: rust-ring-0.14: Remove pregenerated files.
    
    * gnu/packages/crates-io.scm (rust-ring-0.14)[source]: Add snippet to
    remove pregenerated files and add a fake .git directory.
    [arguments]: Add a phase to generate curve25519 tables.
    [native-inputs]: Add clang, python-2.
---
 gnu/packages/crates-io.scm | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 5bf45bb4e7..a1c83e96d4 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -48973,7 +48973,21 @@ functionality as retain but gives mutable borrow to 
the predicate.")
          (string-append name "-" version ".tar.gz"))
         (sha256
          (base32
-          "0g091akf4dpg9qj05z3gc4nlrs57mjj2bqab98gaqp79wf3c2ss2"))))
+          "0g091akf4dpg9qj05z3gc4nlrs57mjj2bqab98gaqp79wf3c2ss2"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Fix the doc tests.
+           (substitute* "src/ec/curve25519/ed25519/verification.rs"
+             ((";;") ";"))
+           ;; Remove some generated files.
+           ;; Regenerating the curve25519_tables requires python2 and 
clang-format.
+           (delete-file "third_party/fiat/curve25519_tables.h")
+           (delete-file-recursively "pregenerated")
+           ;; Pretend this isn't a relase tarball.
+           (with-output-to-file ".git"
+             (lambda _
+                (format #t "")))))))
     (arguments
      `(#:cargo-inputs
        (("rust-lazy-static" ,rust-lazy-static-1)
@@ -48981,7 +48995,17 @@ functionality as retain but gives mutable borrow to 
the predicate.")
         ("rust-spin" ,rust-spin-0.5)
         ("rust-untrusted" ,rust-untrusted-0.6)
         ("rust-winapi" ,rust-winapi-0.3)
-        ("rust-cc" ,rust-cc-1))))))
+        ("rust-cc" ,rust-cc-1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'generate-curve25519-tables
+           (lambda _
+             (with-directory-excursion "third_party/fiat"
+               (with-output-to-file "curve25519_tables.h"
+                 (lambda _
+                   (invoke "python" "make_curve25519_tables.py")))))))))
+    (native-inputs
+     (list clang perl python-2))))
 
 (define-public rust-ring-0.13
   (package



reply via email to

[Prev in Thread] Current Thread [Next in Thread]