aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sqlite.rb
diff options
context:
space:
mode:
authorDan Loewenherz2014-05-15 13:55:12 -0500
committerAdam Vandenberg2014-05-16 07:10:46 -0700
commit274d4751b69007f4246a8907777e953dc33c4034 (patch)
treec2cb30083b11b5265934e36cdcc6e96497b3bc70 /Library/Formula/sqlite.rb
parentb623d43a14dccff6de23d4e8653ace26be23dd98 (diff)
downloadhomebrew-274d4751b69007f4246a8907777e953dc33c4034.tar.bz2
sqlite: add ICU extension
This commit adds the option to integrate the "International Components for Unicode" library for SQLite. See https://www.sqlite.org/src/artifact?ci=trunk&filename=ext/icu/README.txt for more information. Closes #29285. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/sqlite.rb')
-rw-r--r--Library/Formula/sqlite.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Formula/sqlite.rb b/Library/Formula/sqlite.rb
index 73a2604b9..a99f22c97 100644
--- a/Library/Formula/sqlite.rb
+++ b/Library/Formula/sqlite.rb
@@ -19,9 +19,11 @@ class Sqlite < Formula
option 'with-docs', 'Install HTML documentation'
option 'without-rtree', 'Disable the R*Tree index module'
option 'with-fts', 'Enable the FTS module'
+ option 'with-icu4c', 'Enable the ICU module'
option 'with-functions', 'Enable more math and string functions for SQL queries'
depends_on 'readline' => :recommended
+ depends_on 'icu4c' => :optional
resource 'functions' do
url 'http://www.sqlite.org/contrib/download/extension-functions.c?get=25', :using => :nounzip
@@ -40,6 +42,15 @@ class Sqlite < Formula
ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS" if build.with? "fts"
ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_COLUMN_METADATA"
+ if build.with? "icu4c"
+ icu4c = Formula['icu4c']
+ icu4cldflags = `#{icu4c.opt_bin}/icu-config --ldflags`.tr("\n", " ")
+ icu4ccppflags = `#{icu4c.opt_bin}/icu-config --cppflags`.tr("\n", " ")
+ ENV.append "LDFLAGS", icu4cldflags
+ ENV.append "CPPFLAGS", icu4ccppflags
+ ENV.append 'CPPFLAGS', "-DSQLITE_ENABLE_ICU"
+ end
+
ENV.universal_binary if build.universal?
system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking", "--enable-dynamic-extensions"