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'
|
2013-07-10 03:51:13 +00:00
|
|
|
url 'http://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-4.1.1.tar.gz'
|
|
|
|
sha1 'b8ed50fb66c4a898867cdf9d724d524c5e27e8aa'
|
2012-09-05 18:23:40 +00:00
|
|
|
|
2014-04-10 10:40:32 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 "07ce6d5b8eed256daca45f7159d90b4a4907b986" => :mavericks
|
|
|
|
sha1 "cfb030a596a069d726be7c98d4be98005fc6a727" => :mountain_lion
|
|
|
|
sha1 "1c7f5843303e20d7314fc827b66c8d62bcbab5aa" => :lion
|
|
|
|
end
|
|
|
|
|
2014-01-02 04:32:39 +00:00
|
|
|
head do
|
|
|
|
url "fossil://https://www.gaia-gis.it/fossil/libspatialite"
|
2014-06-02 02:38:17 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2014-01-02 04:32:39 +00:00
|
|
|
end
|
|
|
|
|
2012-09-02 08:05:09 +00:00
|
|
|
option 'without-freexl', 'Build without support for reading Excel files'
|
2013-07-10 03:51:13 +00:00
|
|
|
option 'without-libxml2', 'Disable support for xml parsing (parsing needed by spatialite-gui)'
|
2013-11-14 06:34:08 +00:00
|
|
|
option 'without-liblwgeom', 'Build without additional sanitization/segmentation routines provided by PostGIS 2.0+ library'
|
2014-01-02 04:32:39 +00:00
|
|
|
option "with-geopackage", "Build with experimental OGC GeoPackage support"
|
2010-01-11 12:28:55 +00:00
|
|
|
|
2013-07-10 03:51:13 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
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'
|
2013-07-10 03:51:13 +00:00
|
|
|
depends_on 'libxml2' => :recommended
|
2013-06-08 01:58:42 +00:00
|
|
|
depends_on 'freexl' => :recommended
|
2013-11-14 06:34:08 +00:00
|
|
|
depends_on 'liblwgeom' => :recommended
|
2012-01-08 21:49:07 +00:00
|
|
|
|
2010-01-11 12:28:55 +00:00
|
|
|
def install
|
2014-01-02 04:32:39 +00:00
|
|
|
if build.head?
|
|
|
|
system "autoreconf", "-fi"
|
|
|
|
# new SQLite3 extension won't load via just 'spatialite' unless named spatialite.dylib
|
|
|
|
inreplace "configure",
|
|
|
|
"shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'",
|
|
|
|
"shrext_cmds='.dylib'"
|
|
|
|
end
|
|
|
|
|
2012-05-07 17:49:48 +00:00
|
|
|
# Ensure Homebrew's libsqlite is found before the system version.
|
2014-02-27 03:05:01 +00:00
|
|
|
sqlite = Formula["sqlite"]
|
2014-03-06 05:28:31 +00:00
|
|
|
ENV.append 'LDFLAGS', "-L#{sqlite.opt_lib}"
|
|
|
|
ENV.append 'CFLAGS', "-I#{sqlite.opt_include}"
|
2012-05-07 17:49:48 +00:00
|
|
|
|
2014-03-06 20:40:26 +00:00
|
|
|
if build.with? 'liblwgeom'
|
2014-02-27 03:05:01 +00:00
|
|
|
lwgeom = Formula["liblwgeom"]
|
2014-03-06 05:28:31 +00:00
|
|
|
ENV.append 'LDFLAGS', "-L#{lwgeom.opt_lib}"
|
|
|
|
ENV.append 'CFLAGS', "-I#{lwgeom.opt_include}"
|
2013-11-14 06:34:08 +00:00
|
|
|
end
|
|
|
|
|
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
|
|
|
]
|
2013-06-08 01:58:42 +00:00
|
|
|
args << '--enable-freexl=no' if build.without? 'freexl'
|
2014-03-06 20:40:26 +00:00
|
|
|
args << '--enable-libxml2=yes' if build.with? 'libxml2'
|
|
|
|
args << '--enable-lwgeom=yes' if build.with? 'liblwgeom'
|
2014-01-02 04:32:39 +00:00
|
|
|
args << "--enable-geopackage=yes" if build.with? "geopackage"
|
2012-01-08 21:49:07 +00:00
|
|
|
|
|
|
|
system './configure', *args
|
2014-01-02 04:32:39 +00:00
|
|
|
system "make", "install"
|
2010-01-11 12:28:55 +00:00
|
|
|
end
|
2012-12-05 03:43:09 +00:00
|
|
|
|
2010-01-11 12:28:55 +00:00
|
|
|
end
|