mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-02 08:07:29 +01:00
gnu: rust-ring-0.14: Build source using trivial-build-system.
This removes this use of computed-origin-method. * gnu/packages/crates-crypto.scm (rust-ring-0.14-sources): Replace use of computed-origin-method with an actual package. Change-Id: Ice40161411828b88321509a1cf5b07a6553f0ce7
This commit is contained in:
parent
7db675130f
commit
57be7a0184
1 changed files with 173 additions and 172 deletions
|
@ -4617,45 +4617,25 @@ (define-public rust-ring-0.16
|
|||
(supported-systems (list "aarch64-linux" "armhf-linux"
|
||||
"i686-linux" "x86_64-linux"))))
|
||||
|
||||
(define computed-origin-method (@@ (guix packages) computed-origin-method))
|
||||
(define rust-ring-0.14-sources
|
||||
(let* ((version "0.14.6")
|
||||
(upstream-source
|
||||
(origin
|
||||
(package
|
||||
(inherit rust-ring-0.17-sources)
|
||||
(name "rust-ring")
|
||||
(version "0.14.6.tar.gz") ; Hack to adjust the output name.
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/briansmith/ring")
|
||||
(commit "ef85df478152aa3fe06c811309379efa08f8a529")))
|
||||
(file-name (git-file-name "rust-ring" version))
|
||||
(sha256
|
||||
(base32 "12dgw2spvmkdypgzymw3bxpv4bbpnlq8s10sdggral31x597n6xx")))))
|
||||
(origin
|
||||
(method computed-origin-method)
|
||||
(file-name (string-append "rust-ring-" version ".tar.gz"))
|
||||
(sha256 #f)
|
||||
(uri
|
||||
(delay
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(set-path-environment-variable
|
||||
"PATH" '("bin")
|
||||
(list #+(canonical-package gzip)
|
||||
#+(canonical-package tar)
|
||||
#+perl
|
||||
#+yasm
|
||||
#+go
|
||||
#+clang ; clang-format
|
||||
#+python2-minimal))
|
||||
(setenv "HOME" (getcwd))
|
||||
(copy-recursively #+upstream-source
|
||||
(string-append "ring-" #$version))
|
||||
(with-directory-excursion (string-append "ring-" #$version)
|
||||
(begin
|
||||
(base32 "12dgw2spvmkdypgzymw3bxpv4bbpnlq8s10sdggral31x597n6xx"))
|
||||
(snippet
|
||||
#~(begin (use-modules (guix build utils))
|
||||
;; It turns out Guix's yasm works just fine here.
|
||||
(substitute* "build.rs"
|
||||
(("yasm.exe") "yasm"))
|
||||
;; Files which would be deleted in a snippet:
|
||||
;; These files are pregenerated:
|
||||
(delete-file "third_party/fiat/curve25519_tables.h")
|
||||
(delete-file "crypto/fipsmodule/ec/ecp_nistz256_table.inl")
|
||||
(delete-file "util/ar/testdata/linux/libsample.a")
|
||||
|
@ -4663,10 +4643,28 @@ (define rust-ring-0.14-sources
|
|||
(delete-file "util/ar/testdata/windows/sample.lib")
|
||||
;; Fix the doc tests.
|
||||
(substitute* "src/ec/curve25519/ed25519/verification.rs"
|
||||
((";;") ";"))
|
||||
;; Files to be generated in the sources:
|
||||
(format #t "Generating the missing files ...~%")
|
||||
(force-output)
|
||||
((";;") ";"))))))
|
||||
(arguments
|
||||
(list
|
||||
#:modules '((guix build utils))
|
||||
#:builder
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(setenv "PATH"
|
||||
(string-join
|
||||
(list #+(this-package-native-input "clang") ; for clang-format
|
||||
#+(this-package-native-input "go")
|
||||
#+(this-package-native-input "gzip")
|
||||
#+(this-package-native-input "perl")
|
||||
#+(this-package-native-input "python2-minimal")
|
||||
#+(this-package-native-input "tar")
|
||||
#+(this-package-native-input "yasm"))
|
||||
"/bin:" 'suffix))
|
||||
|
||||
(setenv "HOME" (getcwd))
|
||||
(copy-recursively #+source (string-append "ring-" #$version))
|
||||
(with-directory-excursion (string-append "ring-" #$version)
|
||||
(begin
|
||||
(with-directory-excursion "third_party/fiat"
|
||||
(with-output-to-file "curve25519_tables.h"
|
||||
(lambda _ (invoke "python" "make_curve25519_tables.py"))))
|
||||
|
@ -4690,8 +4688,7 @@ (define (prefix script)
|
|||
(string-append
|
||||
"pregenerated/"
|
||||
(string-drop-right
|
||||
(string-drop script
|
||||
(string-index-right script #\/)) 3)))
|
||||
(string-drop script (string-index-right script #\/)) 3)))
|
||||
|
||||
(for-each
|
||||
(lambda (script)
|
||||
|
@ -4808,7 +4805,10 @@ (define (prefix script)
|
|||
;; avoid non-determinism in the archive
|
||||
"--sort=name" "--mtime=@0"
|
||||
"--owner=root:0" "--group=root:0"
|
||||
(string-append "ring-" #$version))))))))))))
|
||||
(string-append "ring-" #$version))))))))
|
||||
(native-inputs
|
||||
(list clang go gzip perl python2-minimal tar yasm))))
|
||||
|
||||
(define-public rust-ring-0.14
|
||||
(package
|
||||
(inherit rust-ring-0.16)
|
||||
|
@ -4824,6 +4824,7 @@ (define-public rust-ring-0.14
|
|||
("rust-untrusted" ,rust-untrusted-0.6)
|
||||
("rust-winapi" ,rust-winapi-0.3))))))
|
||||
|
||||
(define computed-origin-method (@@ (guix packages) computed-origin-method))
|
||||
(define rust-ring-0.13-sources
|
||||
(let* ((version "0.13.5")
|
||||
(upstream-source
|
||||
|
|
Loading…
Reference in a new issue