There are some weird interactions with ensure_writable and atomic_write
that need to be sorted out.
FixesHomebrew/homebrew#27917.
This reverts commit 41c21e6ea5647823a9e589a56f0494b622e26fb2.
This brings a (small) performance improvement as we yield the files as
they are output by fgrep rather than waiting until fgrep is done to do
any work.
Every caller of install_names_for loops over the yielded array. Now that
we have separated the dylib id calculation and update, we can eliminate
the need for a separate loop and yield each install name individually.
Rename this method to "each_install_name_for" for clarity.
The dylib id calculation does not use any information gathered in
install_names_for, so we can pull the logic out completely and only
yield the install names.
The cellar may overlap with the prefix, so if we replace the prefix
first, we will end up with paths like "@@HOMEBREW_PREFIX@@/Cellar"
instead of "@@HOMEBREW_CELLAR@@", which will break on installations
where the cellar and prefix are disjoint.
* Finds pkg-config files such as "lib/pkgconfig/libfoo.pc" and "bin/libfoo-config"
* Does inreplace on paths in such files to allow for better bottle relocation ability
ClosesHomebrew/homebrew#23825.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
After a formula is built, scan all mach-o files for dynamic links
to see if any of them point to a C++ stdlib (libc++ or libstdc++).
If one of them is linked, record that information in the formula's tab.
This replaces the old behaviour where all files were assumed to be C++
code, and stdlibs were always tracked regardless of whether they were
actually linked against.
This also modifies the way that tabs are written - now tabs are written
with the stdlib field null, and values are only written if an stdlib
is detected.
* When a versioned keg_only formula installs the same set of executables
or libraries as a unversioned formula that links to $HOMEBREW_PREFIX,
install_name_tool will prefer to use the linked paths for files in
keg_only formula. This breaks software that should link to the
keg_only formula but links to the unversioned one instead.
* Add an additional "options" parameter with keg_only field to specify
the correct install path for keg_only formulae.