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.