mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
634861beea
|
|||
|
eeca7b798d
|
|||
|
e1500cbf53
|
|||
|
ca73ab7202
|
14
CHANGELOG.md
14
CHANGELOG.md
@@ -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.
|
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.5.2](https://github.com/jimeh/build-emacs-for-macos/compare/v0.5.1...v0.5.2) (2021-06-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **native_comp:** rename native-lisp folder paths to appease Apple's codesign ([eeca7b7](https://github.com/jimeh/build-emacs-for-macos/commit/eeca7b798de236a3ffc1ab04b0f7735a37ce5af4))
|
||||||
|
|
||||||
|
### [0.5.1](https://github.com/jimeh/build-emacs-for-macos/compare/v0.5.0...v0.5.1) (2021-06-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **native_comp:** symlink creation was missing a conditional check ([ca73ab7](https://github.com/jimeh/build-emacs-for-macos/commit/ca73ab7202877acefd97289f3d28e7c025e36b9d))
|
||||||
|
|
||||||
## [0.5.0](https://github.com/jimeh/build-emacs-for-macos/compare/v0.4.17...v0.5.0) (2021-06-21)
|
## [0.5.0](https://github.com/jimeh/build-emacs-for-macos/compare/v0.4.17...v0.5.0) (2021-06-21)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class Build
|
|||||||
app = compile_source(@source_dir)
|
app = compile_source(@source_dir)
|
||||||
build_dir, app = create_build_dir(app)
|
build_dir, app = create_build_dir(app)
|
||||||
|
|
||||||
symlink_internals(app)
|
handle_native_lisp(app)
|
||||||
add_cli_helper(app)
|
add_cli_helper(app)
|
||||||
|
|
||||||
LibEmbedder.new(app, brew_dir, extra_libs).embed
|
LibEmbedder.new(app, brew_dir, extra_libs).embed
|
||||||
@@ -405,10 +405,12 @@ class Build
|
|||||||
[target_dir, File.join(target_dir, File.basename(app))]
|
[target_dir, File.join(target_dir, File.basename(app))]
|
||||||
end
|
end
|
||||||
|
|
||||||
def symlink_internals(app)
|
def handle_native_lisp(app)
|
||||||
return unless options[:native_comp]
|
return unless options[:native_comp]
|
||||||
|
|
||||||
FileUtils.cd(File.join(app, 'Contents')) do
|
contents_dir = File.join(app, 'Contents')
|
||||||
|
|
||||||
|
FileUtils.cd(contents_dir) do
|
||||||
# Skip creation of symlinks if *.eln files are located under
|
# Skip creation of symlinks if *.eln files are located under
|
||||||
# Resources/native-lisp. Emacs is capable of finding lisp sources and
|
# Resources/native-lisp. Emacs is capable of finding lisp sources and
|
||||||
# *.eln cache files without symlinks.
|
# *.eln cache files without symlinks.
|
||||||
@@ -420,7 +422,46 @@ class Build
|
|||||||
|
|
||||||
source = Dir['MacOS/libexec/emacs/**/eln-cache',
|
source = Dir['MacOS/libexec/emacs/**/eln-cache',
|
||||||
'MacOS/lib/emacs/**/native-lisp'].first
|
'MacOS/lib/emacs/**/native-lisp'].first
|
||||||
err 'Failed to find native-lisp cache directory for symlink creation.'
|
|
||||||
|
if source.nil?
|
||||||
|
err 'Failed to find native-lisp cache directory for symlink creation.'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Check for folder name containing two dots (.), as this causes Apple's
|
||||||
|
# codesign CLI tool to fail signing the Emacs.app bundle, complaining with
|
||||||
|
# q "bundle format unrecognized" error.
|
||||||
|
#
|
||||||
|
# The workaround for now is to rename the folder replacing the dots with
|
||||||
|
# hyphens (-), and create the native-lisp symlink pointing to the new
|
||||||
|
# location.
|
||||||
|
if source.match(%r{/.+\..+\..+/})
|
||||||
|
# Dig deeper into native-lisp directory
|
||||||
|
eln_dir = File.dirname(Dir[File.join(source, '**', '*.eln')].first)
|
||||||
|
|
||||||
|
base = File.basename(eln_dir)
|
||||||
|
parent = File.dirname(eln_dir)
|
||||||
|
|
||||||
|
until ['.', '/', contents_dir].include?(parent)
|
||||||
|
if base.match(/\..+\./)
|
||||||
|
old_name = File.join(parent, base)
|
||||||
|
new_name = File.join(parent, base.gsub(/\.(.+)\./, '-\\1-'))
|
||||||
|
|
||||||
|
info "Renaming: #{old_name} --> #{new_name}"
|
||||||
|
FileUtils.mv(old_name, new_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
base = File.basename(parent)
|
||||||
|
parent = File.dirname(parent)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Find native-lisp directory again after it has been renamed.
|
||||||
|
source = Dir['MacOS/libexec/emacs/**/eln-cache',
|
||||||
|
'MacOS/lib/emacs/**/native-lisp'].first
|
||||||
|
|
||||||
|
if source.nil?
|
||||||
|
err 'Failed to find native-lisp cache directory for symlink creation.'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
target = File.basename(source)
|
target = File.basename(source)
|
||||||
FileUtils.ln_s(source, target) unless File.exist?(target)
|
FileUtils.ln_s(source, target) unless File.exist?(target)
|
||||||
|
|||||||
Reference in New Issue
Block a user