aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/postgresql.rb
diff options
context:
space:
mode:
authorPaul Sadauskas2010-05-26 12:49:40 -0600
committerAdam Vandenberg2010-06-10 11:21:44 -0700
commit2d6727ccf4d9f1bbe2293f179934b21c6fe6394f (patch)
tree812e96e340221658d6a43af81c7fe6335772f70e /Library/Formula/postgresql.rb
parentb34d1983a127f521e0fd9e7712e6b32e6a2e125d (diff)
downloadhomebrew-2d6727ccf4d9f1bbe2293f179934b21c6fe6394f.tar.bz2
UUID for postgres contrib
Diffstat (limited to 'Library/Formula/postgresql.rb')
-rw-r--r--Library/Formula/postgresql.rb35
1 files changed, 22 insertions, 13 deletions
diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb
index 0a3181e78..24819d4ee 100644
--- a/Library/Formula/postgresql.rb
+++ b/Library/Formula/postgresql.rb
@@ -1,6 +1,8 @@
require 'formula'
require 'hardware'
+def bits_64?; MACOS_VERSION >= 10.6 && Hardware.is_64_bit?; end
+
class Postgresql <Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.4/postgresql-8.4.4.tar.bz2'
@@ -8,19 +10,27 @@ class Postgresql <Formula
depends_on 'readline'
depends_on 'libxml2' if MACOS_VERSION < 10.6 #system libxml is too old
+ depends_on 'ossp-uuid' if ARGV.include? '--ossp-uuid'
aka 'postgres'
def options
[
['--no-python', 'Build without Python support.'],
- ['--no-perl', 'Build without Perl support.']
+ ['--no-perl', 'Build without Perl support.'],
+ ['--ossp-uuid', 'Build with UUID generation functions']
]
end
+ def skip_clean? path
+ # NOTE at some point someone should tweak this so it only skips clean
+ # for the bits that break the build otherwise
+ true
+ end
+
def install
ENV.libxml2 # wouldn't compile for justinlilly otherwise
-
+
configure_args = [
"--enable-thread-safety",
"--with-bonjour",
@@ -36,6 +46,13 @@ class Postgresql <Formula
configure_args << "--with-python" unless ARGV.include? '--no-python'
configure_args << "--with-perl" unless ARGV.include? '--no-perl'
+ if ARGV.include? '--ossp-uuid'
+ configure_args << "--with-ossp-uuid"
+ ENV.append 'CFLAGS', `uuid-config --cflags`.strip
+ ENV.append 'LDFLAGS', `uuid-config --ldflags`.strip
+ ENV.append 'LIBS', `uuid-config --libs`.strip
+ end
+
if bits_64? and not ARGV.include? '--no-python'
configure_args << "ARCHFLAGS='-arch x86_64'"
@@ -69,17 +86,9 @@ class Postgresql <Formula
system "./configure", *configure_args
system "make install"
- (prefix+'org.postgresql.postgres.plist').write startup_plist
- end
-
- def skip_clean? path
- # NOTE at some point someone should tweak this so it only skips clean
- # for the bits that break the build otherwise
- true
- end
+ system "cd contrib/uuid-ossp; make install" if ARGV.include? '--ossp-uuid'
- def bits_64?
- MACOS_VERSION >= 10.6 && Hardware.is_64_bit?
+ (prefix+'org.postgresql.postgres.plist').write startup_plist
end
def caveats
@@ -102,7 +111,7 @@ Or start manually with:
And stop with:
pg_ctl -D #{var}/postgres stop -s -m fast
EOS
-
+
if bits_64? then
caveats << <<-EOS