Skip to content

Commit

Permalink
Merge pull request #152888 from p-linnane/zug-add-formula
Browse files Browse the repository at this point in the history
zug 0.1.1 (new formula)
  • Loading branch information
BrewTestBot authored Oct 31, 2023
2 parents 2dd64d7 + 6faff12 commit fd974ac
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Formula/z/zug.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class Zug < Formula
desc "C++ library providing transducers"
homepage "https://sinusoid.es/zug/"
url "https://github.com/arximboldi/zug/archive/refs/tags/v0.1.1.tar.gz"
sha256 "1b9c8f962e40baa6f0c6af35f957444850063d550078a3ebd0227727b8ef193c"
license "BSL-1.0"

bottle do
sha256 cellar: :any_skip_relocation, all: "96fbf6458c5eebb9e65299d68f5fa0eac49de340e8eeeb2bd73da0f57d06e6b4"
end

depends_on "cmake" => :build

def install
args = %w[
-Dzug_BUILD_EXAMPLES=OFF
-Dzug_BUILD_TESTS=OFF
]
system "cmake", "-S", ".", "-B", "_build", *args, *std_cmake_args.reject { |s| s["-DBUILD_TESTING=OFF"] }
system "cmake", "--build", "_build"
system "cmake", "--install", "_build"
end

test do
(testpath/"test.cpp").write <<~EOS
#include <string>
#include <zug/transducer/filter.hpp>
#include <zug/transducer/map.hpp>
int main()
{
auto xf = zug::filter([](int x) { return x > 0; })
| zug::map([](int x) { return std::to_string(x); });
}
EOS

system ENV.cxx, "-std=c++17", "-I#{include}", "test.cpp", "-o", "test"
system "./test"
end
end

0 comments on commit fd974ac

Please sign in to comment.