Compare commits

...

23 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
bfa5bcf79b chore(release): 0.6.35 2022-08-10 16:48:24 +01:00
02d85f899f Merge pull request #75 from jimeh/fix-libgccjit12-compatibility
fix(native-comp): compatibility with libgccjit 12 homebrew formula
2022-08-10 16:46:45 +01:00
aeb3a75e5c chore(patch): minor simplification to libgccjit patches
By matching more targeted sets of strings, it should hopefully make
these patches more future-proof.
2022-08-10 16:31:51 +01:00
Alice Rum
e0fd2b16eb fix(native-comp): compatibility with libgccjit 12 homebrew formula
Since the latest update of `libgccjit` in brew to version 12, emacs does
not build again. Problem is that now dylib exists in multiple locations,
and `MAC_CFLAGS` environment variable is not filled correctly in
`configure.ac`. This commit fixes the issue.
2022-08-10 16:30:10 +01:00
d24ac084b7 chore(release): 0.6.34 2022-07-27 23:25:28 +01:00
159a7333de Merge pull request #73 from jimeh/fix-emacs-28
fix(emacs-28): patch configure.ac to support latest libgccjit
2022-07-27 23:23:39 +01:00
b582523642 fix(emacs-28): patch configure.ac to support latest libgccjit
When building Emacs 28.x the build script will attempt to patch
configure.ac if needed to support the latest version of libgccjit which
renamed libgccjit.so to libgccjit.dylib.

Fixes #72
2022-07-27 23:18:58 +01:00
4f1e748df2 chore(release): 0.6.33 2022-04-30 19:37:01 +01:00
d984633991 chore(deps): update gon package to 0.2.5 2022-04-30 19:35:21 +01:00
616f74d624 chore(release): 0.6.32 2022-04-30 17:46:51 +01:00
d7963b7664 chore(helper): minor tweak to emacs helper launch script 2022-04-30 17:46:06 +01:00
a20a8456ab feat(deps): add sqlite brew dependency for Emacs 29.x 2022-04-30 17:45:21 +01:00
8ad3ff4f53 feat(dbus): add flag to explicitly disable dbus support
Fixes #69
2022-04-30 17:27:41 +01:00
e31f5aaf93 fix(native-comp): support libgccjit 11.3.0
The libgccjit shared library file was renamed from libgccjit.so to
libgccjit.0.dylib in 11.3.0.

Fixes #71
2022-04-30 17:13:50 +01:00
c2fb07fdb8 chore(release): 0.6.31 2022-02-25 10:33:12 +00:00
07e0e3dacd fix: set source-directory correctly
Fixes #68
2022-02-25 10:32:03 +00:00
efddb9ef92 chore(release): 0.6.30 2022-02-08 03:07:18 +00:00
f7f4c0433a Merge pull request #66 from jimeh/add-homebrew-site-lisp-path 2022-02-08 03:05:31 +00:00
cbd8cb27b6 fix(site-lisp): add Homebrew's site-lisp directory to locallisppath
This should allow mu4e to be loaded from the mu homebrew package, among
other homebrew packages that provides emacs site-lisp files.

Ref: https://github.com/jimeh/emacs-builds/issues/19
2022-02-08 00:44:09 +00:00
6 changed files with 164 additions and 16 deletions

View File

@@ -23,5 +23,7 @@ brew 'make'
brew 'ncurses'
brew 'nettle'
brew 'pkg-config'
brew 'sqlite'
brew 'texinfo'
brew 'tree-sitter'
brew 'zlib'

View File

