mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
8c84ef128f
|
|||
|
8b447b6237
|
|||
|
c3d19694e7
|
|||
|
cff89684c6
|
|||
|
48a512fbce
|
|||
|
a3530c02e8
|
|||
|
138ac74ba5
|
|||
|
0ba971ef61
|
|||
|
1ae8771b2c
|
|||
|
1f2868d4b3
|
|||
|
bfa5bcf79b
|
|||
| 02d85f899f | |||
|
aeb3a75e5c
|
|||
|
|
e0fd2b16eb
|
||
|
d24ac084b7
|
|||
| 159a7333de | |||
|
b582523642
|
|||
|
4f1e748df2
|
|||
|
d984633991
|
|||
|
616f74d624
|
|||
|
d7963b7664
|
|||
|
a20a8456ab
|
|||
|
8ad3ff4f53
|
|||
|
e31f5aaf93
|
|||
|
c2fb07fdb8
|
|||
|
07e0e3dacd
|
|||
|
efddb9ef92
|
|||
| f7f4c0433a | |||
|
cbd8cb27b6
|
2
Brewfile
2
Brewfile
@@ -23,5 +23,7 @@ brew 'make'
|
||||
brew 'ncurses'
|
||||
brew 'nettle'
|
||||
brew 'pkg-config'
|
||||
brew 'sqlite'
|
||||
brew 'texinfo'
|
||||
brew 'tree-sitter'
|
||||
brew 'zlib'
|
||||
|
||||
73
CHANGELOG.md
73
CHANGELOG.md
@@ -2,6 +2,79 @@
|
||||
|
||||
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.39](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.38...v0.6.39) (2022-12-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **deprecate:** posix-spawn patch is no longer supported ([c3d1969](https://github.com/jimeh/build-emacs-for-macos/commit/c3d19694e7e4d33d462c9917683c2d63f69002f5))
|
||||
* **version:** correctly handle Emacs 30.x builds ([8b447b6](https://github.com/jimeh/build-emacs-for-macos/commit/8b447b6237fbbd94c4e72af8ee79969c7cfc9363))
|
||||
|
||||
### [0.6.38](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.37...v0.6.38) (2022-12-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **patch:** add round-undecorated-frame from emacs-plus for 29.x ([48a512f](https://github.com/jimeh/build-emacs-for-macos/commit/48a512fbce79759caa987e2880585bd0bc937977))
|
||||
* **patch:** add support for experimental poll patch from emacs-plus for 29.x ([a3530c0](https://github.com/jimeh/build-emacs-for-macos/commit/a3530c02e8260106f87d464e5cb398dcb2819460))
|
||||
|
||||
### [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)
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -623,8 +658,10 @@ class Build
|
||||
'emacs-27'
|
||||
when /^emacs-28.*/
|
||||
'emacs-28'
|
||||
else
|
||||
when /^emacs-29.*/
|
||||
'emacs-29'
|
||||
else
|
||||
'emacs-30'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -632,14 +669,14 @@ class Build
|
||||
def patches(opts = {})
|
||||
p = []
|
||||
|
||||
if %w[emacs-26 emacs-27 emacs-28 emacs-29].include?(effective_version)
|
||||
if %w[emacs-26 emacs-27 emacs-28 emacs-29 emacs-30].include?(effective_version)
|
||||
p << {
|
||||
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||
"patches/#{effective_version}/fix-window-role.patch"
|
||||
}
|
||||
end
|
||||
|
||||
if %w[emacs-27 emacs-28 emacs-29].include?(effective_version)
|
||||
if %w[emacs-27 emacs-28 emacs-29 emacs-30].include?(effective_version)
|
||||
p << {
|
||||
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||
"patches/#{effective_version}/system-appearance.patch"
|
||||
@@ -660,15 +697,41 @@ class Build
|
||||
end
|
||||
end
|
||||
|
||||
if %w[emacs-28 emacs-29].include?(effective_version)
|
||||
if options[:posix_spawn]
|
||||
if %w[emacs-29 emacs-30].include?(effective_version)
|
||||
p << {
|
||||
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||
"patches/#{effective_version}/round-undecorated-frame.patch"
|
||||
}
|
||||
if options[:poll]
|
||||
p << {
|
||||
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||
"patches/#{effective_version}/posix-spawn.patch"
|
||||
"patches/#{effective_version}/poll.patch"
|
||||
}
|
||||
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 +781,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 +891,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 +1205,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 +1256,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 +1294,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,12 +1330,17 @@ 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
|
||||
|
||||
opts.on('--posix-spawn', 'Apply posix-spawn patch (default: disabled)') do
|
||||
cli_options[:posix_spawn] = true
|
||||
opts.on('--posix-spawn', 'Apply posix-spawn patch (deprecated)') do
|
||||
warn '==> WARN: posix-spawn patch is deprecated as has no effect.'
|
||||
end
|
||||
|
||||
opts.on('--no-frame-refocus',
|
||||
@@ -1253,6 +1348,13 @@ if __FILE__ == $PROGRAM_NAME
|
||||
cli_options[:no_frame_refocus] = true
|
||||
end
|
||||
|
||||
opts.on('--[no-]poll',
|
||||
'Enable/disable experimental use of poll() instead of select() ' \
|
||||
'to support > 1024 file descriptors ' \
|
||||
'(default: disabled)') do |v|
|
||||
cli_options[:poll] = v
|
||||
end
|
||||
|
||||
opts.on('--[no-]github-auth',
|
||||
'Make authenticated GitHub API requests if GITHUB_TOKEN ' \
|
||||
'environment variable is set.' \
|
||||
|
||||
2
go.mod
2
go.mod
@@ -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
4
go.sum
@@ -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=
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user