mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
fix(notarization): explicitly only copy *.c and *.h C source files
Previously we just copies the whole "src" directory from the workdir, it turns out it has some binary files after a successful build, which caused Apple's notarization process to fail. As we actually only care about the *.c and *.h files from the "src" directory, let's explicitly only copy those files.
This commit is contained in:
@@ -797,7 +797,10 @@ class AbstractEmbedder
|
||||
end
|
||||
|
||||
class CSourcesEmbedder < AbstractEmbedder
|
||||
PATH_PATCH = '(setq source-directory (expand-file-name ".."))'
|
||||
|
||||
attr_reader :source_dir
|
||||
|
||||
def initialize(app, source_dir)
|
||||
super(app)
|
||||
|
||||
@@ -807,13 +810,18 @@ class CSourcesEmbedder < AbstractEmbedder
|
||||
def embed
|
||||
info 'Embedding C source files into Emacs.app for documentation purposes'
|
||||
|
||||
FileUtils.cp_r(
|
||||
File.join(source_dir, 'src'),
|
||||
File.join(resources_dir, 'src')
|
||||
)
|
||||
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.read(subdirs_el_file).include?(PATH_PATCH)
|
||||
|
||||
File.open(subdirs_el_file, 'a') do |f|
|
||||
f.puts("(setq source-directory (expand-file-name \"..\"))\n")
|
||||
f.puts("\n#{PATH_PATCH}")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user