aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMatthias Vallentin2015-01-08 10:08:38 +0100
committerMike McQuaid2015-01-08 12:27:04 +0000
commit11e51f5204a475a157aafeb6d79f7dfd9b988149 (patch)
tree3d0fff5a964a6e1e05378406d83d6c776ead24ec /Library
parentcb645d9d3fbe235c53657c3701905b6c7f85c7d0 (diff)
downloadhomebrew-11e51f5204a475a157aafeb6d79f7dfd9b988149.tar.bz2
libcppa 0.12.0
This version update comes with a few more changes: - Add a 'head' directive. - Add a 'test do' block compiling a minimal example. (Tested on Yosemite only.) Closes #35658. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/libcppa.rb46
1 files changed, 27 insertions, 19 deletions
diff --git a/Library/Formula/libcppa.rb b/Library/Formula/libcppa.rb
index 7bad89460..30f5bd8c5 100644
--- a/Library/Formula/libcppa.rb
+++ b/Library/Formula/libcppa.rb
@@ -1,12 +1,10 @@
-require "formula"
-
class Libcppa < Formula
+ # TODO: since libcppa has been renamed to CAF, this formula should eventually
+ # be renamed to 'caf.rb'.
homepage "http://actor-framework.org/"
- url "https://github.com/actor-framework/actor-framework/archive/0.11.0.tar.gz"
- sha1 "202f2fd72a5af59d7ace6b7300df1fcc19f1857f"
-
- # since upstream has rename the project to actor-framework (or libcaf in its
- # pkgconfig file), we need to rename libcppa to libcaf in the future
+ url "https://github.com/actor-framework/actor-framework/archive/0.12.0.tar.gz"
+ sha1 "cb4e2c9a859d2d3095014237d4cdad63c1853c8c"
+ head "https://github.com/actor-framework/actor-framework.git"
bottle do
cellar :any
@@ -19,24 +17,34 @@ class Libcppa < Formula
needs :cxx11
- option "with-opencl", "Build with OpenCL actors"
- option "with-examples", "Build examples"
- option "without-check", "Skip build-time tests (not recommended)"
+ option "with-opencl", "build with support for OpenCL actors"
+ option "without-check", "skip unit tests (not recommended)"
def install
- ENV.cxx11
-
- args = %W[
- --prefix=#{prefix}
- --build-static
- ]
-
+ args = %W[./configure --prefix=#{prefix} --no-examples --build-static]
args << "--no-opencl" if build.without? "opencl"
- args << "--no-examples" if build.without? "examples"
- system "./configure", *args
+ 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