Subject: Re: [bug#49946] [PATCH v7 28/32] gnu: Add rust-tree-sitter.

From: "(" <[email-masked]>
Date: Fri, 25 Nov 2022 07:11:02 +0000

On Fri Nov 25, 2022 at 1:21 AM GMT, Pierre Langlois wrote:
> * gnu/packages/tree-sitter.scm (rust-tree-sitter): New variable.

> --- a/gnu/packages/tree-sitter.scm
> +++ b/gnu/packages/tree-sitter.scm

> @@ -158,6 +159,43 @@ (define-public tree-sitter-cli

> +               '(begin
> +                  ;; Remove the runtime library code and dynamically link to
> +                  ;; it instead.
> +                  (delete-file-recursively "src")
> +                  (delete-file "binding_rust/build.rs")
> +                  (with-output-to-file "binding_rust/build.rs"
> +                    (lambda _
> +                      (format #t "fn main() {~@
> +                              println!(\"cargo:rustc-link-lib=tree-sitter\");~@
> +                              }~%")))
> +                  #t))))

Maybe you should actually extract *this* snippet, as you also use
it with tree-sitter-cli?

> +    (arguments
> +     `(#:cargo-inputs
> +       (("rust-cc" ,rust-cc-1)
> +        ("rust-lazy-static" ,rust-lazy-static-1)
> +        ("rust-regex" ,rust-regex-1))))

(list ...) please.

    -- (