mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build/cargo: Don't vendor self.
* guix/build/cargo-build-system.scm (crate-src?, configure): Exclude self. * gnu/packages/gnome.scm (librsvg)[#:phases]: Remove ‘dont-vendor-self’. * gnu/packages/python-crypto.scm (python-cryptography)[#:arguments]: Likewise. * gnu/packages/python-xyz.scm (python-libcst)[#:arguments]: Likewise. * gnu/packages/syndication.scm (newsboat)[#:arguments]: Likewise. * gnu/packages/antivirus.scm (clamav)[#:arguments]: Likewise. Change-Id: I5e01721fb705937f5fcf858c21b6d7e27ade6c10
This commit is contained in:
parent
a087db5f83
commit
9ba78f3ccf
6 changed files with 23 additions and 45 deletions
|
@ -116,10 +116,7 @@
|
||||||
(add-after 'configure 'fix-cargo-inputs-vendoring
|
(add-after 'configure 'fix-cargo-inputs-vendoring
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Reproduce the original layout, fails with config.
|
;; Reproduce the original layout, fails with config.
|
||||||
(rename-file ".cargo/config" ".cargo/config.toml")
|
(rename-file ".cargo/config" ".cargo/config.toml")))
|
||||||
;; Wrongly placed by configure
|
|
||||||
(delete-file-recursively
|
|
||||||
(string-append ".cargo/vendor/clamav-" #$version ".tar.zst"))))
|
|
||||||
(add-after 'patch-cargo-checksums 'cmake-configure
|
(add-after 'patch-cargo-checksums 'cmake-configure
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
((assoc-ref cmake:%standard-phases 'configure)
|
((assoc-ref cmake:%standard-phases 'configure)
|
||||||
|
|
|
@ -3807,11 +3807,6 @@ for dealing with different structured file formats.")
|
||||||
"--host=" #$(%current-target-system)))
|
"--host=" #$(%current-target-system)))
|
||||||
#~("--enable-vala")))
|
#~("--enable-vala")))
|
||||||
args)))
|
args)))
|
||||||
(add-after 'configure 'dont-vendor-self
|
|
||||||
(lambda* (#:key vendor-dir #:allow-other-keys)
|
|
||||||
;; Don't keep the whole tarball in the vendor directory
|
|
||||||
(delete-file-recursively
|
|
||||||
(string-append vendor-dir "/" #$name "-" #$version ".tar.xz"))))
|
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(assoc-ref gnu:%standard-phases 'build))
|
(assoc-ref gnu:%standard-phases 'build))
|
||||||
(replace 'check
|
(replace 'check
|
||||||
|
|
|
@ -561,11 +561,6 @@ is used by the Requests library to verify HTTPS requests.")
|
||||||
#:install-source? #false
|
#:install-source? #false
|
||||||
#:phases
|
#:phases
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-after 'configure 'dont-vendor-self
|
|
||||||
(lambda* (#:key vendor-dir #:allow-other-keys)
|
|
||||||
;; Don't keep the whole tarball in the vendor directory
|
|
||||||
(delete-file-recursively
|
|
||||||
(string-append vendor-dir "/cryptography-" #$version ".tar.zst"))))
|
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(assoc-ref py:%standard-phases 'build))
|
(assoc-ref py:%standard-phases 'build))
|
||||||
(delete 'check)
|
(delete 'check)
|
||||||
|
|
|
@ -23742,11 +23742,6 @@ members = [
|
||||||
(add-after 'unpack 'prepare-source
|
(add-after 'unpack 'prepare-source
|
||||||
(lambda _
|
(lambda _
|
||||||
(delete-file "native/Cargo.lock")))
|
(delete-file "native/Cargo.lock")))
|
||||||
(add-after 'configure 'dont-vendor-self
|
|
||||||
(lambda* (#:key vendor-dir #:allow-other-keys)
|
|
||||||
;; Don't keep the whole tarball in the vendor directory
|
|
||||||
(delete-file-recursively
|
|
||||||
(string-append vendor-dir "/libcst-" #$version ".tar.zst"))))
|
|
||||||
(replace 'build
|
(replace 'build
|
||||||
(assoc-ref py:%standard-phases 'build))
|
(assoc-ref py:%standard-phases 'build))
|
||||||
(add-after 'install 'wrap
|
(add-after 'install 'wrap
|
||||||
|
|
|
@ -312,11 +312,6 @@ cards.")
|
||||||
(("if curl-config")
|
(("if curl-config")
|
||||||
(string-append
|
(string-append
|
||||||
"if " (search-input-file inputs "/bin/curl-config"))))))
|
"if " (search-input-file inputs "/bin/curl-config"))))))
|
||||||
(add-after 'configure 'dont-vendor-self
|
|
||||||
(lambda* (#:key vendor-dir #:allow-other-keys)
|
|
||||||
;; Don't keep the whole tarball in the vendor directory
|
|
||||||
(delete-file-recursively
|
|
||||||
(string-append vendor-dir "/" #$name "-" #$version ".tar.xz"))))
|
|
||||||
(add-after 'unpack 'patch-source
|
(add-after 'unpack 'patch-source
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(substitute* "Makefile"
|
(substitute* "Makefile"
|
||||||
|
|
|
@ -71,27 +71,28 @@ root package."
|
||||||
(call-with-input-file manifest-file get-string-all)
|
(call-with-input-file manifest-file get-string-all)
|
||||||
"[package]"))))
|
"[package]"))))
|
||||||
|
|
||||||
(define (crate-src? path)
|
(define* (crate-src? path #:key source)
|
||||||
"Check if PATH refers to a crate source, namely a gzipped tarball with a
|
"Check if PATH refers to a crate source, namely a gzipped tarball with a
|
||||||
Cargo.toml file present at its root."
|
Cargo.toml file present at its root."
|
||||||
(if (directory-exists? path)
|
(and (not (string=? path source)) ;Exclude self.
|
||||||
;; The build system only handles sources containing single crate.
|
(if (directory-exists? path)
|
||||||
;; Workspaces should be packaged into crates (via 'package phase)
|
;; The build system only handles sources containing single crate.
|
||||||
;; and used in inputs.
|
;; Workspaces should be packaged into crates (via 'package phase)
|
||||||
(cargo-package? path)
|
;; and used in inputs.
|
||||||
(and (not (string-suffix? "py" path)) ;sanity-check.py
|
(cargo-package? path)
|
||||||
;; First we print out all file names within the tarball to see
|
(and (not (string-suffix? "py" path)) ;sanity-check.py
|
||||||
;; if it looks like the source of a crate. However, the tarball
|
;; First we print out all file names within the tarball to see
|
||||||
;; will include an extra path component which we would like to
|
;; if it looks like the source of a crate. However, the tarball
|
||||||
;; ignore (since we're interested in checking if a Cargo.toml
|
;; will include an extra path component which we would like to
|
||||||
;; exists at the root of the archive, but not nested anywhere
|
;; ignore (since we're interested in checking if a Cargo.toml
|
||||||
;; else). We do this by cutting up each output line and only
|
;; exists at the root of the archive, but not nested anywhere
|
||||||
;; looking at the second component. We then check if it matches
|
;; else). We do this by cutting up each output line and only
|
||||||
;; Cargo.toml exactly and short circuit if it does.
|
;; looking at the second component. We then check if it matches
|
||||||
(invoke "sh" "-c"
|
;; Cargo.toml exactly and short circuit if it does.
|
||||||
(string-append "tar -tf " path
|
(invoke "sh" "-c"
|
||||||
" | cut -d/ -f2"
|
(string-append "tar -tf " path
|
||||||
" | grep -q '^Cargo.toml$'")))))
|
" | cut -d/ -f2"
|
||||||
|
" | grep -q '^Cargo.toml$'"))))))
|
||||||
|
|
||||||
(define* (unpack-rust-crates #:key inputs (vendor-dir "guix-vendor")
|
(define* (unpack-rust-crates #:key inputs (vendor-dir "guix-vendor")
|
||||||
#:allow-other-keys)
|
#:allow-other-keys)
|
||||||
|
@ -156,7 +157,7 @@ libraries or executables."
|
||||||
(format #t "error: Possible pre-generated file found: ~a~%" file)))
|
(format #t "error: Possible pre-generated file found: ~a~%" file)))
|
||||||
(find-files "." (negate empty-file?)))))
|
(find-files "." (negate empty-file?)))))
|
||||||
|
|
||||||
(define* (configure #:key inputs
|
(define* (configure #:key source inputs
|
||||||
target system
|
target system
|
||||||
(cargo-target #f)
|
(cargo-target #f)
|
||||||
(vendor-dir "guix-vendor")
|
(vendor-dir "guix-vendor")
|
||||||
|
@ -173,7 +174,7 @@ libraries or executables."
|
||||||
((name . path)
|
((name . path)
|
||||||
(let* ((basepath (strip-store-file-name path))
|
(let* ((basepath (strip-store-file-name path))
|
||||||
(crate-dir (string-append vendor-dir "/" basepath)))
|
(crate-dir (string-append vendor-dir "/" basepath)))
|
||||||
(and (crate-src? path)
|
(and (crate-src? path #:source source)
|
||||||
;; Gracefully handle duplicate inputs
|
;; Gracefully handle duplicate inputs
|
||||||
(not (file-exists? crate-dir))
|
(not (file-exists? crate-dir))
|
||||||
(if (directory-exists? path)
|
(if (directory-exists? path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue