2010-01-11 12:28:55 +00:00
|
|
|
require 'formula'
|
|
|
|
|
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'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'a88c763302aabc3b74d44a88f969c8475f0c0d10'
|
2012-01-08 21:49:07 +00:00
|
|
|
|
2012-09-05 18:23:40 +00:00
|
|
|
devel do
|
2012-12-05 03:43:09 +00:00
|
|
|
url 'http://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-4.0.0.tar.gz'
|
|
|
|
sha1 '3d20fcabcc5a951e7863d33b6b6ef3f78dbf006d'
|
2012-09-05 18:23:40 +00:00
|
|
|
end
|
|
|
|
|
2012-09-02 08:05:09 +00:00
|
|
|
option 'without-freexl', 'Build without support for reading Excel files'
|
2012-09-05 18:23:40 +00:00
|
|
|
option 'with-lwgeom', 'Enable additional sanitization/segmentation routines provided by PostGIS 2.0+. (--devel builds only)'
|
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-09-02 08:05:09 +00:00
|
|
|
depends_on 'freexl' unless build.include? 'without-freexl'
|
2012-09-05 18:23:40 +00:00
|
|
|
depends_on 'postgis' if build.include? 'with-lwgeom' and build.devel?
|
2012-01-08 21:49:07 +00:00
|
|
|
|
2010-01-11 12:28:55 +00:00
|
|
|
def install
|
2012-05-07 17:49:48 +00:00
|
|
|
# Ensure Homebrew's libsqlite is found before the system version.
|
2012-11-11 20:30:45 +00:00
|
|
|
sqlite = Formula.factory 'sqlite'
|
|
|
|
ENV.append 'LDFLAGS', "-L#{sqlite.opt_prefix}/lib"
|
2012-05-07 17:49:48 +00:00
|
|
|
|
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
|
|
|
]
|
2012-09-02 08:05:09 +00:00
|
|
|
args << '--enable-freexl=no' if build.include? 'without-freexl'
|
2012-09-05 18:23:40 +00:00
|
|
|
args << '--enable-lwgeom' if build.include? 'with-lwgeom' and build.devel?
|
2012-01-08 21:49:07 +00:00
|
|
|
|
|
|
|
system './configure', *args
|
2010-01-11 12:28:55 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2012-12-05 03:43:09 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Note that the SpatiaLite 4.x series is not compatible with QGIS 1.8.0 or
|
|
|
|
GDAL 1.9.2. Hopefully this situation will improve in future releases.
|
|
|
|
EOS
|
|
|
|
end if build.devel?
|
|
|
|
|
2010-01-11 12:28:55 +00:00
|
|
|
end
|