Insert placeholders for prefix and cellar in relocatable bottles
This commit is contained in:
parent
94ebe8e747
commit
76153e9780
@ -124,16 +124,30 @@ module Homebrew extend self
|
||||
|
||||
HOMEBREW_CELLAR.cd do
|
||||
ohai "Bottling #{filename}..."
|
||||
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
||||
# or an uncompressed tarball (and more bandwidth friendly).
|
||||
safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.version}"
|
||||
|
||||
keg = Keg.new(f.prefix)
|
||||
|
||||
keg.lock do
|
||||
begin
|
||||
keg.relocate_install_names prefix, Keg::PREFIX_PLACEHOLDER,
|
||||
cellar, Keg::CELLAR_PLACEHOLDER, :keg_only => f.keg_only?
|
||||
|
||||
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
||||
# or an uncompressed tarball (and more bandwidth friendly).
|
||||
safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.version}"
|
||||
ensure
|
||||
keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, prefix,
|
||||
Keg::CELLAR_PLACEHOLDER, cellar, :keg_only => f.keg_only?
|
||||
end
|
||||
end
|
||||
|
||||
sha1 = bottle_path.sha1
|
||||
relocatable = false
|
||||
|
||||
if File.size?(bottle_path) > 1*1024*1024
|
||||
ohai "Detecting if #{filename} is relocatable..."
|
||||
end
|
||||
keg = Keg.new f.prefix
|
||||
|
||||
keg.lock do
|
||||
# Relocate bottle library references before testing for built-in
|
||||
# references to the Cellar e.g. Qt's QMake annoyingly does this.
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
class Keg
|
||||
PREFIX_PLACEHOLDER = "@@HOMEBREW_PREFIX@@".freeze
|
||||
CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@".freeze
|
||||
|
||||
def fix_install_names options={}
|
||||
mach_o_files.each do |file|
|
||||
install_names_for(file, options) do |id, bad_names|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user