PostGIS: Add --with-gui option

Builds the GKT+ based GUI for loading shapefiles into a database.
This commit is contained in:
Charlie Sharpsteen 2012-02-16 23:43:48 -08:00
parent 084339d9fe
commit 49cd1f054d

View file

@ -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[