Skip to content

Commit

Permalink
virtualpg 1.0.1
Browse files Browse the repository at this point in the history
- Upgrade to version 1.0.1
- Take advantage of compile options for non-canonical postgresql
  installs
- Fix link file extension to use dylib
- Add test of loading extension for sqlite3
- Closes Homebrew/legacy-homebrew#32042
  • Loading branch information
Griffith Rees authored and MikeMcQuaid committed Sep 15, 2014
1 parent e383f2d commit 49a15b2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Formula/virtualpg.rb
Expand Up @@ -2,16 +2,31 @@

class Virtualpg < Formula
homepage 'https://www.gaia-gis.it/fossil/virtualpg/index'
url 'http://www.gaia-gis.it/gaia-sins/virtualpg-1.0.0.tar.gz'
sha1 '8c7959beb1cff78d3c00255fe73c748d1a5b250b'
url 'http://www.gaia-gis.it/gaia-sins/virtualpg-1.0.1.tar.gz'
sha1 '20849c368a2bef3e8532765589d0b6b445d56908'

depends_on 'libspatialite'
depends_on 'postgis'

def install

# New SQLite3 extension won't load via SELECT load_extension('mod_virtualpg');
# unless named mod_virtualpg.dylib (should actually be mod_virtualpg.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'"

system "./configure", "--enable-shared=yes",
"--disable-dependency-tracking",
"--with-pgconfig=#{Formula["postgresql"].opt_bin}/pg_config",
"--prefix=#{prefix}"
system "make", "install"
end

test do
# Verify mod_virtualpg extension can be loaded using Homebrew's SQLite
system "echo \"SELECT load_extension('#{opt_lib}/mod_virtualpg');\" | #{Formula["sqlite"].opt_bin}/sqlite3"
end
end

0 comments on commit 49a15b2

Please sign in to comment.