From 49cd1f054d8b2d882e2669b3de2fca126e621368 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Thu, 16 Feb 2012 23:43:48 -0800 Subject: [PATCH] PostGIS: Add --with-gui option Builds the GKT+ based GUI for loading shapefiles into a database. --- Formula/postgis.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Formula/postgis.rb b/Formula/postgis.rb index d3e52ea523..2f40299e65 100644 --- a/Formula/postgis.rb +++ b/Formula/postgis.rb @@ -1,5 +1,9 @@ require 'formula' +def build_gui? + ARGV.include? '--with-gui' +end + class Postgis < Formula url 'http://postgis.refractions.net/download/postgis-1.5.3.tar.gz' homepage 'http://postgis.refractions.net/' @@ -17,12 +21,20 @@ class Postgis < Formula depends_on 'proj' depends_on 'geos' + depends_on 'gtk+' if build_gui? + # For GeoJSON and raster handling if ARGV.build_head? or ARGV.build_devel? depends_on 'gdal' depends_on 'json-c' end + def options + [ + ['--with-gui', 'Build shp2pgsql-gui in addition to command line tools'] + ] + end + # PostGIS command line tools intentionally have unused symbols in # them---these are callbacks for liblwgeom. skip_clean :all @@ -40,6 +52,7 @@ class Postgis < Formula # Postgresql keg. "--with-pgconfig=#{postgresql.bin}/pg_config" ] + args << '--with-gui' if build_gui? if ARGV.build_head? or ARGV.build_devel? jsonc = Formula.factory 'json-c' @@ -91,6 +104,7 @@ class Postgis < Formula loader/.libs/shp2pgsql raster/loader/.libs/raster2pgsql ] + bin.install 'loader/.libs/shp2pgsql-gui' if build_gui? # Install PostGIS 2.0 SQL scripts postgis_sql.install %w[ @@ -120,6 +134,7 @@ class Postgis < Formula loader/shp2pgsql utils/new_postgis_restore.pl ] + bin.install 'loader/shp2pgsql-gui' if build_gui? # Install PostGIS 1.x upgrade scripts postgis_sql.install %w[