aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2012-12-05 13:12:38 -0800
committerCharlie Sharpsteen2012-12-05 23:55:30 -0800
commit015b732e87aa4537c08a99ab5c00b1f34bd948e6 (patch)
tree8719db95b73b5f10b29b82f7994969287bfc62ce /Library
parent40591d944328b6561bf87f52375e4921faf71035 (diff)
downloadhomebrew-015b732e87aa4537c08a99ab5c00b1f34bd948e6.tar.bz2
postgis: Depend on GPP for SQL preprocessing
PostGIS contains a few statements in its SQL files that choke the Clang pre-processor. This commit forces PostGIS to use GPP for SQL pre-processing.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/postgis.rb40
1 files changed, 35 insertions, 5 deletions
diff --git a/Library/Formula/postgis.rb b/Library/Formula/postgis.rb
index ec0182c1f..79b43545c 100644
--- a/Library/Formula/postgis.rb
+++ b/Library/Formula/postgis.rb
@@ -11,11 +11,10 @@ class Postgis < Formula
head 'http://svn.osgeo.org/postgis/trunk/'
- if ARGV.build_head?
- depends_on :automake
- depends_on :libtool
- end
+ depends_on :automake
+ depends_on :libtool
+ depends_on 'gpp' => :build
depends_on 'postgresql'
depends_on 'proj'
depends_on 'geos'
@@ -38,6 +37,10 @@ class Postgis < Formula
Formula.factory('postgresql').linked_keg.realpath
end
+ # Force GPP to be used when pre-processing SQL files. See:
+ # http://trac.osgeo.org/postgis/ticket/1694
+ def patches; DATA end
+
def install
ENV.deparallelize
jsonc = Formula.factory 'json-c'
@@ -61,7 +64,7 @@ class Postgis < Formula
args << '--with-gui' if build_gui?
- system './autogen.sh' if ARGV.build_head?
+ system './autogen.sh'
system './configure', *args
system 'make'
@@ -120,3 +123,30 @@ class Postgis < Formula
EOS
end
end
+__END__
+Force usage of GPP as the SQL pre-processor as Clang chokes.
+
+diff --git a/configure.ac b/configure.ac
+index 136a1d6..c953c69 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -31,17 +31,8 @@ AC_SUBST([ANT])
+ dnl
+ dnl SQL Preprocessor
+ dnl
+-AC_PATH_PROG([CPPBIN], [cpp], [])
+-if test "x$CPPBIN" != "x"; then
+- SQLPP="${CPPBIN} -traditional-cpp -P"
+-else
+- AC_PATH_PROG([GPP], [gpp_], [])
+- if test "x$GPP" != "x"; then
+- SQLPP="${GPP} -C -s \'" dnl Use better string support
+- else
+- SQLPP="${CPP} -traditional-cpp"
+- fi
+-fi
++AC_PATH_PROG([GPP], [gpp], [])
++SQLPP="${GPP} -C -s \'" dnl Use better string support
+ AC_SUBST([SQLPP])
+
+ dnl