From a8f4010fd8213ca95517ccd0d0758bdbd5cacb50 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 10 Nov 2022 09:31:07 -0500 Subject: [PATCH] dev: add ability to build against an arbitrary sqlite source tree --- ext/sqlite3/extconf.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ext/sqlite3/extconf.rb b/ext/sqlite3/extconf.rb index a47849fe..c492d20d 100644 --- a/ext/sqlite3/extconf.rb +++ b/ext/sqlite3/extconf.rb @@ -126,9 +126,13 @@ def configure_extension def minimal_recipe MiniPortile.new(libname, sqlite3_config[:version]).tap do |recipe| - recipe.files = sqlite3_config[:files] - recipe.target = File.join(package_root_dir, "ports") - recipe.patch_files = Dir[File.join(package_root_dir, "patches", "*.patch")].sort + if sqlite_source_dir + recipe.source_directory = sqlite_source_dir + else + recipe.files = sqlite3_config[:files] + recipe.target = File.join(package_root_dir, "ports") + recipe.patch_files = Dir[File.join(package_root_dir, "patches", "*.patch")].sort + end end end @@ -157,6 +161,10 @@ def cross_build? enable_config("cross-build") end + def sqlite_source_dir + arg_config("--with-sqlite-source-dir") + end + def download minimal_recipe.download end @@ -178,6 +186,9 @@ def print_help Use libsqlcipher instead of libsqlite3. (Implies `--enable-system-libraries`.) + --with-sqlite-source-dir=DIRECTORY + (dev only) Build sqlite from the source code in DIRECTORY + --help Display this message.