Symlink ld.so [Linux]
This commit is contained in:
parent
dae47914ca
commit
c0f07db656
1
Library/Homebrew/extend/os/install.rb
Normal file
1
Library/Homebrew/extend/os/install.rb
Normal file
@ -0,0 +1 @@
|
|||||||
|
require "extend/os/linux/install" if OS.linux?
|
||||||
34
Library/Homebrew/extend/os/linux/install.rb
Normal file
34
Library/Homebrew/extend/os/linux/install.rb
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
module Homebrew
|
||||||
|
module Install
|
||||||
|
module_function
|
||||||
|
|
||||||
|
DYNAMIC_LINKERS = [
|
||||||
|
"/lib64/ld-linux-x86-64.so.2",
|
||||||
|
"/lib/ld-linux.so.3",
|
||||||
|
"/lib/ld-linux.so.2",
|
||||||
|
"/lib/ld-linux-aarch64.so.1",
|
||||||
|
"/lib/ld-linux-armhf.so.3",
|
||||||
|
"/system/bin/linker64",
|
||||||
|
"/system/bin/linker",
|
||||||
|
].freeze
|
||||||
|
|
||||||
|
def symlink_ld_so
|
||||||
|
brew_ld_so = HOMEBREW_PREFIX/"lib/ld.so"
|
||||||
|
return if brew_ld_so.readable?
|
||||||
|
|
||||||
|
ld_so = HOMEBREW_PREFIX/"opt/glibc/lib/ld-linux-x86-64.so.2"
|
||||||
|
unless ld_so.readable?
|
||||||
|
ld_so = DYNAMIC_LINKERS.find { |s| File.executable? s }
|
||||||
|
raise "Unable to locate the system's dynamic linker" unless ld_so
|
||||||
|
end
|
||||||
|
|
||||||
|
FileUtils.mkdir_p HOMEBREW_PREFIX/"lib"
|
||||||
|
FileUtils.ln_sf ld_so, brew_ld_so
|
||||||
|
end
|
||||||
|
|
||||||
|
def perform_preinstall_checks
|
||||||
|
generic_perform_preinstall_checks
|
||||||
|
symlink_ld_so
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -36,6 +36,8 @@ module Homebrew
|
|||||||
attempt_directory_creation
|
attempt_directory_creation
|
||||||
fatal_checks(:fatal_install_checks)
|
fatal_checks(:fatal_install_checks)
|
||||||
end
|
end
|
||||||
|
alias generic_perform_preinstall_checks perform_preinstall_checks
|
||||||
|
module_function :generic_perform_preinstall_checks
|
||||||
|
|
||||||
def fatal_checks(type)
|
def fatal_checks(type)
|
||||||
@checks ||= Diagnostic::Checks.new
|
@checks ||= Diagnostic::Checks.new
|
||||||
@ -51,3 +53,5 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require "extend/os/install"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user