From 13cb5ce84fd62fd705b23e840451378c4bbebb62 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 8 Oct 2024 17:27:44 +0900 Subject: [PATCH] macos: detect DuckDB paths automatically --- ext/arrow-duckdb/extconf.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/arrow-duckdb/extconf.rb b/ext/arrow-duckdb/extconf.rb index 5ee7181..0077aea 100644 --- a/ext/arrow-duckdb/extconf.rb +++ b/ext/arrow-duckdb/extconf.rb @@ -16,7 +16,7 @@ require "mkmf-gnome" require "native-package-installer" -checking_for(checking_message("Homebrew")) do +homebrew = checking_for(checking_message("Homebrew")) do case NativePackageInstaller::Platform.detect when NativePackageInstaller::Platform::Homebrew openssl_prefix = `brew --prefix openssl`.chomp @@ -40,6 +40,10 @@ install_missing_native_package(debian: "libduckdb-dev", redhat: "duckdb-devel", homebrew: "duckdb") or exit(false) + if homebrew + $INCFLAGS << " -I" << File.join(`brew --prefix duckdb`.chomp, "include") + $LIBPATH |= [File.join(`brew --prefix duckdb`.chomp, "lib")] + end have_library("duckdb") or exit(false) end