From 736db1dc244ca4f0ee7b46102949531c0d5a574c Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sat, 7 Sep 2024 17:23:49 -0400 Subject: [PATCH] solidity: use modern cmake syntax Signed-off-by: Rui Chen solidity: update to use system fmt, nlohmann-json, and range-v3 Signed-off-by: Rui Chen --- Formula/s/solidity.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Formula/s/solidity.rb b/Formula/s/solidity.rb index decaebc95b9f..6899b5ac2252 100644 --- a/Formula/s/solidity.rb +++ b/Formula/s/solidity.rb @@ -21,18 +21,27 @@ class Solidity < Formula end depends_on "cmake" => :build + depends_on "fmt" => :build + depends_on "nlohmann-json" => :build + depends_on "range-v3" => :build depends_on xcode: ["11.0", :build] depends_on "boost" + depends_on "z3" conflicts_with "solc-select", because: "both install `solc` binaries" fails_with gcc: "5" + # build patch to use system fmt, nlohmann-json, and range-v3, upstream PR ref, https://github.com/ethereum/solidity/pull/15414 + patch do + url "https://github.com/ethereum/solidity/commit/aa47181eef8fa63a6b4f52bff2c05517c66297a2.patch?full_index=1" + sha256 "b73e52a235087b184b8813a15a52c4b953046caa5200bf0aa60773ec4bb28300" + end + def install - mkdir "build" do - system "cmake", "..", *std_cmake_args - system "make", "install" - end + system "cmake", "-S", ".", "-B", "build", "-DSTRICT_Z3_VERSION=OFF", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" end test do @@ -45,6 +54,7 @@ def install } } EOS + output = shell_output("#{bin}/solc --bin hello.sol") assert_match "hello.sol:HelloWorld", output assert_match "Binary:", output