Compare commits

..

4 Commits

Author SHA1 Message Date
138ac74ba5 chore(release): 0.6.37 2022-12-01 22:09:38 +00:00
0ba971ef61 feat(tree-sitter): support new --with-tree-sitter configure flag 2022-12-01 22:08:29 +00:00
1ae8771b2c chore(release): 0.6.36 2022-10-08 14:41:30 +01:00
1f2868d4b3 fix(native-comp): support new configure flag format
Commit e245c4f226979ccb717cccc8f82b2b0a0f96bdac on Emacs' master branch
added support for optional flags to the --with-native-compilation
configure flag.

This change to output of ./configure --help broke the native comp
detection present in our build script.

This change adds support for the new configure flag format, while also
using it to specify AOT when enabled.

It is still backwards compatible with the configure script in older
commits.

Fixes #76
2022-10-08 14:38:37 +01:00
3 changed files with 62 additions and 7 deletions

View File

@@ -25,4 +25,5 @@ brew 'nettle'
brew 'pkg-config'
brew 'sqlite'
brew 'texinfo'
brew 'tree-sitter'
brew 'zlib'

View File

@@ -2,6 +2,20 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [0.6.37](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.36...v0.6.37) (2022-12-01)
### Features
* **tree-sitter:** support new --with-tree-sitter configure flag ([0ba971e](https://github.com/jimeh/build-emacs-for-macos/commit/0ba971ef61a195c91e87aa381d5d3b044461b4f6))
### [0.6.36](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.35...v0.6.36) (2022-10-08)
### Bug Fixes
* **native-comp:** support new configure flag format ([1f2868d](https://github.com/jimeh/build-emacs-for-macos/commit/1f2868d4b3784e906665e9f3b6b9bba8fd72292f)), closes [#76](https://github.com/jimeh/build-emacs-for-macos/issues/76)
### [0.6.35](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.34...v0.6.35) (2022-08-10)

View File

@@ -250,14 +250,40 @@ 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
def native_comp_configure_match
@native_comp_configure_match ||= configure_help.match(
/\s+?(--with-native(?:comp|-compilation))(.+)?\s+?/
)
end
def native_comp_configure_flag
@native_comp_configure_flag ||= configure_help.match(
/\s+(--with-native(?:comp|-compilation))\s+/
)&.[](1)
return @native_comp_configure_flag if @native_comp_configure_flag
return unless native_comp_configure_match&.[](1)
@native_comp_configure_flag = [
native_comp_configure_match[1],
native_comp_configure_flag_arg
].compact.join('=')
end
def native_comp_configure_flag_arg
return @native_comp_configure_flag_arg if @native_comp_configure_flag_arg
return if native_comp_configure_match&.[](2) != '[=TYPE]'
@native_comp_configure_flag_arg = \
(options[:native_full_aot] ? 'aot' : 'yes')
end
def detect_native_comp
@@ -365,11 +391,14 @@ 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
run_cmd './configure', *configure_flags
run_cmd './configure', *configure_flags.compact
# Disable aligned_alloc on Mojave and below. See issue:
# https://github.com/daviderestivo/homebrew-emacs-head/issues/15
@@ -386,8 +415,12 @@ class Build
make_flags << "BYTE_COMPILE_EXTRA_FLAGS=--eval '(setq comp-speed 2)'"
if options[:native_full_aot]
info 'Using NATIVE_FULL_AOT=1'
make_flags << 'NATIVE_FULL_AOT=1'
info 'Using native compile full AOT'
# We do not need to supply the full AOT make arg if
# --with-native-compilation=aot configure flag is supported.
unless native_comp_configure_flag_arg
make_flags << 'NATIVE_FULL_AOT=1'
end
ENV.delete('NATIVE_FAST_BOOT')
else
ENV.delete('NATIVE_FULL_AOT')
@@ -395,7 +428,7 @@ class Build
end
end
run_cmd 'make', *make_flags
run_cmd 'make', *make_flags.compact
run_cmd 'make', 'install'
end
@@ -1219,6 +1252,7 @@ if __FILE__ == $PROGRAM_NAME
rsvg: true,
dbus: true,
xwidgets: true,
tree_sitter: true,
github_auth: true,
dist_include: ['COPYING'],
archive: true,
@@ -1254,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|