diff options
| author | Larry Shaffer | 2013-11-13 17:38:23 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-11-24 16:11:35 -0800 |
| commit | 85d587fefe34c4974bed33b912dcdf8c5f5766f8 (patch) | |
| tree | 9173d7e11a947802f4a2b28bc360b1331991b50c /Library/Formula | |
| parent | be97d15d56c94e13144a25835bf29001a148bd0a (diff) | |
| download | homebrew-85d587fefe34c4974bed33b912dcdf8c5f5766f8.tar.bz2 | |
liblwgeom: new formula to build just liblwgeom from postgis, without requiring postgresql or gdal
Closes #24280.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/liblwgeom.rb | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Library/Formula/liblwgeom.rb b/Library/Formula/liblwgeom.rb new file mode 100644 index 000000000..45a38d8ae --- /dev/null +++ b/Library/Formula/liblwgeom.rb @@ -0,0 +1,63 @@ +require 'formula' + +class Liblwgeom < Formula + homepage 'http://postgis.net' + url 'http://download.osgeo.org/postgis/source/postgis-2.1.1.tar.gz' + sha1 'eaff009fb22b8824f89e5aa581e8b900c5d8f65b' + + head 'http://svn.osgeo.org/postgis/trunk/' + + keg_only "Conflicts with PostGIS, which also installs liblwgeom.dylib" + + depends_on :autoconf => :build + depends_on :automake => :build + depends_on :libtool => :build + depends_on 'gpp' => :build + + depends_on 'postgresql' => :build if build.head? # don't maintain patches for HEAD + depends_on 'proj' + depends_on 'geos' + depends_on 'json-c' + + def patches + if build.stable? + # Strip all the PostgreSQL functions from PostGIS configure.ac, to allow + # building liblwgeom.dylib without needing PostgreSQL + # NOTE: this will need to be maintained per postgis version + "https://gist.github.com/dakcarto/7458788/raw" + end + end + + def install + # See postgis.rb for comments about these settings + ENV.deparallelize + + args = [ + "--disable-dependency-tracking", + "--disable-nls", + + "--with-projdir=#{HOMEBREW_PREFIX}", + "--with-jsondir=#{Formula.factory('json-c').opt_prefix}", + + # Disable extraneous support + "--without-libiconv-prefix", + "--without-libintl-prefix", + "--without-raster", # this ensures gdal is not required + "--without-topology" + ] + + args << "--with-pgconfig=#{Formula.factory('postgresql').opt_prefix.realpath}/bin/pg_config" if build.head? + + system './autogen.sh' + system './configure', *args + + mkdir 'stage' + cd 'liblwgeom' do + system 'make', 'install', "DESTDIR=#{buildpath}/stage" + end + + # NOTE: lib.install Dir['stage/**/lib/*'] fails (symlink is not resolved) + prefix.install Dir["stage/**/lib"] + include.install Dir["stage/**/include/*"] + end +end |
