(zilch lang rust cargo): workaround non-VFS'd crates
This will be unhacked once a (vfs-from-store) exists.
This commit is contained in:
parent
d1800e8a9d
commit
a5a59ea9e8
1 changed files with 8 additions and 3 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
(zilch nixpkgs) (zilch zexpr) (zilch semver)
|
(zilch nixpkgs) (zilch zexpr) (zilch semver)
|
||||||
json
|
json
|
||||||
(chicken process)
|
(chicken process)
|
||||||
(chicken base) (chicken format)
|
(chicken base) (chicken format) (chicken file)
|
||||||
(chicken foreign)
|
(chicken foreign)
|
||||||
(srfi 4) (srfi 128) (srfi 146) (srfi 152) (srfi 207)
|
(srfi 4) (srfi 128) (srfi 146) (srfi 152) (srfi 207)
|
||||||
(zilch lang rust registry) (zilch lang rust) (zilch lang rust cfg)
|
(zilch lang rust registry) (zilch lang rust) (zilch lang rust cfg)
|
||||||
|
|
@ -333,7 +333,9 @@
|
||||||
(define package-version (cdr (assoc "version" package)))
|
(define package-version (cdr (assoc "version" package)))
|
||||||
(define package-links (and-cdr (assoc "links" package)))
|
(define package-links (and-cdr (assoc "links" package)))
|
||||||
(define package-edition (or (and-cdr (assoc "edition" package)) "2015"))
|
(define package-edition (or (and-cdr (assoc "edition" package)) "2015"))
|
||||||
|
|
||||||
|
(define has-build (and (zexp? vfs) (file-exists? (string-append (zexp-unquote vfs) "/build.rs"))))
|
||||||
|
|
||||||
(unless (and vfs (vfs? vfs))
|
(unless (and vfs (vfs? vfs))
|
||||||
(set! vfs #f))
|
(set! vfs #f))
|
||||||
|
|
||||||
|
|
@ -347,7 +349,10 @@
|
||||||
(set! other-targets (cons (cargo-target-from-toml (vector (cons "name" package-name) (cons "path" "src/main.rs")) package-name 'bin package-edition) other-targets)))
|
(set! other-targets (cons (cargo-target-from-toml (vector (cons "name" package-name) (cons "path" "src/main.rs")) package-name 'bin package-edition) other-targets)))
|
||||||
|
|
||||||
(define build-file-path (and-cdr (assoc "build" package)))
|
(define build-file-path (and-cdr (assoc "build" package)))
|
||||||
(when (and vfs (vfs-file-ref vfs "" "build.rs")))
|
(when
|
||||||
|
(or
|
||||||
|
(and has-build (not build-file-path))
|
||||||
|
(and vfs (vfs-file-ref vfs "" "build.rs")))
|
||||||
(set! build-file-path "build.rs"))
|
(set! build-file-path "build.rs"))
|
||||||
(define build-script-target #f)
|
(define build-script-target #f)
|
||||||
(when build-file-path
|
(when build-file-path
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue