2011-04-21 23:19:24 +00:00
|
|
|
class Ice < Formula
|
2015-08-01 09:35:45 +00:00
|
|
|
desc "Comprehensive RPC framework"
|
2015-06-26 21:17:26 +00:00
|
|
|
homepage "https://zeroc.com"
|
|
|
|
url "https://github.com/zeroc-ice/ice/archive/v3.6.0.tar.gz"
|
|
|
|
sha256 "77933580cdc7fade0ebfce517935819e9eef5fc6b9e3f4143b07404daf54e25e"
|
2011-04-21 23:19:24 +00:00
|
|
|
|
2015-02-23 19:54:25 +00:00
|
|
|
bottle do
|
2015-07-10 21:56:54 +00:00
|
|
|
revision 2
|
|
|
|
sha256 "afee4ec276259a24243ce08c848c10c930fecbc3bbd086ca1eec2b9e7863384f" => :yosemite
|
|
|
|
sha256 "0fd42d37aaac81da90b098a6138eac4ade95ddfc6adc5709d0e42f8e91e67c70" => :mavericks
|
2015-02-23 19:54:25 +00:00
|
|
|
end
|
|
|
|
|
2015-07-10 20:34:51 +00:00
|
|
|
option "with-java", "Build Ice for Java and the IceGrid Admin app"
|
|
|
|
|
2015-06-26 21:17:26 +00:00
|
|
|
depends_on "mcpp"
|
2015-07-10 20:34:51 +00:00
|
|
|
depends_on :java => :optional
|
2015-06-26 21:17:26 +00:00
|
|
|
depends_on :macos => :mavericks
|
2013-03-13 18:33:39 +00:00
|
|
|
|
2015-02-11 21:18:49 +00:00
|
|
|
resource "berkeley-db" do
|
2015-07-10 20:34:51 +00:00
|
|
|
url "https://zeroc.com/download/homebrew/db-5.3.28.NC.brew.tar.gz"
|
|
|
|
sha256 "8ac3014578ff9c80a823a7a8464a377281db0e12f7831f72cef1fd36cd506b94"
|
2015-02-11 21:18:49 +00:00
|
|
|
end
|
|
|
|
|
2011-04-21 23:19:24 +00:00
|
|
|
def install
|
2015-02-11 21:18:49 +00:00
|
|
|
resource("berkeley-db").stage do
|
|
|
|
# BerkeleyDB dislikes parallel builds
|
|
|
|
ENV.deparallelize
|
|
|
|
args = %W[
|
|
|
|
--disable-debug
|
|
|
|
--prefix=#{libexec}
|
|
|
|
--mandir=#{libexec}/man
|
|
|
|
--enable-cxx
|
|
|
|
]
|
|
|
|
|
2015-06-26 21:17:26 +00:00
|
|
|
args << "--enable-java" if build.with? "java"
|
|
|
|
|
2015-02-11 21:18:49 +00:00
|
|
|
# BerkeleyDB requires you to build everything from the build_unix subdirectory
|
|
|
|
cd "build_unix" do
|
|
|
|
system "../dist/configure", *args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-06-26 21:17:26 +00:00
|
|
|
inreplace "cpp/src/slice2js/Makefile", /install:/, "dontinstall:"
|
2011-04-21 23:19:24 +00:00
|
|
|
|
2015-06-26 21:17:26 +00:00
|
|
|
if build.with? "java"
|
2015-07-10 14:33:12 +00:00
|
|
|
inreplace "java/src/IceGridGUI/build.gradle", "${DESTDIR}${binDir}/${appName}.app", "${prefix}/${appName}.app"
|
2011-04-21 23:19:24 +00:00
|
|
|
end
|
|
|
|
|
2015-06-26 21:17:26 +00:00
|
|
|
# Unset ICE_HOME as it interferes with the build
|
|
|
|
ENV.delete("ICE_HOME")
|
|
|
|
ENV.delete("USE_BIN_DIST")
|
|
|
|
ENV.delete("CPPFLAGS")
|
|
|
|
ENV.O2
|
|
|
|
|
2013-10-09 09:24:30 +00:00
|
|
|
args = %W[
|
|
|
|
prefix=#{prefix}
|
|
|
|
embedded_runpath_prefix=#{prefix}
|
2015-06-26 21:17:26 +00:00
|
|
|
USR_DIR_INSTALL=yes
|
2013-10-09 09:24:30 +00:00
|
|
|
OPTIMIZE=yes
|
2015-06-26 21:17:26 +00:00
|
|
|
DB_HOME=#{libexec}
|
2013-10-09 09:24:30 +00:00
|
|
|
]
|
2015-02-11 21:18:49 +00:00
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
cd "cpp" do
|
2013-10-09 09:24:30 +00:00
|
|
|
system "make", "install", *args
|
|
|
|
end
|
2014-01-22 23:41:18 +00:00
|
|
|
|
2015-06-26 21:17:26 +00:00
|
|
|
cd "objective-c" do
|
2014-01-22 23:41:18 +00:00
|
|
|
system "make", "install", *args
|
|
|
|
end
|
|
|
|
|
2015-07-08 23:15:20 +00:00
|
|
|
if build.with? "java"
|
2015-06-26 21:17:26 +00:00
|
|
|
cd "java" do
|
2014-05-08 09:16:27 +00:00
|
|
|
system "make", "install", *args
|
|
|
|
end
|
2011-04-21 23:19:24 +00:00
|
|
|
end
|
2014-05-06 17:28:30 +00:00
|
|
|
|
2015-06-26 21:17:26 +00:00
|
|
|
cd "php" do
|
|
|
|
args << "install_phpdir=#{share}/php"
|
|
|
|
args << "install_libdir=#{lib}/php/extensions"
|
|
|
|
system "make", "install", *args
|
|
|
|
end
|
2014-05-01 20:06:45 +00:00
|
|
|
end
|
2015-07-10 20:34:51 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"Hello.ice").write <<-EOS.undent
|
|
|
|
module Test {
|
|
|
|
interface Hello {
|
|
|
|
void sayHello();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
EOS
|
|
|
|
(testpath/"Test.cpp").write <<-EOS.undent
|
|
|
|
#include <Ice/Ice.h>
|
|
|
|
#include <Hello.h>
|
|
|
|
|
|
|
|
class HelloI : public Test::Hello {
|
|
|
|
public:
|
|
|
|
virtual void sayHello(const Ice::Current&) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
Ice::CommunicatorPtr communicator;
|
|
|
|
communicator = Ice::initialize(argc, argv);
|
|
|
|
Ice::ObjectAdapterPtr adapter =
|
|
|
|
communicator->createObjectAdapterWithEndpoints("Hello", "default -h localhost -p 10000");
|
|
|
|
adapter->add(new HelloI, communicator->stringToIdentity("hello"));
|
|
|
|
adapter->activate();
|
|
|
|
communicator->destroy();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system "#{bin}/slice2cpp", "Hello.ice"
|
|
|
|
system "xcrun", "clang++", "-c", "-I#{include}", "-I.", "Hello.cpp"
|
|
|
|
system "xcrun", "clang++", "-c", "-I#{include}", "-I.", "Test.cpp"
|
|
|
|
system "xcrun", "clang++", "-L#{lib}", "-o", "test", "Test.o", "Hello.o", "-lIce", "-lIceUtil"
|
|
|
|
system "./test", "--Ice.InitPlugins=0"
|
|
|
|
end
|
2011-04-21 23:19:24 +00:00
|
|
|
end
|