Skip to content

Commit

Permalink
Add /opt/homebrew to search path on Apple Silicon
Browse files Browse the repository at this point in the history
This is default directory for Homebrew on Apple Silicon. Intel Mac installs into `/usr/local`, which is in our default path.

Co-authored-by: Caleb Land <[email protected]>
  • Loading branch information
andyundso and caleb committed Dec 3, 2023
1 parent bb696e2 commit c467d2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Fix segfault when asking if client was dead after closing it. Fixes #519.
* Mark `alloc` function as undefined on `TinyTds::Result`. Fixes #515.
* Fix Gem installation on Windows by adding default freetds msys path. Fixes #522
* Search for `freetds` in `/opt/homebrew` when installing on Apple Silicon. Fixes #484, #492 and #508.

## 2.1.5

Expand Down
7 changes: 7 additions & 0 deletions ext/tiny_tds/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ def do_help
/usr/local
)

# Homebrew on Apple Silicon installs into /opt/hombrew
# https://docs.brew.sh/Installation
# On Intel Macs, it is /usr/local, so no changes necessary to DIRS
if RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host_cpu'] == 'arm64'
DIRS.unshift("/opt/homebrew")
end

if ENV["RI_DEVKIT"] && ENV["MINGW_PREFIX"] # RubyInstaller Support
DIRS.unshift(File.join(ENV["RI_DEVKIT"], ENV["MINGW_PREFIX"]))
end
Expand Down

0 comments on commit c467d2c

Please sign in to comment.