Skip to content

Commit c467d2c

Browse files
andyundsocaleb
andcommitted
Add /opt/homebrew to search path on Apple Silicon
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]>
1 parent bb696e2 commit c467d2c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Fix segfault when asking if client was dead after closing it. Fixes #519.
55
* Mark `alloc` function as undefined on `TinyTds::Result`. Fixes #515.
66
* Fix Gem installation on Windows by adding default freetds msys path. Fixes #522
7+
* Search for `freetds` in `/opt/homebrew` when installing on Apple Silicon. Fixes #484, #492 and #508.
78

89
## 2.1.5
910

ext/tiny_tds/extconf.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ def do_help
3535
/usr/local
3636
)
3737

38+
# Homebrew on Apple Silicon installs into /opt/hombrew
39+
# https://docs.brew.sh/Installation
40+
# On Intel Macs, it is /usr/local, so no changes necessary to DIRS
41+
if RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host_cpu'] == 'arm64'
42+
DIRS.unshift("/opt/homebrew")
43+
end
44+
3845
if ENV["RI_DEVKIT"] && ENV["MINGW_PREFIX"] # RubyInstaller Support
3946
DIRS.unshift(File.join(ENV["RI_DEVKIT"], ENV["MINGW_PREFIX"]))
4047
end

0 commit comments

Comments
 (0)