2010-01-11 12:28:55 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-01-08 21:49:07 +00:00
|
|
|
def without_freexl?
|
|
|
|
ARGV.include? '--without-freexl'
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Libspatialite < Formula
|
2012-01-08 21:49:07 +00:00
|
|
|
homepage 'https://www.gaia-gis.it/fossil/libspatialite/index'
|
2012-05-07 17:49:48 +00:00
|
|
|
url 'http://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-3.0.1.tar.gz'
|
|
|
|
md5 '450d1a0d9da1bd9f770b7db3f2509f69'
|
2012-01-08 21:49:07 +00:00
|
|
|
|
|
|
|
def options
|
|
|
|
[['--without-freexl', 'Build without support for reading Excel files']]
|
|
|
|
end
|
2010-01-11 12:28:55 +00:00
|
|
|
|
|
|
|
depends_on 'proj'
|
|
|
|
depends_on 'geos'
|
2012-05-07 17:49:48 +00:00
|
|
|
# Needs SQLite > 3.7.3 which rules out system SQLite on Snow Leopard and
|
|
|
|
# below. Also needs dynamic extension support which rules out system SQLite
|
|
|
|
# on Lion. Finally, RTree index support is required as well.
|
|
|
|
depends_on 'sqlite'
|
2010-01-11 12:28:55 +00:00
|
|
|
|
2012-01-08 21:49:07 +00:00
|
|
|
depends_on 'freexl' unless without_freexl?
|
|
|
|
|
2010-01-11 12:28:55 +00:00
|
|
|
def install
|
2011-11-14 20:59:53 +00:00
|
|
|
# O2 and O3 leads to corrupt/invalid rtree indexes
|
|
|
|
# http://groups.google.com/group/spatialite-users/browse_thread/thread/8e1cfa79f2d02a00#
|
|
|
|
ENV.Os
|
2012-05-07 17:49:48 +00:00
|
|
|
# Ensure Homebrew's libsqlite is found before the system version.
|
|
|
|
ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
|
|
|
|
|
2012-01-08 21:49:07 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
2012-05-07 17:49:48 +00:00
|
|
|
--with-sysroot=#{HOMEBREW_PREFIX}
|
2012-01-08 21:49:07 +00:00
|
|
|
]
|
|
|
|
args << '--enable-freexl=no' if without_freexl?
|
|
|
|
|
|
|
|
system './configure', *args
|
2010-01-11 12:28:55 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|