Clean up lib path searching for Spatialite

Anything linking against SpatiaLite also needs to use Homebrew's SQLite so that
loadable extensions are enabled along with RTree indices.

This commit cleans up several formulae to use the specific `opt/sqlite/lib`
prefix rather than `HOMEBREW_PREFIX/lib` and also adds this searching to
`gdal`.

However, this hack is getting a little large. The best fix would probably be to
flag SQLite as `keg_only` so that lib path munging is handled automagically for
everything with a dependency tree that includes SQLite.
master
Charlie Sharpsteen 2012-11-11 12:30:45 -08:00
parent 21c9880039
commit b4befaf35f
4 changed files with 10 additions and 5 deletions

View File

@ -210,10 +210,12 @@ class Gdal < Formula
def install
# Linking flags for SQLite are not added at a critical moment when the GDAL
# library is being assembled. This causes the build to fail due to missing
# symbols.
# symbols. Also, ensure Homebrew SQLite is used so that Spatialite is
# functional.
#
# Fortunately, this can be remedied using LDFLAGS.
ENV.append 'LDFLAGS', '-lsqlite3'
sqlite = Formula.factory 'sqlite'
ENV.append 'LDFLAGS', "-L#{sqlite.opt_prefix}/lib -lsqlite3"
# Needed by libdap.
ENV.append 'CPPFLAGS', '-I/usr/include/libxml2' if complete?

View File

@ -12,7 +12,8 @@ class Librasterlite < Formula
def install
# Ensure Homebrew SQLite libraries are found before the system SQLite
ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
sqlite = Formula.factory 'sqlite'
ENV.append 'LDFLAGS', "-L#{sqlite.opt_prefix}/lib"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"

View File

@ -25,7 +25,8 @@ class Libspatialite < Formula
def install
# Ensure Homebrew's libsqlite is found before the system version.
ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
sqlite = Formula.factory 'sqlite'
ENV.append 'LDFLAGS', "-L#{sqlite.opt_prefix}/lib"
args = %W[
--disable-dependency-tracking

View File

@ -19,7 +19,8 @@ class SpatialiteTools < Formula
# See: https://github.com/mxcl/homebrew/issues/3328
ENV.append 'LDFLAGS', '-liconv'
# Ensure Homebrew SQLite is found before system SQLite.
ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
sqlite = Formula.factory 'sqlite'
ENV.append 'LDFLAGS', "-L#{sqlite.opt_prefix}/lib"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"