Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #26 from DanielWright/master
Browse files Browse the repository at this point in the history
Bump to 9.3.1
  • Loading branch information
ocxo committed Dec 30, 2013
2 parents 638e9b6 + 320d2ac commit cd86ac4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 51 deletions.
49 changes: 4 additions & 45 deletions files/brews/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class Postgresql < Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.bz2'
sha1 '75b53c884cb10ed9404747b51677358f12082152'
version '9.2.4-boxen2'
url 'http://ftp.postgresql.org/pub/source/v9.3.1/postgresql-9.3.1.tar.bz2'
sha256 '8ea4a7a92a6f5a79359b02e683ace335c5eb45dffe7f8a681a9ce82470a8a0b8'
version '9.3.1-boxen'

depends_on 'readline'
depends_on 'ossp-uuid'
Expand All @@ -18,7 +18,6 @@ def options
]
end

# Fix PL/Python build: https://github.com/mxcl/homebrew/issues/11162
# Fix uuid-ossp build issues: http://archives.postgresql.org/pgsql-general/2012-07/msg00654.php
def patches
DATA
Expand Down Expand Up @@ -52,17 +51,13 @@ def install
args << "--with-ossp-uuid" unless ARGV.include? '--no-ossp-uuid'
args << "--with-python" unless ARGV.include? '--no-python'
args << "--with-perl" unless ARGV.include? '--no-perl'
args << "--with-tcl" unless ARGV.include? '--no-tcl'
args << "--enable-dtrace" if ARGV.include? '--enable-dtrace'

ENV.append 'CFLAGS', `uuid-config --cflags`.strip
ENV.append 'LDFLAGS', `uuid-config --ldflags`.strip
ENV.append 'LIBS', `uuid-config --libs`.strip

if not ARGV.build_32_bit? and MacOS.prefer_64_bit? and not ARGV.include? '--no-python'
args << "ARCHFLAGS='-arch x86_64'"
check_python_arch
end

if ARGV.build_32_bit?
ENV.append 'CFLAGS', '-arch i386'
ENV.append 'LDFLAGS', '-arch i386'
Expand All @@ -74,45 +69,9 @@ def install
system "./configure", *args
system "make install-world"
end

def check_python_arch
# On 64-bit systems, we need to look for a 32-bit Framework Python.
# The configure script prefers this Python version, and if it doesn't
# have 64-bit support then linking will fail.
framework_python = Pathname.new "/Library/Frameworks/Python.framework/Versions/Current/Python"
return unless framework_python.exist?
unless (archs_for_command framework_python).include? :x86_64
opoo "Detected a framework Python that does not have 64-bit support in:"
puts <<-EOS.undent
#{framework_python}
The configure script seems to prefer this version of Python over any others,
so you may experience linker problems as described in:
http://osdir.com/ml/pgsql-general/2009-09/msg00160.html
To fix this issue, you may need to either delete the version of Python
shown above, or move it out of the way before brewing PostgreSQL.
Note that a framework Python in /Library/Frameworks/Python.framework is
the "MacPython" version, and not the system-provided version which is in:
/System/Library/Frameworks/Python.framework
EOS
end
end
end

__END__
--- a/src/pl/plpython/Makefile 2011-09-23 08:03:52.000000000 +1000
+++ b/src/pl/plpython/Makefile 2011-10-26 21:43:40.000000000 +1100
@@ -24,8 +24,6 @@
# Darwin (OS X) has its own ideas about how to do this.
ifeq ($(PORTNAME), darwin)
shared_libpython = yes
-override python_libspec = -framework Python
-override python_additional_libs =
endif

# If we don't have a shared library and the platform doesn't allow it
--- a/contrib/uuid-ossp/uuid-ossp.c 2012-07-30 18:34:53.000000000 -0700
+++ b/contrib/uuid-ossp/uuid-ossp.c 2012-07-30 18:35:03.000000000 -0700
@@ -9,6 +9,8 @@
Expand Down
6 changes: 3 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
include boxen::config

$executable = "${boxen::config::home}/homebrew/bin/postgres"
$datadir = "${boxen::config::datadir}/postgresql"
$logdir = "${boxen::config::logdir}/postgresql"
$datadir = "${boxen::config::datadir}/postgresql-9.3"
$logdir = "${boxen::config::logdir}/postgresql-9.3"
$port = 15432

$package = 'boxen/brews/postgresql'
$version = '9.2.4-boxen2'
$version = '9.3.1-boxen'

$service = 'dev.postgresql'

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/postgresql__config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
it do
should include_class('boxen::config')

%w(data/postgresql log/postgresql).each do |d|
%w(data/postgresql-9.3 log/postgresql-9.3).each do |d|
should contain_file("/test/boxen/#{d}").with_ensure(:directory)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/postgresql__service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
it do
should contain_service("com.boxen.postgresql").with_ensure(:stopped)

should contain_exec("init-postgresql-db").with_creates("/test/boxen/data/postgresql/PG_VERSION")
should contain_exec("init-postgresql-db").with_creates("/test/boxen/data/postgresql-9.3/PG_VERSION")
should contain_service("dev.postgresql").with_ensure(:running)
should contain_exec("wait-for-postgresql").with_unless("nc -z 127.0.0.1 15432")
end
Expand Down
1 change: 0 additions & 1 deletion spec/defines/postgresql_db_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

should contain_exec("postgresql-db-#{title}").with({
:command => "createdb -p15432 -E UTF-8 -O testuser #{title}",
:require => 'Exec[wait-for-postgresql]',
:unless => "psql -aA -p15432 -t -l | cut -d \\| -f 1 | grep -w '#{title}'"
})
end
Expand Down

0 comments on commit cd86ac4

Please sign in to comment.