mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d054a17fc7
|
|||
|
4030ceb9ca
|
|||
|
ad1a7dd62c
|
|||
| 665e6addec | |||
|
7f2aba0e4e
|
|||
|
be326b22aa
|
|||
|
ef4f2ad930
|
|||
|
2293c87fc9
|
|||
|
97178bf77a
|
|||
|
591c39e629
|
|||
|
d6c99f8c60
|
|||
|
bcbd01778d
|
|||
|
5602475542
|
|||
|
67b8c5f397
|
|||
|
4dad5812fa
|
|||
|
65bdff0b6d
|
|||
|
a956dc1b42
|
42
CHANGELOG.md
42
CHANGELOG.md
@@ -2,6 +2,48 @@
|
|||||||
|
|
||||||
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.6.22](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.21...v0.6.22) (2021-11-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **patch:** add support for posix-spawn patch from emacs-plus ([4030ceb](https://github.com/jimeh/build-emacs-for-macos/commit/4030ceb9cab6749af3c28161ac97caec90a8aed0))
|
||||||
|
|
||||||
|
### [0.6.21](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.20...v0.6.21) (2021-10-27)
|
||||||
|
|
||||||
|
### [0.6.20](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.19...v0.6.20) (2021-10-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **notarization:** explicitly only copy *.c and *.h C source files ([591c39e](https://github.com/jimeh/build-emacs-for-macos/commit/591c39e629c9556adcf296cd5c15dd0b17c4d986))
|
||||||
|
|
||||||
|
### [0.6.19](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.18...v0.6.19) (2021-10-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **patch:** resolve emacs-29 symlink patches to their real URL ([bcbd017](https://github.com/jimeh/build-emacs-for-macos/commit/bcbd01778d416b99205c51f348a543489889f66d))
|
||||||
|
|
||||||
|
### [0.6.18](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.17...v0.6.18) (2021-10-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **docs:** embed C source files and set source-directory accordingly ([67b8c5f](https://github.com/jimeh/build-emacs-for-macos/commit/67b8c5f3974e178e31519846d46af82d9770ad6e))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **patches:** correctly use emacs 28.x and 29.x patches ([4dad581](https://github.com/jimeh/build-emacs-for-macos/commit/4dad5812fa2b67adc7262a778829013995a904bc))
|
||||||
|
|
||||||
|
### [0.6.17](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.16...v0.6.17) (2021-10-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **release:** tweak GitHub release description ([a956dc1](https://github.com/jimeh/build-emacs-for-macos/commit/a956dc1b42b2648e2663f5b48c72d7428fe75f19))
|
||||||
|
|
||||||
### [0.6.16](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.15...v0.6.16) (2021-10-10)
|
### [0.6.16](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.15...v0.6.16) (2021-10-10)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -105,8 +105,9 @@ class Build
|
|||||||
build_dir, app = create_build_dir(app)
|
build_dir, app = create_build_dir(app)
|
||||||
|
|
||||||
handle_native_lisp(app)
|
handle_native_lisp(app)
|
||||||
add_cli_helper(app)
|
|
||||||
|
|
||||||
|
CLIHelperEmbedder.new(app).embed
|
||||||
|
CSourcesEmbedder.new(app, @source_dir).embed
|
||||||
LibEmbedder.new(app, brew_dir, extra_libs, options[:relink_eln]).embed
|
LibEmbedder.new(app, brew_dir, extra_libs, options[:relink_eln]).embed
|
||||||
GccLibEmbedder.new(app, gcc_info).embed if options[:native_comp]
|
GccLibEmbedder.new(app, gcc_info).embed if options[:native_comp]
|
||||||
|
|
||||||
@@ -285,8 +286,6 @@ class Build
|
|||||||
verify_native_comp
|
verify_native_comp
|
||||||
gcc_info.verify_libgccjit
|
gcc_info.verify_libgccjit
|
||||||
|
|
||||||
apply_native_comp_env_setup_patch(source)
|
|
||||||
|
|
||||||
ENV['CFLAGS'] = [
|
ENV['CFLAGS'] = [
|
||||||
"-I#{File.join(gcc_info.root_dir, 'include')}",
|
"-I#{File.join(gcc_info.root_dir, 'include')}",
|
||||||
"-I#{File.join(gcc_info.libgccjit_root_dir, 'include')}",
|
"-I#{File.join(gcc_info.libgccjit_root_dir, 'include')}",
|
||||||
@@ -505,18 +504,6 @@ class Build
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_cli_helper(app)
|
|
||||||
source = File.join(__dir__, 'helper', 'emacs-cli.bash')
|
|
||||||
target = File.join(app, 'Contents', 'MacOS', 'bin', 'emacs')
|
|
||||||
dir = File.dirname(target)
|
|
||||||
|
|
||||||
info "Adding \"emacs\" CLI helper to #{dir}"
|
|
||||||
|
|
||||||
FileUtils.mkdir_p(dir)
|
|
||||||
FileUtils.cp(source, target)
|
|
||||||
FileUtils.chmod('+w', target)
|
|
||||||
end
|
|
||||||
|
|
||||||
def build_name
|
def build_name
|
||||||
return @build_name if @build_name
|
return @build_name if @build_name
|
||||||
return @build_name = options[:build_name] if options[:build_name]
|
return @build_name = options[:build_name] if options[:build_name]
|
||||||
@@ -618,21 +605,6 @@ class Build
|
|||||||
system(*args) || err("Exit code: #{$CHILD_STATUS.exitstatus}")
|
system(*args) || err("Exit code: #{$CHILD_STATUS.exitstatus}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def apply_native_comp_env_setup_patch(source)
|
|
||||||
term = 'native-compile-setup-environment-variables'
|
|
||||||
file = 'lisp/emacs-lisp/comp.el'
|
|
||||||
return if `grep '#{term}' '#{file}'`.strip.size.positive?
|
|
||||||
|
|
||||||
template = File.read(
|
|
||||||
File.join(__dir__, 'patches/native-comp-env-setup.diff.erb')
|
|
||||||
)
|
|
||||||
patch = ERB.new(template).result(gcc_info.get_binding)
|
|
||||||
patch_file = File.join(source, 'macos_patches/native-comp-env-setup.diff')
|
|
||||||
|
|
||||||
File.write(patch_file, patch)
|
|
||||||
apply_patch({ file: patch_file }, source)
|
|
||||||
end
|
|
||||||
|
|
||||||
def effective_version
|
def effective_version
|
||||||
@effective_version ||= begin
|
@effective_version ||= begin
|
||||||
case ref
|
case ref
|
||||||
@@ -640,8 +612,10 @@ class Build
|
|||||||
'emacs-26'
|
'emacs-26'
|
||||||
when /^emacs-27.*/
|
when /^emacs-27.*/
|
||||||
'emacs-27'
|
'emacs-27'
|
||||||
else
|
when /^emacs-28.*/
|
||||||
'emacs-28'
|
'emacs-28'
|
||||||
|
else
|
||||||
|
'emacs-29'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -649,14 +623,14 @@ class Build
|
|||||||
def patches(opts = {})
|
def patches(opts = {})
|
||||||
p = []
|
p = []
|
||||||
|
|
||||||
if %w[emacs-26 emacs-27 emacs-28].include?(effective_version)
|
if %w[emacs-26 emacs-27 emacs-28 emacs-29].include?(effective_version)
|
||||||
p << {
|
p << {
|
||||||
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||||
"patches/#{effective_version}/fix-window-role.patch"
|
"patches/#{effective_version}/fix-window-role.patch"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if %w[emacs-27 emacs-28].include?(effective_version)
|
if %w[emacs-27 emacs-28 emacs-29].include?(effective_version)
|
||||||
p << {
|
p << {
|
||||||
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||||
"patches/#{effective_version}/system-appearance.patch"
|
"patches/#{effective_version}/system-appearance.patch"
|
||||||
@@ -677,6 +651,15 @@ class Build
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if %w[emacs-28 emacs-29].include?(effective_version)
|
||||||
|
if options[:posix_spawn]
|
||||||
|
p << {
|
||||||
|
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||||
|
"patches/#{effective_version}/posix-spawn.patch"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if effective_version == 'emacs-27'
|
if effective_version == 'emacs-27'
|
||||||
p << {
|
p << {
|
||||||
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
url: 'https://github.com/d12frosted/homebrew-emacs-plus/raw/master/' \
|
||||||
@@ -714,7 +697,14 @@ class Build
|
|||||||
info "Downloading patch: #{patch[:url]}"
|
info "Downloading patch: #{patch[:url]}"
|
||||||
run_cmd('curl', '-L#', patch[:url], '-o', patch_file)
|
run_cmd('curl', '-L#', patch[:url], '-o', patch_file)
|
||||||
|
|
||||||
apply_patch({ file: patch_file }, target)
|
real_patch_url = detect_github_symlink_patch(patch[:url], patch_file)
|
||||||
|
if real_patch_url
|
||||||
|
FileUtils.rm(patch_file)
|
||||||
|
apply_patch({ url: real_patch_url }, target)
|
||||||
|
else
|
||||||
|
apply_patch({ file: patch_file }, target)
|
||||||
|
end
|
||||||
|
|
||||||
elsif patch[:replace]
|
elsif patch[:replace]
|
||||||
err 'Patch replace input error' unless patch[:replace].size == 3
|
err 'Patch replace input error' unless patch[:replace].size == 3
|
||||||
|
|
||||||
@@ -732,6 +722,30 @@ class Build
|
|||||||
f.close
|
f.close
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# When downloading raw files from GitHub, if the target file is a symlink, it
|
||||||
|
# will return the actual target path of the symlink instead of the content of
|
||||||
|
# the target file. Hence we have to check if the patch file we have downloaded
|
||||||
|
# contains one and only one line, and if so, assume it's a symlink.
|
||||||
|
def detect_github_symlink_patch(original_url, patch_file)
|
||||||
|
lines = []
|
||||||
|
|
||||||
|
# read first two lines
|
||||||
|
File.open(patch_file) do |f|
|
||||||
|
lines << f.gets
|
||||||
|
lines << f.gets
|
||||||
|
end
|
||||||
|
|
||||||
|
# if the file contains more than one line of text, it's not a symlink.
|
||||||
|
return unless lines[1].nil?
|
||||||
|
|
||||||
|
symlink_target = lines[0].strip
|
||||||
|
# Assume patch file content is something along the lines of
|
||||||
|
# "../emacs-28/fix-window-role.patch", hence we resolve it relative to the
|
||||||
|
# original url.
|
||||||
|
info "patch is symlink to #{symlink_target}"
|
||||||
|
URI.join(original_url, symlink_target).to_s
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class AbstractEmbedder
|
class AbstractEmbedder
|
||||||
@@ -753,9 +767,71 @@ class AbstractEmbedder
|
|||||||
File.join(invocation_dir, 'Emacs')
|
File.join(invocation_dir, 'Emacs')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bin_dir
|
||||||
|
File.join(invocation_dir, 'bin')
|
||||||
|
end
|
||||||
|
|
||||||
def lib_dir
|
def lib_dir
|
||||||
File.join(invocation_dir, 'lib')
|
File.join(invocation_dir, 'lib')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def resources_dir
|
||||||
|
File.join(app, 'Contents', 'Resources')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class CLIHelperEmbedder < AbstractEmbedder
|
||||||
|
def embed
|
||||||
|
source = File.join(__dir__, 'helper', 'emacs-cli.bash')
|
||||||
|
target = File.join(bin_dir, 'emacs')
|
||||||
|
dir = File.dirname(target)
|
||||||
|
|
||||||
|
info "Adding \"emacs\" CLI helper to #{dir}"
|
||||||
|
|
||||||
|
FileUtils.mkdir_p(dir)
|
||||||
|
FileUtils.cp(source, target)
|
||||||
|
FileUtils.chmod('+w', target)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class CSourcesEmbedder < AbstractEmbedder
|
||||||
|
PATH_PATCH = <<~ELISP
|
||||||
|
;; Allow Emacs to find bundled C sources.
|
||||||
|
(setq source-directory (expand-file-name ".."))
|
||||||
|
ELISP
|
||||||
|
|
||||||
|
attr_reader :source_dir
|
||||||
|
|
||||||
|
def initialize(app, source_dir)
|
||||||
|
super(app)
|
||||||
|
|
||||||
|
@source_dir = source_dir
|
||||||
|
end
|
||||||
|
|
||||||
|
def embed
|
||||||
|
info 'Embedding C source files into Emacs.app for documentation purposes'
|
||||||
|
|
||||||
|
src_dir = File.join(source_dir, 'src')
|
||||||
|
Dir[File.join(src_dir, '**', '*.{c,h}')].each do |f|
|
||||||
|
rel = f[src_dir.size + 1..-1]
|
||||||
|
target = File.join(resources_dir, 'src', rel)
|
||||||
|
FileUtils.mkdir_p(File.dirname(target))
|
||||||
|
FileUtils.cp(f, target)
|
||||||
|
end
|
||||||
|
|
||||||
|
return if File.exist?(site_start_el_file) &&
|
||||||
|
File.read(site_start_el_file).include?(PATH_PATCH)
|
||||||
|
|
||||||
|
File.open(site_start_el_file, 'a') do |f|
|
||||||
|
f.puts("\n#{PATH_PATCH}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def site_start_el_file
|
||||||
|
@site_start_el_file ||= File.join(resources_dir, 'lisp', 'site-start.el')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class LibEmbedder < AbstractEmbedder
|
class LibEmbedder < AbstractEmbedder
|
||||||
@@ -891,10 +967,45 @@ class GccLibEmbedder < AbstractEmbedder
|
|||||||
FileUtils.rm(Dir[File.join(target_dir, '**', '.DS_Store')], force: true)
|
FileUtils.rm(Dir[File.join(target_dir, '**', '.DS_Store')], force: true)
|
||||||
FileUtils.chmod_R('u+w', target_dir)
|
FileUtils.chmod_R('u+w', target_dir)
|
||||||
FileUtils.mv(source_darwin_dir, target_darwin_dir)
|
FileUtils.mv(source_darwin_dir, target_darwin_dir)
|
||||||
|
|
||||||
|
env_setup = ERB.new(NATIVE_COMP_ENV_VAR_TPL).result(gcc_info.get_binding)
|
||||||
|
return if File.exist?(site_start_el_file) &&
|
||||||
|
File.read(site_start_el_file).include?(env_setup)
|
||||||
|
|
||||||
|
File.open(site_start_el_file, 'a') do |f|
|
||||||
|
f.puts("\n#{env_setup}")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
NATIVE_COMP_ENV_VAR_TPL = <<~ELISP
|
||||||
|
;; Set LIBRARY_PATH to point at bundled GCC and Xcode Command Line Tools to
|
||||||
|
;; ensure native-comp works.
|
||||||
|
(when (and (eq system-type 'darwin)
|
||||||
|
(string-match-p "\\.app\\/Contents\\/MacOS\\/?$"
|
||||||
|
invocation-directory))
|
||||||
|
(let* ((library-path-env (getenv "LIBRARY_PATH"))
|
||||||
|
(devtools-dir
|
||||||
|
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib")
|
||||||
|
(gcc-dir (expand-file-name
|
||||||
|
"<%= app_bundle_relative_lib_dir %>"
|
||||||
|
invocation-directory))
|
||||||
|
(darwin-dir (expand-file-name
|
||||||
|
"<%= app_bundle_relative_darwin_lib_dir %>"
|
||||||
|
invocation-directory))
|
||||||
|
(lib-paths (list)))
|
||||||
|
|
||||||
|
(if library-path-env
|
||||||
|
(push library-path-env lib-paths))
|
||||||
|
(if (file-directory-p devtools-dir)
|
||||||
|
(push devtools-dir lib-paths))
|
||||||
|
(push darwin-dir lib-paths)
|
||||||
|
(push gcc-dir lib-paths)
|
||||||
|
|
||||||
|
(setenv "LIBRARY_PATH" (mapconcat 'identity lib-paths ":"))))
|
||||||
|
ELISP
|
||||||
|
|
||||||
def embedded?
|
def embedded?
|
||||||
Dir[File.join(target_dir, 'libgcc*')].any?
|
Dir[File.join(target_dir, 'libgcc*')].any?
|
||||||
end
|
end
|
||||||
@@ -918,6 +1029,10 @@ class GccLibEmbedder < AbstractEmbedder
|
|||||||
def relative_dir(path, root)
|
def relative_dir(path, root)
|
||||||
Pathname.new(path).relative_path_from(Pathname.new(root)).to_s
|
Pathname.new(path).relative_path_from(Pathname.new(root)).to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def site_start_el_file
|
||||||
|
@site_start_el_file ||= File.join(resources_dir, 'lisp', 'site-start.el')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class GccInfo
|
class GccInfo
|
||||||
@@ -1112,6 +1227,10 @@ if __FILE__ == $PROGRAM_NAME
|
|||||||
cli_options[:no_titlebar] = true
|
cli_options[:no_titlebar] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on('--posix-spawn', 'Apply posix-spawn patch (default: disabled)') do
|
||||||
|
cli_options[:posix_spawn] = true
|
||||||
|
end
|
||||||
|
|
||||||
opts.on('--no-frame-refocus',
|
opts.on('--no-frame-refocus',
|
||||||
'Apply no-frame-refocus patch (default: disabled)') do
|
'Apply no-frame-refocus patch (default: disabled)') do
|
||||||
cli_options[:no_frame_refocus] = true
|
cli_options[:no_frame_refocus] = true
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
|
|
||||||
index 638d4b274c..2599211936 100644
|
|
||||||
--- a/lisp/emacs-lisp/comp.el
|
|
||||||
+++ b/lisp/emacs-lisp/comp.el
|
|
||||||
@@ -4224,6 +4224,52 @@ native-compile-async
|
|
||||||
(let ((load (not (not load))))
|
|
||||||
(native--compile-async files recursively load selector)))
|
|
||||||
|
|
||||||
+;;;###autoload
|
|
||||||
+(defun native-compile-setup-environment-variables (&rest _args)
|
|
||||||
+ "Ensure LIBRARY_PATH is set correctly when libgccjit is bundled."
|
|
||||||
+ (when (and (eq system-type 'darwin)
|
|
||||||
+ (string-match-p "\.app\/Contents\/MacOS\/?$"
|
|
||||||
+ invocation-directory))
|
|
||||||
+ (let* ((library-path-env (getenv "LIBRARY_PATH"))
|
|
||||||
+ (devtools-dir
|
|
||||||
+ "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib")
|
|
||||||
+ (gcc-dir (expand-file-name
|
|
||||||
+ "<%= app_bundle_relative_lib_dir %>"
|
|
||||||
+ invocation-directory))
|
|
||||||
+ (darwin-dir (expand-file-name
|
|
||||||
+ "<%= app_bundle_relative_darwin_lib_dir %>"
|
|
||||||
+ invocation-directory))
|
|
||||||
+ (lib-paths (list)))
|
|
||||||
+
|
|
||||||
+ (if library-path-env
|
|
||||||
+ (push library-path-env lib-paths))
|
|
||||||
+ (if (file-directory-p devtools-dir)
|
|
||||||
+ (push devtools-dir lib-paths))
|
|
||||||
+ (push darwin-dir lib-paths)
|
|
||||||
+ (push gcc-dir lib-paths)
|
|
||||||
+
|
|
||||||
+ (setenv "LIBRARY_PATH" (mapconcat 'identity lib-paths ":"))))
|
|
||||||
+
|
|
||||||
+ ;; Remove advice, as it only needs to run once.
|
|
||||||
+ (advice-remove 'native-compile
|
|
||||||
+ 'native-compile-setup-environment-variables)
|
|
||||||
+ (advice-remove 'comp--native-compile
|
|
||||||
+ 'native-compile-setup-environment-variables)
|
|
||||||
+ (advice-remove 'native-compile-async
|
|
||||||
+ 'native-compile-setup-environment-variables)
|
|
||||||
+ (advice-remove 'native--compile-async
|
|
||||||
+ 'native-compile-setup-environment-variables))
|
|
||||||
+
|
|
||||||
+;; Ensure environment setup runs before any native compilation.
|
|
||||||
+(advice-add 'native-compile :before
|
|
||||||
+ 'native-compile-setup-environment-variables)
|
|
||||||
+(advice-add 'comp--native-compile :before
|
|
||||||
+ 'native-compile-setup-environment-variables)
|
|
||||||
+(advice-add 'native-compile-async :before
|
|
||||||
+ 'native-compile-setup-environment-variables)
|
|
||||||
+(advice-add 'native--compile-async :before
|
|
||||||
+ 'native-compile-setup-environment-variables)
|
|
||||||
+
|
|
||||||
(provide 'comp)
|
|
||||||
|
|
||||||
;; LocalWords: limplified limplified limplification limplify Limple LIMPLE libgccjit elc eln
|
|
||||||
@@ -46,6 +46,7 @@ func New(version, commit, date string) *CLI {
|
|||||||
Commands: []*cli2.Command{
|
Commands: []*cli2.Command{
|
||||||
planCmd(),
|
planCmd(),
|
||||||
signCmd(),
|
signCmd(),
|
||||||
|
signFilesCmd(),
|
||||||
notarizeCmd(),
|
notarizeCmd(),
|
||||||
packageCmd(),
|
packageCmd(),
|
||||||
releaseCmd(),
|
releaseCmd(),
|
||||||
|
|||||||
@@ -112,3 +112,49 @@ func signAction(c *cli2.Context, opts *Options) error {
|
|||||||
|
|
||||||
return sign.Emacs(c.Context, app, signOpts)
|
return sign.Emacs(c.Context, app, signOpts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func signFilesCmd() *cli2.Command {
|
||||||
|
signCmd := signCmd()
|
||||||
|
|
||||||
|
var flags []cli2.Flag
|
||||||
|
for _, f := range signCmd.Flags {
|
||||||
|
n := f.Names()
|
||||||
|
if len(n) > 0 && n[0] == "plan" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
flags = append(flags, f)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &cli2.Command{
|
||||||
|
Name: "sign-files",
|
||||||
|
Usage: "sign files with codesign",
|
||||||
|
ArgsUsage: "<file> [<file>...]",
|
||||||
|
Hidden: true,
|
||||||
|
Flags: flags,
|
||||||
|
Action: actionWrapper(signFilesAction),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func signFilesAction(c *cli2.Context, opts *Options) error {
|
||||||
|
signOpts := &sign.Options{
|
||||||
|
Identity: c.String("sign"),
|
||||||
|
Options: c.StringSlice("options"),
|
||||||
|
Deep: c.Bool("deep"),
|
||||||
|
Timestamp: c.Bool("timestamp"),
|
||||||
|
Force: c.Bool("force"),
|
||||||
|
Verbose: c.Bool("verbose"),
|
||||||
|
CodeSignCmd: c.String("codesign"),
|
||||||
|
}
|
||||||
|
|
||||||
|
if v := c.StringSlice("entitlements"); len(v) > 0 {
|
||||||
|
e := sign.Entitlements(v)
|
||||||
|
signOpts.Entitlements = &e
|
||||||
|
}
|
||||||
|
|
||||||
|
if !opts.quiet {
|
||||||
|
signOpts.Output = os.Stdout
|
||||||
|
}
|
||||||
|
|
||||||
|
return sign.Files(c.Context, c.Args().Slice(), signOpts)
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,11 +22,9 @@ var bodyTpl = template.Must(template.New("body").Funcs(tplFuncs).Parse(`
|
|||||||
{{ with .SourceURL -}}
|
{{ with .SourceURL -}}
|
||||||
- Source: {{ . }}
|
- Source: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if and .CommitSHA .CommitURL }}
|
{{- if .CommitURL }}
|
||||||
- Commit: [{{ $t }}{{ .CommitSHA }}{{ $t }}]
|
- Commit: {{ .CommitURL }}
|
||||||
{{- if .CommitURL }}({{ .CommitURL }}){{ end }}
|
{{- if .CommitSHA }} ({{ $t }}{{ .CommitSHA }}{{ $t }}){{ end }}
|
||||||
{{- else if and .CommitSHA }}
|
|
||||||
- Commit: {{ $t }}{{ .CommitSHA }}{{ $t }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .TarballURL }}
|
{{- with .TarballURL }}
|
||||||
- Tarball: {{ . }}
|
- Tarball: {{ . }}
|
||||||
|
|||||||
Reference in New Issue
Block a user