From b0560ca1310f99fcc4aecf1640c0d8f1ab760cf2 Mon Sep 17 00:00:00 2001 From: Antoine Gomez Date: Tue, 4 Mar 2025 11:20:25 +0000 Subject: [PATCH 1/2] Use HOMEBREW_PREFIX in defs.lua Some people install brew in another directory and have the HOMEBREW_PREFIX env variable set. Use it or fallback to the default path. --- lua/sqlite/defs.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/sqlite/defs.lua b/lua/sqlite/defs.lua index 06f75e07..fdc9f13a 100644 --- a/lua/sqlite/defs.lua +++ b/lua/sqlite/defs.lua @@ -48,8 +48,10 @@ local clib = (function() end if os.sysname == "Darwin" then - return os.machine == "arm64" and "/opt/homebrew/opt/sqlite/lib/libsqlite3.dylib" + local homebrew_prefix = luv.os_getenv "HOMEBREW_PREFIX" or "/opt/homebrew" + return os.machine == "arm64" and homebrew_prefix .. "/opt/sqlite/lib/libsqlite3.dylib" or "/usr/local/opt/sqlite3/lib/libsqlite3.dylib" + end end)() From bc7f7051b798c715f7f46678fb9ddea2623bb4c8 Mon Sep 17 00:00:00 2001 From: Antoine Gomez Date: Tue, 4 Mar 2025 11:21:29 +0000 Subject: [PATCH 2/2] Remove unnecessary blank line in defs.lua --- lua/sqlite/defs.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/sqlite/defs.lua b/lua/sqlite/defs.lua index fdc9f13a..3c40bcb1 100644 --- a/lua/sqlite/defs.lua +++ b/lua/sqlite/defs.lua @@ -51,7 +51,6 @@ local clib = (function() local homebrew_prefix = luv.os_getenv "HOMEBREW_PREFIX" or "/opt/homebrew" return os.machine == "arm64" and homebrew_prefix .. "/opt/sqlite/lib/libsqlite3.dylib" or "/usr/local/opt/sqlite3/lib/libsqlite3.dylib" - end end)()