From 0ba971ef61a195c91e87aa381d5d3b044461b4f6 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 1 Dec 2022 22:08:29 +0000 Subject: [PATCH] feat(tree-sitter): support new --with-tree-sitter configure flag --- Brewfile | 1 + build-emacs-for-macos | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Brewfile b/Brewfile index c6e0c4d..b16d923 100644 --- a/Brewfile +++ b/Brewfile @@ -25,4 +25,5 @@ brew 'nettle' brew 'pkg-config' brew 'sqlite' brew 'texinfo' +brew 'tree-sitter' brew 'zlib' diff --git a/build-emacs-for-macos b/build-emacs-for-macos index d65b191..b4f5d78 100755 --- a/build-emacs-for-macos +++ b/build-emacs-for-macos @@ -250,6 +250,12 @@ class Build @supports_xwidgets ||= !!configure_help.match(/\s+--with-xwidgets\s+/) end + def supports_tree_sitter? + @supports_tree_sitter ||= !!configure_help.match( + /\s+--with-tree-sitter(\s|=).+/ + ) + end + def supports_native_comp? @supports_native_comp ||= !native_comp_configure_flag.nil? end @@ -385,6 +391,9 @@ class Build if options[:xwidgets] && supports_xwidgets? configure_flags << '--with-xwidgets' end + if options[:tree_sitter] && supports_tree_sitter? + configure_flags << '--with-tree-sitter' + end configure_flags << native_comp_configure_flag if options[:native_comp] configure_flags << '--without-rsvg' if options[:rsvg] == false configure_flags << '--without-dbus' if options[:dbus] == false @@ -1243,6 +1252,7 @@ if __FILE__ == $PROGRAM_NAME rsvg: true, dbus: true, xwidgets: true, + tree_sitter: true, github_auth: true, dist_include: ['COPYING'], archive: true, @@ -1278,6 +1288,12 @@ if __FILE__ == $PROGRAM_NAME cli_options[:xwidgets] = v end + opts.on('--[no-]tree-sitter', + 'Enable/disable tree-sitter if supported' \ + '(default: enabled)') do |v| + cli_options[:tree_sitter] = v + end + opts.on('--[no-]native-comp', 'Enable/disable native-comp ' \ '(default: enabled if supported)') do |v|