Skip to content

Commit

Permalink
dev: add ability to build against an arbitrary sqlite source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Nov 10, 2022
1 parent 12fc329 commit a8f4010
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ext/sqlite3/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit a8f4010

Please sign in to comment.