mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
1a34a9504a
|
|||
| 8513521d29 | |||
|
88bbefadc6
|
|||
|
f1bf1d93b8
|
|||
|
8a467b0d43
|
|||
|
9c29f721b4
|
|||
|
4ac71ddf39
|
|||
|
d338c136db
|
16
CHANGELOG.md
16
CHANGELOG.md
@@ -2,6 +2,22 @@
|
||||
|
||||
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.25](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.24...v0.6.25) (2021-11-25)
|
||||
|
||||
### [0.6.24](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.23...v0.6.24) (2021-11-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **embedding:** embedding GCC fails when paths do not require sanitizing ([8a467b0](https://github.com/jimeh/build-emacs-for-macos/commit/8a467b0d43140f6956d53c27e2319ae1b572868c))
|
||||
|
||||
### [0.6.23](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.22...v0.6.23) (2021-11-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** do not re-link eln files by default ([d338c13](https://github.com/jimeh/build-emacs-for-macos/commit/d338c136db8acc4378154cf66ed7db5462787602)), closes [#60](https://github.com/jimeh/build-emacs-for-macos/issues/60)
|
||||
|
||||
### [0.6.22](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.21...v0.6.22) (2021-11-10)
|
||||
|
||||
|
||||
|
||||
@@ -81,8 +81,10 @@ Options:
|
||||
--[no-]native-comp Enable/disable native-comp (default: enabled if supported)
|
||||
--[no-]native-march Enable/disable -march=native CFLAG(default: disabled)
|
||||
--[no-]native-full-aot Enable/disable NATIVE_FULL_AOT / Ahead of Time compilation (default: disabled)
|
||||
--[no-]relink-eln-files Enable/disable re-linking shared libraries in bundled *.eln files (default: disabled)
|
||||
--[no-]rsvg Enable/disable SVG image support via librsvg (default: enabled)
|
||||
--no-titlebar Apply no-titlebar patch (default: disabled)
|
||||
--posix-spawn Apply posix-spawn patch (default: disabled)
|
||||
--no-frame-refocus Apply no-frame-refocus patch (default: disabled)
|
||||
--[no-]github-auth Make authenticated GitHub API requests if GITHUB_TOKEN environment variable is set.(default: enabled)
|
||||
--work-dir DIR Specify a working directory where tarballs, sources, and builds will be stored and worked with
|
||||
@@ -90,7 +92,8 @@ Options:
|
||||
--build-name NAME Override generated build name
|
||||
--dist-include x,y,z List of extra files to copy from Emacs source into build folder/archive (default: COPYING)
|
||||
--[no-]archive Enable/disable creating *.tbz archive (default: enabled)
|
||||
--[no-]archive-keep Enable/disable keeping source folder for archive (default: disabled)
|
||||
--[no-]archive-keep-build-dir
|
||||
Enable/disable keeping source folder for archive (default: disabled)
|
||||
--plan FILE Follow given plan file, instead of using given git ref/sha
|
||||
```
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ module Output
|
||||
if newline
|
||||
warn "==> #{msg}"
|
||||
else
|
||||
STDERR.print "==> #{msg}"
|
||||
$stderr.print "==> #{msg}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,6 +35,19 @@ module Output
|
||||
end
|
||||
end
|
||||
|
||||
module System
|
||||
include Output
|
||||
|
||||
def run_cmd(*args)
|
||||
out("CMD: #{args.join(' ')}")
|
||||
cmd(*args)
|
||||
end
|
||||
|
||||
def cmd(*args)
|
||||
system(*args) || err("Exit code: #{$CHILD_STATUS.exitstatus}")
|
||||
end
|
||||
end
|
||||
|
||||
class OS
|
||||
def self.version
|
||||
@version ||= OSVersion.new
|
||||
@@ -71,6 +84,7 @@ end
|
||||
|
||||
class Build
|
||||
include Output
|
||||
include System
|
||||
|
||||
EMACS_MIRROR_REPO = 'emacs-mirror/emacs'
|
||||
DOWNLOAD_URL = 'https://github.com/emacs-mirror/emacs/tarball/%s'
|
||||
@@ -400,13 +414,13 @@ class Build
|
||||
info "Copying \"#{app_name}\" to: #{target_dir}"
|
||||
|
||||
FileUtils.mkdir_p(target_dir)
|
||||
FileUtils.cp_r(app, target_dir)
|
||||
cmd('cp', '-a', app, target_dir)
|
||||
|
||||
options[:dist_include]&.each do |filename|
|
||||
src = File.join(source_dir, filename)
|
||||
if File.exist?(src)
|
||||
info "Copying \"#{filename}\" to: #{target_dir}"
|
||||
FileUtils.cp_r(src, target_dir)
|
||||
cmd('cp', '-pRL', src, target_dir)
|
||||
else
|
||||
info "Warning: #{filename} does not exist in #{source_dir}"
|
||||
end
|
||||
@@ -431,7 +445,7 @@ class Build
|
||||
info 'Creating symlinks within Emacs.app needed for native-comp'
|
||||
|
||||
if !File.exist?('lisp') && File.exist?('Resources/lisp')
|
||||
FileUtils.ln_s('Resources/lisp', 'lisp')
|
||||
run_cmd('ln', '-s', 'Resources/lisp', 'lisp')
|
||||
end
|
||||
|
||||
# Check for folder name containing two dots (.), as this causes Apple's
|
||||
@@ -453,7 +467,7 @@ class Build
|
||||
new_name = File.join(parent, base.gsub(/\.(.+)\./, '-\\1-'))
|
||||
|
||||
info "Renaming: #{old_name} --> #{new_name}"
|
||||
FileUtils.mv(old_name, new_name)
|
||||
cmd('mv', old_name, new_name)
|
||||
end
|
||||
|
||||
base = File.basename(parent)
|
||||
@@ -477,7 +491,7 @@ class Build
|
||||
end
|
||||
|
||||
target = File.basename(source)
|
||||
FileUtils.ln_s(source, target) unless File.exist?(target)
|
||||
run_cmd('ln', '-s', source, target) unless File.exist?(target)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -600,11 +614,6 @@ class Build
|
||||
response.body
|
||||
end
|
||||
|
||||
def run_cmd(*args)
|
||||
out "CMD: #{args.join(' ')}"
|
||||
system(*args) || err("Exit code: #{$CHILD_STATUS.exitstatus}")
|
||||
end
|
||||
|
||||
def effective_version
|
||||
@effective_version ||= begin
|
||||
case ref
|
||||
@@ -750,6 +759,7 @@ end
|
||||
|
||||
class AbstractEmbedder
|
||||
include Output
|
||||
include System
|
||||
|
||||
attr_reader :app
|
||||
|
||||
@@ -786,11 +796,11 @@ class CLIHelperEmbedder < AbstractEmbedder
|
||||
target = File.join(bin_dir, 'emacs')
|
||||
dir = File.dirname(target)
|
||||
|
||||
info "Adding \"emacs\" CLI helper to #{dir}"
|
||||
info 'Adding "emacs" CLI helper to Emacs.app'
|
||||
|
||||
FileUtils.mkdir_p(dir)
|
||||
FileUtils.cp(source, target)
|
||||
FileUtils.chmod('+w', target)
|
||||
run_cmd('cp', '-pRL', source, target)
|
||||
run_cmd('chmod', '+w', target)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -816,7 +826,7 @@ class CSourcesEmbedder < AbstractEmbedder
|
||||
rel = f[src_dir.size + 1..-1]
|
||||
target = File.join(resources_dir, 'src', rel)
|
||||
FileUtils.mkdir_p(File.dirname(target))
|
||||
FileUtils.cp(f, target)
|
||||
cmd('cp', '-pRL', f, target)
|
||||
end
|
||||
|
||||
return if File.exist?(site_start_el_file) &&
|
||||
@@ -906,7 +916,7 @@ class LibEmbedder < AbstractEmbedder
|
||||
next if match[2] == exe_file || File.exist?(File.join(lib_dir, match[2]))
|
||||
|
||||
FileUtils.mkdir_p(lib_dir)
|
||||
FileUtils.cp(match[1], lib_dir)
|
||||
cmd('cp', '-pRL', match[1], lib_dir)
|
||||
copy_libs(File.join(lib_dir, match[2].to_s), rel_path)
|
||||
end
|
||||
end
|
||||
@@ -921,7 +931,7 @@ class LibEmbedder < AbstractEmbedder
|
||||
target = "#{lib_dir}/#{lib_file}"
|
||||
unless File.exist?(target)
|
||||
FileUtils.mkdir_p(lib_dir)
|
||||
FileUtils.cp(lib, lib_dir)
|
||||
cmd('cp', '-pRL', lib, lib_dir)
|
||||
end
|
||||
|
||||
while_writable(target) do
|
||||
@@ -938,7 +948,7 @@ class LibEmbedder < AbstractEmbedder
|
||||
File.chmod(0o775, file)
|
||||
yield
|
||||
ensure
|
||||
File.chmod(mode, file)
|
||||
File.chmod(mode, file) if File.exist?(file)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -963,10 +973,12 @@ class GccLibEmbedder < AbstractEmbedder
|
||||
end
|
||||
|
||||
FileUtils.mkdir_p(File.dirname(target_dir))
|
||||
FileUtils.cp_r(source_dir, target_dir)
|
||||
run_cmd('cp', '-pRL', source_dir, target_dir)
|
||||
FileUtils.rm(Dir[File.join(target_dir, '**', '.DS_Store')], force: true)
|
||||
FileUtils.chmod_R('u+w', target_dir)
|
||||
FileUtils.mv(source_darwin_dir, target_darwin_dir)
|
||||
run_cmd('chmod', '-R', 'u+w', target_dir)
|
||||
if source_darwin_dir != target_darwin_dir
|
||||
run_cmd('mv', source_darwin_dir, target_darwin_dir)
|
||||
end
|
||||
|
||||
env_setup = ERB.new(NATIVE_COMP_ENV_VAR_TPL).result(gcc_info.get_binding)
|
||||
return if File.exist?(site_start_el_file) &&
|
||||
@@ -1153,7 +1165,7 @@ if __FILE__ == $PROGRAM_NAME
|
||||
cli_options = {
|
||||
work_dir: File.expand_path(__dir__),
|
||||
native_full_aot: false,
|
||||
relink_eln: true,
|
||||
relink_eln: false,
|
||||
native_march: false,
|
||||
parallel: Etc.nprocessors,
|
||||
rsvg: true,
|
||||
@@ -1213,7 +1225,7 @@ if __FILE__ == $PROGRAM_NAME
|
||||
|
||||
opts.on('--[no-]relink-eln-files',
|
||||
'Enable/disable re-linking shared libraries in bundled *.eln ' \
|
||||
'files (default: enabled)') do |v|
|
||||
'files (default: disabled)') do |v|
|
||||
cli_options[:relink_eln] = v
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user