homebrew-core/Formula/hana.rb
2017-01-14 14:14:56 -05:00

38 lines
1.3 KiB
Ruby

class Hana < Formula
desc "The Boost.Hana C++14 metaprogramming library"
homepage "https://github.com/boostorg/hana"
url "https://github.com/boostorg/hana/archive/v1.0.2.tar.gz"
sha256 "51be7e5d11c4bafa595d7a4ebd90185e19e213fa4de291b74a44acc635e86e95"
head "https://github.com/boostorg/hana.git", :branch => "develop"
bottle do
cellar :any_skip_relocation
sha256 "d3648fae565ddce63d113bddaefd639bf1e52618e5be45e88b6ba7cf529d38ec" => :sierra
sha256 "822eef7d44eb999289d344c9d8b51c93106f0ede237b065d54ac0c3451412fbc" => :el_capitan
sha256 "822eef7d44eb999289d344c9d8b51c93106f0ede237b065d54ac0c3451412fbc" => :yosemite
end
depends_on "cmake" => :build
depends_on :macos => :yosemite
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <boost/hana.hpp>
constexpr auto xs = boost::hana::make_tuple(1, '2', 3.3);
static_assert(xs[boost::hana::size_c<0>] == 1, "");
static_assert(xs[boost::hana::size_c<1>] == '2', "");
static_assert(xs[boost::hana::size_c<2>] == 3.3, "");
int main() { }
EOS
system ENV.cxx, "test.cpp", "-std=c++1y", "-I#{include}", "-otest", *ENV.cppflags
system "./test"
end
end