homebrew-core/Formula/caf.rb
2017-09-29 21:13:32 +02:00

53 lines
1.6 KiB
Ruby

class Caf < Formula
# Renamed from libccpa
desc "Implementation of the Actor Model for C++"
homepage "https://actor-framework.org/"
url "https://github.com/actor-framework/actor-framework/archive/0.15.4.tar.gz"
sha256 "3e3d013648778a60cbea3bc86d38ad984f420307dce03abd9a13d961e2084e6a"
head "https://github.com/actor-framework/actor-framework.git", :branch => "develop"
bottle do
cellar :any
sha256 "d475a4184a6d5f7587669b742c06f81b8736400d58b20bd4ab98abb17f07dcfb" => :high_sierra
sha256 "5f838ab74f953f0c3191454d0605fa7f988a78aa1aac03ca0cfa6bef44a32ad3" => :sierra
sha256 "14a58d12f948c2eff89269adcbf83d0d8f2f8893c661f7b9d01fb974c168dbe7" => :el_capitan
end
needs :cxx11
option "with-opencl", "build with support for OpenCL actors"
option "without-test", "skip unit tests (not recommended)"
deprecated_option "without-check" => "without-test"
depends_on "cmake" => :build
def install
args = %W[--prefix=#{prefix} --no-examples --build-static]
args << "--no-opencl" if build.without? "opencl"
system "./configure", *args
system "make"
system "make", "test" if build.with? "test"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <iostream>
#include <caf/all.hpp>
using namespace caf;
void caf_main(actor_system& system) {
scoped_actor self{system};
self->spawn([] {
std::cout << "test" << std::endl;
});
self->await_all_other_actors_done();
}
CAF_MAIN()
EOS
ENV.cxx11
system *(ENV.cxx.split + %W[test.cpp -L#{lib} -lcaf_core -o test])
system "./test"
end
end