guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#49946] [PATCH 00/31] Tree-sitter, node-gyp addon support and emacs-


From: zimoun
Subject: [bug#49946] [PATCH 00/31] Tree-sitter, node-gyp addon support and emacs-tree-sitter
Date: Tue, 07 Feb 2023 12:25:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi,

Sorry, I have totally overlooked this tree-sitter story. :-) And I have
not read all the patch versions and thread yet.


On Fri, 25 Nov 2022 at 01:57, Pierre Langlois <pierre.langlois@gmx.com> wrote:

> +(define* (install #:key target grammar-directories outputs 
> #:allow-other-keys)
> +  (let ((lib (string-append (assoc-ref outputs "out")
> +                            "/lib/tree-sitter")))
> +    (mkdir-p lib)
> +    (define (compile-language dir)
> +      (with-directory-excursion dir
> +        (let ((lang (assoc-ref (call-with-input-file "src/grammar.json"
> +                                 read-json)
> +                               "name"))
> +              (source-file (lambda (path)
> +                             (if (file-exists? path)
> +                                 path
> +                                 #f))))
> +          (apply invoke
> +                 `(,(if target
> +                        (string-append target "-g++")
> +                        "g++")

Why is g++ required?  Is gcc not enough?  I thought from Tree-sitter
documentation that it was only using C files and not C++; but…

> +                   "-shared"
> +                   "-fPIC"
> +                   "-fno-exceptions"
> +                   "-O2"
> +                   "-g"
> +                   "-o" ,(string-append lib "/" lang ".so")
> +                   ;; An additional `scanner.{c,cc}' file is sometimes
> +                   ;; provided.
> +                   ,@(cond
> +                      ((source-file "src/scanner.c")
> +                       => (lambda (file) (list "-xc" "-std=c99" file)))
> +                      ((source-file "src/scanner.cc")

…apparently not.


Cheers,
simon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]