@@ -2,6 +2,63 @@
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)
### Bug Fixes
* **native-comp:** compatibility with libgccjit 12 homebrew formula ([e0fd2b1](https://github.com/jimeh/build-emacs-for-macos/commit/e0fd2b16eb91ac5a98ed4ec31f4773ab22cbd470))
### [0.6.34](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.33...v0.6.34) (2022-07-27)
### Bug Fixes
* **emacs-28:** patch configure.ac to support latest libgccjit ([b582523](https://github.com/jimeh/build-emacs-for-macos/commit/b582523642ad4c5298f5a7890edd9b48c0433684)), closes [#72](https://github.com/jimeh/build-emacs-for-macos/issues/72)
### [0.6.33](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.32...v0.6.33) (2022-04-30)
### [0.6.32](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.31...v0.6.32) (2022-04-30)
### Features
* **dbus:** add flag to explicitly disable dbus support ([8ad3ff4](https://github.com/jimeh/build-emacs-for-macos/commit/8ad3ff4f53505408aa097527177032a1fd6008e0)), closes [#69](https://github.com/jimeh/build-emacs-for-macos/issues/69)
* **deps:** add sqlite brew dependency for Emacs 29.x ([a20a845](https://github.com/jimeh/build-emacs-for-macos/commit/a20a8456ab1e8de6357d5d121b9565ba65a6dd71))
### Bug Fixes
* **native-comp:** support libgccjit 11.3.0 ([e31f5aa](https://github.com/jimeh/build-emacs-for-macos/commit/e31f5aaf9355b674c2a86b8eda35f6513f344b72)), closes [#71](https://github.com/jimeh/build-emacs-for-macos/issues/71)
### [0.6.31](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.30...v0.6.31) (2022-02-25)
### Bug Fixes
* set source-directory correctly ([07e0e3d](https://github.com/jimeh/build-emacs-for-macos/commit/07e0e3dacddfbdb7a59aceaa2dc9cdf503ac2bcc)), closes [#68](https://github.com/jimeh/build-emacs-for-macos/issues/68)
### [0.6.30](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.29...v0.6.30) (2022-02-08)
### Bug Fixes
* **site-lisp:** add Homebrew's site-lisp directory to locallisppath ([cbd8cb2](https://github.com/jimeh/build-emacs-for-macos/commit/cbd8cb27b6ceff2e128c38cd1cc8f8380b9b4bfb))
### [0.6.29](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.28...v0.6.29) (2022-02-07)

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
@@ -359,15 +385,20 @@ class Build
'--with-modules',
'--enable-locallisppath=' \
'/Library/Application Support/Emacs/${version}/site-lisp:' \
'/Library/Application Support/Emacs/site-lisp'
'/Library/Application Support/Emacs/site-lisp:' \
'/usr/local/share/emacs/site-lisp'
]
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
@@ -384,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')
@@ -393,7 +428,7 @@ class Build
end
end
run_cmd 'make', *make_flags
run_cmd 'make', *make_flags.compact
run_cmd 'make', 'install'
end
@@ -669,6 +704,28 @@ class Build
end
end
if effective_version == 'emacs-28'
p << {
replace: [
'configure.ac',
'grep libgccjit.so\$',
'grep -E \'libgccjit\.(so|dylib)$\''
],
allow_failure: true
}
end
if %w[emacs-28 emacs-29].include?(effective_version)
p << {
replace: [
'configure.ac',
'grep -E \'libgccjit\.(so|dylib)$\'',
'grep -E \'libgccjit\.(so|dylib)$\' | tail -1'
],
allow_failure: true
}
end
if effective_version == 'emacs-27'
p << {
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
@@ -718,17 +775,34 @@ class Build
err 'Patch replace input error' unless patch[:replace].size == 3
file, before, after = patch[:replace]
info "Applying patch to #{file}..."
filepath = File.join(target, file)
err "\"#{file}\" does not exist in #{target}" unless File.exist?(filepath)
unless File.exist?(filepath)
if patch[:allow_failure]
info "File #{filepath} does not exist, skipping patch."
return
end
err "\"#{file}\" does not exist in #{target}"
end
f = File.open(filepath, 'rb')
s = f.read
sub = s.gsub!(before, after)
err "Replacement filed in #{file}" if sub.nil?
if sub.nil?
if patch[:allow_failure]
info 'Patch did not apply, skipping.'
return
end
err "Replacement failed in #{file}"
end
f.reopen(filepath, 'wb').write(s)
f.close
info "#{file} patched."
end
end
@@ -811,7 +885,8 @@ end
class CSourcesEmbedder < AbstractEmbedder
PATH_PATCH = <<~ELISP
;; Allow Emacs to find bundled C sources.
(setq source-directory (expand-file-name ".."))
(setq source-directory
(expand-file-name ".." (file-name-directory load-file-name)))
ELISP
attr_reader :source_dir
@@ -1124,7 +1199,8 @@ class GccInfo
def libgccjit_lib_dir
@libgccjit_lib_dir ||= Dir[
File.join(libgccjit_root_dir, 'lib/gcc/*/libgccjit.so*')
File.join(libgccjit_root_dir, 'lib/gcc/*/libgccjit*.dylib'),
File.join(libgccjit_root_dir, 'lib/gcc/*/libgccjit.so*'),
]
.map { |path| File.dirname(path) }
.select { |path| File.basename(path).match(/^\d+$/) }
@@ -1174,7 +1250,9 @@ if __FILE__ == $PROGRAM_NAME
native_march: false,
parallel: Etc.nprocessors,
rsvg: true,
dbus: true,
xwidgets: true,
tree_sitter: true,
github_auth: true,
dist_include: ['COPYING'],
archive: true,
@@ -1210,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|
@@ -1240,6 +1324,11 @@ if __FILE__ == $PROGRAM_NAME
cli_options[:rsvg] = v
end
opts.on('--[no-]dbus',
'Enable/disable dbus support (default: enabled)') do |v|
cli_options[:dbus] = v
end
opts.on('--no-titlebar', 'Apply no-titlebar patch (default: disabled)') do
cli_options[:no_titlebar] = true
end

2
go.mod
View File

@@ -16,7 +16,7 @@ require (
github.com/hexops/gotextdiff v1.0.3
github.com/jimeh/undent v1.1.0
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/mitchellh/gon v0.2.3
github.com/mitchellh/gon v0.2.5
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/urfave/cli/v2 v2.3.0

4
go.sum
View File

@@ -160,8 +160,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/gon v0.2.3 h1:fObN7hD14VacGG++t27GzTW6opP0lwI7TsgTPL55wBo=
github.com/mitchellh/gon v0.2.3/go.mod h1:Ua18ZhqjZHg8VyqZo8kNHAY331ntV6nNJ9mT3s2mIo8=
github.com/mitchellh/gon v0.2.5 h1:mVWtqTzV03W0avJqmqjk9M0qls3TDUXfc9ETJaPIOWY=
github.com/mitchellh/gon v0.2.5/go.mod h1:Ua18ZhqjZHg8VyqZo8kNHAY331ntV6nNJ9mT3s2mIo8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
resolve_link() {
"$(type -p greadlink readlink | head -1)" "$1"
"$(command -v greadlink || command -v readlink)" "$1"
}
abs_dirname() {