aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Shaffer2014-07-27 10:01:07 -0600
committerMike McQuaid2014-07-27 17:18:12 +0100
commit6fc6a634d1021c97e302401cef5f3d62fd494efd (patch)
treee7ec92e9cff3bef87d98161b73203d39c7bd80c8
parentf5c0d18718c8387bb8dbf72bbada23a64f6f8a69 (diff)
downloadhomebrew-6fc6a634d1021c97e302401cef5f3d62fd494efd.tar.bz2
libspatialite 4.2.0
-rw-r--r--Library/Formula/libspatialite.rb34
1 files changed, 22 insertions, 12 deletions
diff --git a/Library/Formula/libspatialite.rb b/Library/Formula/libspatialite.rb
index afa335339..813eef3cd 100644
--- a/Library/Formula/libspatialite.rb
+++ b/Library/Formula/libspatialite.rb
@@ -2,8 +2,8 @@ require 'formula'
class Libspatialite < Formula
homepage 'https://www.gaia-gis.it/fossil/libspatialite/index'
- url 'http://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-4.1.1.tar.gz'
- sha1 'b8ed50fb66c4a898867cdf9d724d524c5e27e8aa'
+ url "http://www.gaia-gis.it/gaia-sins/libspatialite-4.2.0.tar.gz"
+ sha1 "698bf70bec669ddcbf1b0cc48f40c2e03776bffc"
bottle do
cellar :any
@@ -22,7 +22,8 @@ class Libspatialite < Formula
option 'without-freexl', 'Build without support for reading Excel files'
option 'without-libxml2', 'Disable support for xml parsing (parsing needed by spatialite-gui)'
option 'without-liblwgeom', 'Build without additional sanitization/segmentation routines provided by PostGIS 2.0+ library'
- option "with-geopackage", "Build with experimental OGC GeoPackage support"
+ option "without-geopackage", "Build without OGC GeoPackage support"
+ option "without-check", "Do not run `make check` prior to installing"
depends_on 'pkg-config' => :build
depends_on 'proj'
@@ -36,13 +37,15 @@ class Libspatialite < Formula
depends_on 'liblwgeom' => :recommended
def install
- 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
+ system "autoreconf", "-fi" if build.head?
+
+ # New SQLite3 extension won't load via SELECT load_extension('mod_spatialite');
+ # unless named mod_spatialite.dylib (should actually be mod_spatialite.bundle)
+ # See: https://groups.google.com/forum/#!topic/spatialite-users/EqJAB8FYRdI
+ # needs upstream fixes in both SQLite and libtool
+ inreplace "configure",
+ "shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'",
+ "shrext_cmds='.dylib'"
# Ensure Homebrew's libsqlite is found before the system version.
sqlite = Formula["sqlite"]
@@ -60,13 +63,20 @@ class Libspatialite < Formula
--prefix=#{prefix}
--with-sysroot=#{HOMEBREW_PREFIX}
]
+ args << "--enable-geocallbacks"
args << '--enable-freexl=no' if build.without? 'freexl'
- args << '--enable-libxml2=yes' if build.with? 'libxml2'
+ args << "--enable-libxml2=no" if build.without? "libxml2"
args << '--enable-lwgeom=yes' if build.with? 'liblwgeom'
- args << "--enable-geopackage=yes" if build.with? "geopackage"
+ args << "--enable-geopackage=no" if build.without? "geopackage"
system './configure', *args
+ system "make", "check" if build.with? "check"
system "make", "install"
end
+ test do
+ # Verify mod_spatialite extension can be loaded using Homebrew's SQLite
+ system "echo \"SELECT load_extension('#{opt_lib}/mod_spatialite');\" | #{Formula["sqlite"].opt_bin}/sqlite3"
+ end
+
end