[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49946] [PATCH v7 30/32] gnu: Add emacs-tree-sitter-core.
From: |
( |
Subject: |
[bug#49946] [PATCH v7 30/32] gnu: Add emacs-tree-sitter-core. |
Date: |
Fri, 25 Nov 2022 07:22:54 +0000 |
On Fri Nov 25, 2022 at 1:21 AM GMT, Pierre Langlois wrote:
> * gnu/packages/tree-sitter.scm (tree-sitter-emacs-module): New local variable.
> (emacs-tree-sitter-core): New variable.
Please split these two into separate patches.
> --- a/gnu/packages/tree-sitter.scm
> +++ b/gnu/packages/tree-sitter.scm
> @@ -738,3 +739,86 @@ (define-public tree-sitter-typescript
> + (arguments
> + `(#:cargo-inputs
(list #:cargo-inputs
...)
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'chdir
> + (lambda _ (chdir "core")))
> + (add-after 'chdir 'delete-cargo.lock
> + (lambda _ (delete-file "Cargo.lock")))
> + (add-after 'delete-cargo.lock 'do-not-fetch-from-github
> + (lambda _
> + (substitute* "Cargo.toml"
> + (("\\[patch.*") "")
> + (("git = .*") ""))))
> + (replace 'install
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
> + (mkdir-p lib)
> + (copy-file "target/release/libtsc_dyn.so"
> + (string-append lib "/tsc-dyn.so"))))))))
Please use gexps and #$output here:
(replace 'install
(lambda _
(let ((lib (string-append #$output "/lib")))
(mkdir-p lib)
(copy-file "target/release/libtsc_dyn.so"
(string-append lib "/tsc-dyn.so")))))
> + (name "emacs-tree-sitter-core")
> + (version (package-version tree-sitter-emacs-module))
> + (source (package-source tree-sitter-emacs-module))
This ``version'' and ``source'' are unnecessary.
> + (arguments
> + `(#:phases
LIST, please.
> + (modify-phases %standard-phases
Gexp this, please.
> + (let ((elpa (elpa-directory (assoc-ref outputs "out")))
Please use #$output.
> + (module (search-input-file inputs "/lib/tsc-dyn.so")))
The leading / is redundant; this will do:
(search-input-file inputs "lib/tsc-dyn.so")
-- (
- [bug#49946] [PATCH v7 28/32] gnu: Add rust-tree-sitter., (continued)
- [bug#49946] [PATCH v7 16/32] gnu: Add tree-sitter-html., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 21/32] gnu: Add tree-sitter-ocaml., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 25/32] gnu: Add tree-sitter-ruby., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 31/32] gnu: Add emacs-tree-sitter., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 30/32] gnu: Add emacs-tree-sitter-core., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 32/32] gnu: Add emacs-tree-sitter-langs., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 26/32] gnu: Add tree-sitter-rust., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 20/32] gnu: Add tree-sitter-julia., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 24/32] gnu: Add tree-sitter-r., Pierre Langlois, 2022/11/24
- [bug#49946] [PATCH v7 22/32] gnu: Add tree-sitter-php., Pierre Langlois, 2022/11/24