Skip to content

Commit

Permalink
dynlib support for homebrew 3 on Apple Silicon M1
Browse files Browse the repository at this point in the history
As the homebrew team discussed in Homebrew/brew#9177 the new library path for homebrew on apple silicon is `/opt/homebrew/lib`. Alongside the PR to support MacPorts ffi#638 this commits adds support for the new homebrew path.
  • Loading branch information
OleMchls committed Feb 12, 2021
1 parent 3f862ca commit 5c0a327
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ffi/library.rb
Expand Up @@ -126,7 +126,7 @@ def ffi_lib(*names)
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
Expand Down

0 comments on commit 5c0a327

Please sign in to comment.