build/cargo-utils: Remove "src-name" parameter.

* gnu/packages/gnuzilla.scm (icecat)[arguments]<#:phases>
[patch-cargo-checksums]: Delete "null-file" variable.
* gnu/packages/rust.scm (%cargo-reference-project-file): Delete variable.
* gnu/packages/rust.scm (rust-1.19): Remove reference to
"%cargo-reference-project-file".
* guix/build/cargo-utils.scm (generate-checksums): Remove "src-name"
parameter.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Ivan Petkov 2019-04-27 21:39:48 -07:00 committed by Danny Milosavljevic
parent d78010b81e
commit e88735b45f
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
4 changed files with 11 additions and 12 deletions

View File

@ -844,8 +844,7 @@ from forcing GEXP-PROMISE."
(add-after 'patch-source-shebangs 'patch-cargo-checksums (add-after 'patch-source-shebangs 'patch-cargo-checksums
(lambda _ (lambda _
(use-modules (guix build cargo-utils)) (use-modules (guix build cargo-utils))
(let ((null-file "/dev/null") (let ((null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
(null-hash "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"))
(substitute* '("Cargo.lock" "servo/Cargo.lock") (substitute* '("Cargo.lock" "servo/Cargo.lock")
(("(\"checksum .* = )\".*\"" all name) (("(\"checksum .* = )\".*\"" all name)
(string-append name "\"" null-hash "\""))) (string-append name "\"" null-hash "\"")))
@ -856,7 +855,7 @@ from forcing GEXP-PROMISE."
(display (string-append (display (string-append
"patch-cargo-checksums: generate-checksums for " "patch-cargo-checksums: generate-checksums for "
dir "\n")) dir "\n"))
(generate-checksums dir null-file))) (generate-checksums dir)))
(find-files "third_party/rust" ".cargo-checksum.json"))) (find-files "third_party/rust" ".cargo-checksum.json")))
#t)) #t))
(add-before 'configure 'augment-CPLUS_INCLUDE_PATH (add-before 'configure 'augment-CPLUS_INCLUDE_PATH

View File

@ -55,7 +55,6 @@
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (srfi srfi-26)) #:use-module (srfi srfi-26))
(define %cargo-reference-project-file "/dev/null")
(define %cargo-reference-hash (define %cargo-reference-hash
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")
@ -320,7 +319,7 @@ test = { path = \"../libtest\" }
(display (string-append (display (string-append
"patch-cargo-checksums: generate-checksums for " "patch-cargo-checksums: generate-checksums for "
dir "\n")) dir "\n"))
(generate-checksums dir ,%cargo-reference-project-file))) (generate-checksums dir)))
(find-files "src/vendor" ".cargo-checksum.json")) (find-files "src/vendor" ".cargo-checksum.json"))
#t)) #t))
;; This phase is overridden by newer versions. ;; This phase is overridden by newer versions.
@ -973,7 +972,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
(display (string-append (display (string-append
"patch-cargo-checksums: generate-checksums for " "patch-cargo-checksums: generate-checksums for "
dir "\n")) dir "\n"))
(generate-checksums dir ,%cargo-reference-project-file))) (generate-checksums dir)))
(find-files "vendor" ".cargo-checksum.json")) (find-files "vendor" ".cargo-checksum.json"))
#t)) #t))
(add-after 'enable-codegen-tests 'override-jemalloc (add-after 'enable-codegen-tests 'override-jemalloc

View File

@ -131,7 +131,7 @@ directory = '" port)
;; to store paths. ;; to store paths.
(copy-recursively "." rsrc) (copy-recursively "." rsrc)
(touch (string-append rsrc "/.cargo-ok")) (touch (string-append rsrc "/.cargo-ok"))
(generate-checksums rsrc "/dev/null") (generate-checksums rsrc)
(install-file "Cargo.toml" rsrc) (install-file "Cargo.toml" rsrc)
#t)) #t))

View File

@ -41,12 +41,10 @@
(close-pipe port) (close-pipe port)
result))) result)))
(define (generate-checksums dir-name src-name) (define (generate-checksums dir-name)
"Given DIR-NAME, a store directory, checksum all the files in it one "Given DIR-NAME, a store directory, checksum all the files in it one
by one and put the result into the file \".cargo-checksum.json\" in by one and put the result into the file \".cargo-checksum.json\" in
the same directory. Also includes the checksum of an extra file the same directory."
SRC-NAME as if it was part of the directory DIR-NAME with name
\"package\"."
(let* ((file-names (find-files dir-name ".")) (let* ((file-names (find-files dir-name "."))
(dir-prefix-name (string-append dir-name "/")) (dir-prefix-name (string-append dir-name "/"))
(dir-prefix-name-len (string-length dir-prefix-name)) (dir-prefix-name-len (string-length dir-prefix-name))
@ -62,6 +60,9 @@ SRC-NAME as if it was part of the directory DIR-NAME with name
(write file-relative-name port) (write file-relative-name port)
(display ":" port) (display ":" port)
(write (file-sha256 file-name) port))) file-names)) (write (file-sha256 file-name) port))) file-names))
;; NB: cargo requires the "package" field in order to check if the Cargo.lock
;; file needs to be regenerated when the value changes. However, it doesn't
;; appear to care what the value is to begin with...
(display "},\"package\":" port) (display "},\"package\":" port)
(write (file-sha256 src-name) port) (write (file-sha256 "/dev/null") port)
(display "}" port))))) (display "}" port)))))