(ziclh lang rust): use compile-time path for yj
This will have to be replaced with a small Rust program, but I don't want to resolve the chicken-egg problem right now.
This commit is contained in:
parent
cb046ea859
commit
307b1c7218
4 changed files with 8 additions and 4 deletions
|
|
@ -44,10 +44,11 @@
|
|||
|
||||
(begin
|
||||
(define linker (delay (let ((v (cdr (assoc "out" (nixpkgs "gcc"))))) #~,(string-append #$v "/bin/cc"))))
|
||||
(define yj-path (foreign-value "YJ_PATH" nonnull-c-string))
|
||||
|
||||
;; Shell out to a TOML-to-JSON parser. This will be replaced with a Nix-native solution later(tm).
|
||||
(define (parse-toml toml-to-parse)
|
||||
(define-values (read-port write-port pid) (process "yj" '("yj" "-tj")))
|
||||
(define-values (read-port write-port pid) (process yj-path '("yj" "-tj")))
|
||||
(write-string toml-to-parse write-port)
|
||||
(close-output-port write-port)
|
||||
(define parsed (json-read read-port))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue