Skip to content

Commit a8f4010

Browse files
committed
dev: add ability to build against an arbitrary sqlite source tree
1 parent 12fc329 commit a8f4010

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

ext/sqlite3/extconf.rb

+14-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@ def configure_extension
126126

127127
def minimal_recipe
128128
MiniPortile.new(libname, sqlite3_config[:version]).tap do |recipe|
129-
recipe.files = sqlite3_config[:files]
130-
recipe.target = File.join(package_root_dir, "ports")
131-
recipe.patch_files = Dir[File.join(package_root_dir, "patches", "*.patch")].sort
129+
if sqlite_source_dir
130+
recipe.source_directory = sqlite_source_dir
131+
else
132+
recipe.files = sqlite3_config[:files]
133+
recipe.target = File.join(package_root_dir, "ports")
134+
recipe.patch_files = Dir[File.join(package_root_dir, "patches", "*.patch")].sort
135+
end
132136
end
133137
end
134138

@@ -157,6 +161,10 @@ def cross_build?
157161
enable_config("cross-build")
158162
end
159163

164+
def sqlite_source_dir
165+
arg_config("--with-sqlite-source-dir")
166+
end
167+
160168
def download
161169
minimal_recipe.download
162170
end
@@ -178,6 +186,9 @@ def print_help
178186
Use libsqlcipher instead of libsqlite3.
179187
(Implies `--enable-system-libraries`.)
180188
189+
--with-sqlite-source-dir=DIRECTORY
190+
(dev only) Build sqlite from the source code in DIRECTORY
191+
181192
--help
182193
Display this message.
183194

0 commit comments

Comments
 (0)