[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: gnu: rust-ring-0.13: Remove pregenerated files.
From: |
guix-commits |
Subject: |
03/03: gnu: rust-ring-0.13: Remove pregenerated files. |
Date: |
Mon, 13 Mar 2023 08:25:19 -0400 (EDT) |
efraim pushed a commit to branch rust-team
in repository guix.
commit a4f8a4e660ea80e28a02f78de2ffacc42b743d64
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Mon Mar 13 13:32:21 2023 +0200
gnu: rust-ring-0.13: Remove pregenerated files.
* gnu/packages/crates-io.scm (rust-ring-0.13)[source]: Add snippet to
remove pregenerated files and add a fake .git directory.
[inherit]: Inherit from rust-ring-0.14.
[arguments]: Add a phase to generate the curve25519 tables.
---
gnu/packages/crates-io.scm | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 7266cd087c..8da0797295 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -49009,7 +49009,7 @@ functionality as retain but gives mutable borrow to the
predicate.")
(define-public rust-ring-0.13
(package
- (inherit rust-ring-0.16)
+ (inherit rust-ring-0.14)
(name "rust-ring")
(version "0.13.5")
(source
@@ -49018,15 +49018,36 @@ functionality as retain but gives mutable borrow to
the predicate.")
(uri (crate-uri "ring" version))
(file-name (string-append name "-" version ".tar.gz"))
(sha256
- (base32 "12j580by6a438i5mw3136cj3lxylywymdr5p8rqlkwrm5s5bck9c"))))
- (build-system cargo-build-system)
+ (base32 "12j580by6a438i5mw3136cj3lxylywymdr5p8rqlkwrm5s5bck9c"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; error: `...` range patterns are deprecated
+ (substitute* "src/digest/sha1.rs"
+ (("0\\.\\.\\.") "0..="))
+ ;; Remove some generated files.
+ (delete-file-recursively "pregenerated")
+ ;; Regenerating the curve25519_tables requires python2 and
clang-format.
+ (delete-file "third_party/fiat/curve25519_tables.h")
+ ;; 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)
("rust-libc" ,rust-libc-0.2)
("rust-untrusted" ,rust-untrusted-0.6)
;; build dependencies
- ("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")))))))))))
(define-public rust-riscv-0.7
(package