aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/ice.rb42
1 files changed, 40 insertions, 2 deletions
diff --git a/Library/Formula/ice.rb b/Library/Formula/ice.rb
index 8817c2509..916e2f516 100644
--- a/Library/Formula/ice.rb
+++ b/Library/Formula/ice.rb
@@ -4,12 +4,18 @@ class Ice < Formula
homepage 'http://www.zeroc.com'
url 'http://www.zeroc.com/download/Ice/3.5/Ice-3.5.1.tar.gz'
sha1 '63599ea22a1e9638a49356682c9e516b7c2c454f'
+ revision 1
option 'doc', 'Install documentation'
option 'demo', 'Build demos'
- depends_on 'berkeley-db'
- depends_on 'mcpp'
+ resource "berkeley-db" do
+ url "http://download.oracle.com/berkeley-db/db-5.3.28.tar.gz"
+ sha1 "fa3f8a41ad5101f43d08bc0efb6241c9b6fc1ae9"
+ end
+
+ depends_on "openssl"
+ depends_on "mcpp"
depends_on :python => :optional
# 1. TODO: document the first patch
@@ -18,6 +24,35 @@ class Ice < Formula
patch :DATA
def install
+ resource("berkeley-db").stage do
+
+ # Fix build under Xcode 4.6
+ # Double-underscore names are reserved, and __atomic_compare_exchange is now
+ # a built-in, so rename this to something non-conflicting.
+ inreplace "src/dbinc/atomic.h" do |s|
+ s.gsub! "__atomic_compare_exchange", "__atomic_compare_exchange_db"
+ end
+
+ # BerkeleyDB dislikes parallel builds
+ ENV.deparallelize
+
+ # --enable-compat185 is necessary because our build shadows
+ # the system berkeley db 1.x
+ args = %W[
+ --disable-debug
+ --prefix=#{libexec}
+ --mandir=#{libexec}/man
+ --enable-cxx
+ --enable-compat185
+ ]
+
+ # BerkeleyDB requires you to build everything from the build_unix subdirectory
+ cd "build_unix" do
+ system "../dist/configure", *args
+ system "make", "install"
+ end
+ end
+
ENV.O2
# what do we want to build?
@@ -35,6 +70,9 @@ class Ice < Formula
embedded_runpath_prefix=#{prefix}
OPTIMIZE=yes
]
+
+ ENV["DB_HOME"] = "#{libexec}"
+
args << "CXXFLAGS=#{ENV.cflags} -Wall -D_REENTRANT"
# Unset ICE_HOME as it interferes with the build