53 lines
1.6 KiB
Ruby
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.6.tar.gz"
|
|
sha256 "402dbe1c5007008d2f92a8845dc84e489b8aea31baff62847a7ab5a5ea9dd65d"
|
|
head "https://github.com/actor-framework/actor-framework.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "68ade141bb1de21a18fbb18ed6ff71d04b66f3ddd2787482307c78ade5fb9771" => :high_sierra
|
|
sha256 "951baad42e4c5133d1bf9a92316fb39800b2b7ebb09266f90e99d0427f4d81ae" => :sierra
|
|
sha256 "47c38e03f8be6d2a22901f740f72c5bf2487844a745f889f7afea766b9d8b905" => :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
|
|
#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
|