summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOle Michaelis <Ole.Michaelis@googlemail.com>2021-02-12 18:20:14 +0100
committerGitHub <noreply@github.com>2021-02-12 18:20:14 +0100
commit5c0a3279adfa402544f0714bfd6bd12382defebb (patch)
tree1d1065c6086a09def1979ec1b3a9cde6510d3270
parent3f862ca78ec4e6c2a5eabca8a5f7780d1774c1a0 (diff)
downloadffi-5c0a3279adfa402544f0714bfd6bd12382defebb.tar.gz
dynlib support for homebrew 3 on Apple Silicon M1
As the homebrew team discussed in https://github.com/Homebrew/brew/issues/9177 the new library path for homebrew on apple silicon is `/opt/homebrew/lib`. Alongside the PR to support MacPorts https://github.com/ffi/ffi/pull/638 this commits adds support for the new homebrew path.
-rw-r--r--lib/ffi/library.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ffi/library.rb b/lib/ffi/library.rb
index c6f9654..1f8602b 100644
--- a/lib/ffi/library.rb
+++ b/lib/ffi/library.rb
@@ -126,7 +126,7 @@ module FFI
else
# TODO better library lookup logic
unless libname.start_with?("/") || FFI::Platform.windows?
- path = ['/usr/lib/','/usr/local/lib/','/opt/local/lib/'].find do |pth|
+ path = ['/usr/lib/','/usr/local/lib/','/opt/local/lib/', '/opt/homebrew/lib/'].find do |pth|
File.exist?(pth + libname)
end
if path