From 8cf320282cc7c15eaa3dc08b2bfafec01c1937bb Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sat, 7 Sep 2024 17:44:13 -0400 Subject: [PATCH] pegtl: use modern cmake syntax Signed-off-by: Rui Chen Co-authored-by: Michael Cho --- Formula/p/pegtl.rb | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Formula/p/pegtl.rb b/Formula/p/pegtl.rb index b1a46c0f9b53..329927ce290b 100644 --- a/Formula/p/pegtl.rb +++ b/Formula/p/pegtl.rb @@ -3,7 +3,8 @@ class Pegtl < Formula homepage "https://github.com/taocpp/PEGTL" url "https://github.com/taocpp/PEGTL/archive/refs/tags/3.2.7.tar.gz" sha256 "d6cd113d8bd14e98bcbe7b7f8fc1e1e33448dc359e8cd4cca30e034ec2f0642d" - license "BSL-1.0" + # license got changed to BSL-1.0 in main per https://github.com/taocpp/PEGTL/commit/c7630f1649906daf08b8ddca1420e66b542bae2b + license "MIT" bottle do rebuild 2 @@ -15,13 +16,16 @@ class Pegtl < Formula 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 + args = %w[ + -DPEGTL_BUILD_TESTS=OFF + -DPEGTL_BUILD_EXAMPLES=OFF + -DCMAKE_CXX_STANDARD=17 + ] + + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + rm "src/example/pegtl/CMakeLists.txt" (pkgshare/"examples").install (buildpath/"src/example/pegtl").children end