homebrew-core/Formula/pegtl.rb

34 lines
1.1 KiB
Ruby

class Pegtl < Formula
desc "Parsing Expression Grammar Template Library"
homepage "https://github.com/taocpp/PEGTL"
url "https://github.com/taocpp/PEGTL/archive/3.2.7.tar.gz"
sha256 "d6cd113d8bd14e98bcbe7b7f8fc1e1e33448dc359e8cd4cca30e034ec2f0642d"
license "BSL-1.0"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, all: "7688f9b9cba1325c28f231fa6266c7a7c4177dfb5fe4467147878aec7b7778da"
end
depends_on "cmake" => :build
fails_with gcc: "5"
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args,
"-DPEGTL_BUILD_TESTS=OFF",
"-DPEGTL_BUILD_EXAMPLES=OFF",
"-DCMAKE_CXX_STANDARD=17"
system "make", "install"
end
rm "src/example/pegtl/CMakeLists.txt"
(pkgshare/"examples").install (buildpath/"src/example/pegtl").children
end
test do
system ENV.cxx, pkgshare/"examples/hello_world.cpp", "-std=c++17", "-o", "helloworld"
assert_equal "Good bye, homebrew!\n", shell_output("./helloworld 'Hello, homebrew!'")
end
end