fix(shared-libs): correctly resolve libwebp libraries

This is a near complete rewrite of the shared library embedder/bundler
code. It now correctly resolves shared libraries that link to other
shared library files in the same package via use of `@path`, which the
libwebp package does extensively between `libwebpdemux.2.dylib`,
`libwebp.7.dylib` and `libsharpyuv.0.dylib`.

These relative shared library links were not understood at all by the
old library bundler code.

The new replacement here fully understands and resolves all
`@<something>` placeholders in links to shared libraries. It operates in
a two-step process where it first walks down the three of all shared
libraries that Emacs links to, and all that they link to, etc. building
a copy and relink plan.

In a second step it then executes the copy plan, followed by the
relinking plan.

The result is a fully self-contained Emacs.app binary, which has no
dependencies on Homebrew or anything installed via Homebrew. Builds have
been tested on a fresh install of macOS Sonoma VM, with nothing but
Xcode Command Line Tools installed. Everything from native compilation
to webp, svg, png rendering, and more worked as expected.
This commit is contained in:
2023-10-11 18:18:23 +01:00
parent 3d6c7fff64
commit 6ee6d8c13a
2 changed files with 472 additions and 340 deletions

View File

@@ -2,6 +2,8 @@
source 'http://rubygems.org/'
gem 'ruby-macho'
group :development do
gem 'byebug'
gem 'rubocop'

File diff suppressed because it is too large Load Diff