@@ -218,7 +218,7 @@ class Build
218
218
end
219
219
220
220
tarball = download_tarball ( meta [ :sha ] )
221
- @source_dir = extract_tarball ( tarball , patches ( options ) )
221
+ @source_dir = extract_tarball ( tarball , build_patches )
222
222
223
223
autogen
224
224
detect_native_comp if options [ :native_comp ] . nil?
@@ -1052,7 +1052,7 @@ class Build
1052
1052
end
1053
1053
end
1054
1054
1055
- def patches ( opts = { } )
1055
+ def build_patches
1056
1056
p = [ ]
1057
1057
1058
1058
# Enabled by default patches.
@@ -1129,14 +1129,30 @@ class Build
1129
1129
}
1130
1130
end
1131
1131
1132
- if opts [ :xwidgets ] && effective_version == 27
1132
+ if options [ :xwidgets ] && effective_version == 27
1133
1133
p << {
1134
1134
url :
1135
1135
'https://github.com./d12frosted/homebrew-emacs-plus/raw/master/' \
1136
1136
"patches/emacs-#{ effective_version } /xwidgets_webkit_in_cocoa.patch"
1137
1137
}
1138
1138
end
1139
1139
1140
+ if options [ :alpha_background ]
1141
+ if effective_version == 29
1142
+ p << {
1143
+ file : File . join (
1144
+ __dir__ , 'patches' , 'emacs-29' , 'ns-alpha-background.patch'
1145
+ )
1146
+ }
1147
+ elsif ( 30 ..31 ) . include? ( effective_version )
1148
+ p << {
1149
+ url :
1150
+ "https://github.com./emacs-mirror/emacs/compare/#{ meta [ :sha ] } " \
1151
+ '...jonrubens:emacs:ns-alpha-background.patch'
1152
+ }
1153
+ end
1154
+ end
1155
+
1140
1156
# Custom patches.
1141
1157
options [ :patches ] . each do |patch_str |
1142
1158
patch = { }
@@ -1940,12 +1956,6 @@ class CLIOptions
1940
1956
'(default: enabled if IN_NIX_SHELL is set)'
1941
1957
) { |v | options [ :use_nix ] = v }
1942
1958
1943
- opts . on (
1944
- '--[no-]xwidgets' ,
1945
- 'Enable/disable XWidgets if supported ' \
1946
- '(default: enabled)'
1947
- ) { |v | options [ :xwidgets ] = v }
1948
-
1949
1959
opts . on (
1950
1960
'--[no-]tree-sitter' ,
1951
1961
'Enable/disable tree-sitter if supported ' \
@@ -2010,23 +2020,37 @@ class CLIOptions
2010
2020
) { |v | options [ :dbus ] = v }
2011
2021
2012
2022
opts . on (
2013
- '--no-titlebar' ,
2014
- 'Apply no-titlebar patch (default: disabled)'
2015
- ) { options [ :no_titlebar ] = true }
2016
-
2017
- opts . on ( '--posix-spawn' , 'Apply posix-spawn patch (deprecated)' ) do
2018
- warn '==> WARN: posix-spawn patch is deprecated and has no effect.'
2019
- end
2023
+ '--alpha-background' ,
2024
+ 'Apply experimental alpha-background patch when building Emacs ' \
2025
+ '30.x - 31.x (default: disabled)'
2026
+ ) { |v | options [ :alpha_background ] = v }
2020
2027
2021
2028
opts . on (
2022
2029
'--no-frame-refocus' ,
2023
- 'Apply no-frame-refocus patch (default: disabled)'
2030
+ 'Apply no-frame-refocus patch when building Emacs 27.x - 31.x ' \
2031
+ '(default: disabled)'
2024
2032
) { options [ :no_frame_refocus ] = true }
2025
2033
2034
+ opts . on (
2035
+ '--no-titlebar' ,
2036
+ 'Apply no-titlebar patch when building Emacs 27.x - 28.x ' \
2037
+ '(default: disabled)'
2038
+ ) { options [ :no_titlebar ] = true }
2039
+
2040
+ opts . on (
2041
+ '--[no-]xwidgets' ,
2042
+ 'Enable/disable XWidgets when building Emacs 27.x ' \
2043
+ '(default: disabled)'
2044
+ ) { |v | options [ :xwidgets ] = v }
2045
+
2026
2046
opts . on ( '--[no-]poll' , 'Apply poll patch (deprecated)' ) do
2027
2047
warn '==> WARN: poll patch is deprecated and has no effect.'
2028
2048
end
2029
2049
2050
+ opts . on ( '--posix-spawn' , 'Apply posix-spawn patch (deprecated)' ) do
2051
+ warn '==> WARN: posix-spawn patch is deprecated and has no effect.'
2052
+ end
2053
+
2030
2054
opts . on (
2031
2055
'-p=URL' , '--patch=URL' ,
2032
2056
'Specify a custom patch file or URL to apply to the Emacs source ' \
0 commit comments