aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/keg_fix_install_names.rb
AgeCommit message (Collapse)Author
2013-12-04Teach installer about prefix and cellar placeholdersJack Nagel
2013-12-04Remove special handling for relocatable pkgconfig filesJack Nagel
2013-12-04Insert placeholders for prefix and cellar in relocatable bottlesJack Nagel
2013-12-04relocate_install_names: rewrite cellar names before prefix namesJack Nagel
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.
2013-12-04fix_install_names: extract change_dylib_idJack Nagel
2013-12-04fix_install_names: extract change_install_nameJack Nagel
2013-12-01Ensure cellar path is replace correctly for relocatable bottlesJack Nagel
2013-12-01Skip path replacement when it would be a no-opJack Nagel
2013-12-01Extract repeated regexp to a methodJack Nagel
2013-11-13Add support for relocating pkgconfig files for bottlesElliot Saba
* 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 Closes #23825. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-10-26detect_cxx_stdlibs: use mach_o_filesMisty De Meo
2013-10-18Add OS.mac? and OS.linux?Jack Nagel
2013-10-08detect_cxx_stdlibs: Only detect for dylibsMisty De Meo
Fixes #23115.
2013-10-06Only track C++ stdlibs for C++ codeMisty De Meo
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.
2013-10-06Fix typo in Keg#fixed_name invocationAlex Malinovich
Closes #23079. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-10-04Fix install_name_tool path for keg_only formulaeXiyue Deng
* 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.
2013-05-22Favor equality check over nil checkJack Nagel
2013-05-22Extract name repair logic from fix_install_namesJack Nagel
2013-05-22Factor out MacOS.locate("install_name_tool") callsJack Nagel
2013-03-11Relocate bottles using install_name_tool.Mike McQuaid
This has two parts: 1. Bottles are temporarily relocated on bottling and tested if that is sufficient for them to contain no longer reference the prefix or cellar. If so, they are marked as relocatable. 2. On installation if bottles are marked as relocatable they will be relocated using install_name_tool to the current prefix and cellar. Closes #18374.
2013-03-11Don't run certain functions on non-MACOS.Mike McQuaid
2012-11-06Fix framework install namesJack Nagel
2012-09-18Don't try to fix @rpath install namesJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-04Fix bad install names in executablesJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-29Create active symlinks for installed formulaMax Howell
Similar to the LinkedKegs record, we write a symlink for installed kegs to PREFIX/opt. Unlike the linked-keg record, unlinking doesn't remove the link, only uninstalling, and keg-only formula have a record too. The reason for this addition is so that formula that depend on keg-only formula can build against the opt directory and not the cellar keg. Thus surviving upgrades. To enforce this fix_install_names and built were adapted to use the opt path. Standard kegs also create an opt symlink so that caveats can now refer to the opt directory and thus provide steps that survive upgrades too. Thus the choice of /opt. It is short, neat and the right choice: POSIX dictates that opt is for stand-alone prefixes of software.
2012-08-21keg_fix_install_names doesn't need FindJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-24Core change: XCode only install, with CLT or bothsamueljohn
Allow XCode without the Command Line Tools to work with homebrew, so it's not necessary to register an Apple Dev ID and/or go to the XCode prefs and download the CLT. Yay! Further, this commit allows to use the CLT solely (without the need for XCode). Saves quite some megs. (Some furmulae require xcodebuild) Of course XCode together with the CLT is still fine and has been tested on 10.7 and 10.6 with Xcode 4 and Xcode 3. Only on Lion or above, tell the user about the options, which are - Xcode without CLT - CLT without Xcode - both (ok, it's not directly stated, but implicit) So if no Xcode is found and we are on Lion or above, we don't fail but check for the CLTs now. For older Macs, the old message that Xcode is needed and the installer should be run is still displayed. If the CLT are not found but Xcode is, then we print out about the experimental status of this setup. Closes #10510. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-06-17fix_install_names: try harder to find referenced dylibsJack Nagel
Keg#fix_install_names punts if bad install names reference dylibs that aren't "nearby". Enable this machinery to fix more complex directory hierarchies by searching everything under 'lib' for the bad name's basename. Additionally, teach it to correctly handle Mach-O bundle files. Fixes #12810. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-30fix_install_names: make failures verbose in debug modeJack Nagel
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-05-30fix_install_names: use Mach-O methods to find dylibsJack Nagel
Some libraries do not have the .dylib extension (e.g. Qt framework libs), but need to have their install names rewritten to prevent other packages from breaking due to upgrades. Use the new Pathname#dylib? instead.
2012-05-30Recurse into subdirectories when fixing install namesJack Nagel
2012-02-21Make fix_install_names more robustCamillo Lugaresi
fixes a problem with the opencv formula Closes #10291. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-06-28Fix install_name massaging for keg-only brewsMax Howell
Fixes #6065. My pre-emptive fix that avoided calling Pathname.ensure_writable because I was not convinced it worked broke this function due to incorrect logic. The lesson is, don’t write pre-emptive fixes. Wait until you've seen the bug first. All code has bugs in, so write less. I'm an idiot sometimes.
2011-06-17Fix upgrading libdeps breaking stuff after cleanupsMax Howell
Fixes #2709. By forcing dylibs to have an install_name id that is the HOMEBREW_PREFIX path, ie. the symlink’s path. Stuff that links to these dylibs will use this id and thus by immune to upgrades of underlying libraries. Thus whatever keg is "current" ie. linked, will be the library that is used by the tool. This fix is not retroactive. So there will still be breakage for existing installations of stuff. The fix_install step in install is moved after the link step as the symlinking is required to determine the eventual ids for each dylib.
2011-05-05fix_install_names fix for 10.5Adam Vandenberg
2011-03-12A install name fix step during installMax Howell
We currently only fix relative paths, but we should expand this more.