homebrew-core/Formula/libcppa.rb
2015-07-07 18:17:39 +01:00

52 lines
1.6 KiB
Ruby

class Libcppa < Formula
# TODO: since libcppa has been renamed to CAF, this formula should eventually
# be renamed to 'caf.rb'.
desc "Implementation of the Actor Model for C++"
homepage "http://actor-framework.org/"
url "https://github.com/actor-framework/actor-framework/archive/0.14.0.tar.gz"
sha256 "156c9548dba4ed815eff7df58d470647304f59701b6005cb2baf32cf74c19df6"
head "https://github.com/actor-framework/actor-framework.git",
:branch => "develop"
bottle do
cellar :any
sha256 "2ad5063917985616b16174e39bcb781049934a1e84565ecf91e425fabe0aa48f" => :yosemite
sha256 "6bd6ffabc077bd33abca3a96870354b012fdbf8118463b40da0b2aa78ed8870a" => :mavericks
sha256 "0ca6c6a6cae249472146a938458464b275b8d409a81ab9ffa36f22c7523d365a" => :mountain_lion
end
depends_on "cmake" => :build
needs :cxx11
option "with-opencl", "build with support for OpenCL actors"
option "without-check", "skip unit tests (not recommended)"
def install
args = %W[./configure --prefix=#{prefix} --no-examples --build-static]
args << "--no-opencl" if build.without? "opencl"
system *args
system "make"
system "make", "test" if build.with? "check"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <iostream>
#include <caf/all.hpp>
using namespace caf;
int main() {
scoped_actor self;
self->spawn([] {
std::cout << "test" << std::endl;
});
self->await_all_other_actors_done();
return 0;
}
EOS
system *%W[#{ENV.cxx} -std=c++11 -stdlib=libc++ test.cpp -lcaf_core -o test]
system "./test"
end
end