From 3e63d41ba196d19e8c4f82b34099b7653682f728 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Fri, 23 Jun 2023 21:53:12 +0200 Subject: [PATCH 1/2] Add support for berkeley-unix (seen on NetBSD) --- core/tsc-dyn-get.el | 2 +- lisp/tree-sitter-load.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tsc-dyn-get.el b/core/tsc-dyn-get.el index 35fecc80..e1e44c96 100644 --- a/core/tsc-dyn-get.el +++ b/core/tsc-dyn-get.el @@ -72,7 +72,7 @@ this to nil." (pcase system-type ('windows-nt "dll") ('darwin "dylib") - ((or 'gnu 'gnu/linux 'gnu/kfreebsd) "so") + ((or 'gnu 'gnu/linux 'gnu/kfreebsd 'berkeley-unix) "so") ((or 'ms-dos 'cygwin) (error "Unsupported system-type %s" system-type)) (_ "so"))) diff --git a/lisp/tree-sitter-load.el b/lisp/tree-sitter-load.el index 95114506..11102755 100644 --- a/lisp/tree-sitter-load.el +++ b/lisp/tree-sitter-load.el @@ -32,7 +32,7 @@ See `tree-sitter-require'.") (pcase system-type ;; The CLI tool outputs `.so', but `.dylib' is more sensible on macOS. ('darwin (list ".dylib" ".so")) - ('gnu/linux (list ".so")) + ((or 'gnu 'gnu/linux 'gnu/kfreebsd 'berkeley-unix) "so") ('windows-nt (list ".dll")) (_ (error "Unsupported system-type %s" system-type))) "List of suffixes for shared libraries that define tree-sitter languages.") From 27b5548174d35404f290b9e66347b71ce505f3b3 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Fri, 23 Jun 2023 21:53:28 +0200 Subject: [PATCH 2/2] Handle NetBSD like Linux in build. --- bin/env.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/env.bash b/bin/env.bash index d48f4561..ec156ebc 100644 --- a/bin/env.bash +++ b/bin/env.bash @@ -1,7 +1,7 @@ set -euo pipefail system=$(uname) -if [[ $system == "Linux" ]]; then +if [[ $system == "Linux" ]] || [[ $system == "NetBSD" ]]; then ext="so" elif [[ $system == "Darwin" ]]; then ext="dylib"