Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / e / ethereum.rb
blob8fe02f03b94a44fc0653c71c9dd28892ac92e16d
1 class Ethereum < Formula
2   desc "Official Go implementation of the Ethereum protocol"
3   homepage "https://geth.ethereum.org/"
4   url "https://github.com/ethereum/go-ethereum/archive/refs/tags/v1.15.0.tar.gz"
5   sha256 "b720c91aa6d721ba1f9ec753fa216b27880d0fdcb3204d0725d411d215507a13"
6   license "LGPL-3.0-or-later"
7   head "https://github.com/ethereum/go-ethereum.git", branch: "master"
9   livecheck do
10     url :stable
11     strategy :github_latest
12   end
14   bottle do
15     sha256 cellar: :any_skip_relocation, arm64_sequoia: "18ea2d65b0920a84220d0990f99bb1710476c6f47810e8baa2894429b5023f04"
16     sha256 cellar: :any_skip_relocation, arm64_sonoma:  "d21db4489b02089d028aa86b968174e9766ee72aadd84076033db575788d905b"
17     sha256 cellar: :any_skip_relocation, arm64_ventura: "b92cd7a8aec12ae55aaa429e13d87275a6e8e8fec8e74ce6d05f15c0d8c5a10a"
18     sha256 cellar: :any_skip_relocation, sonoma:        "c1301eb97ce0bd81b4e4af5e0deb2c14544115dc5fb5546b1dcd980bbcaf44b6"
19     sha256 cellar: :any_skip_relocation, ventura:       "318625ff790c0aa3a27adcee3ad9fe48daa6fd54ac6abc01d685ab4646dd3cf3"
20     sha256 cellar: :any_skip_relocation, x86_64_linux:  "a5c5d3d6d76a20cd42d3fcdc6f2ce2e83347481ec188b40d7ceff00d32238fc0"
21   end
23   depends_on "go" => :build
25   conflicts_with "erigon", because: "both install `evm` binaries"
27   def install
28     # Force superenv to use -O0 to fix "cgo-dwarf-inference:2:8: error:
29     # enumerator value for '__cgo_enum__0' is not an integer constant".
30     # See discussion in https://github.com/Homebrew/brew/issues/14763.
31     ENV.O0 if OS.linux?
33     system "make", "all"
34     bin.install Dir["build/bin/*"]
35   end
37   test do
38     (testpath/"genesis.json").write <<~JSON
39       {
40         "config": {
41           "homesteadBlock": 10
42         },
43         "nonce": "0",
44         "difficulty": "0x20000",
45         "mixhash": "0x00000000000000000000000000000000000000647572616c65787365646c6578",
46         "coinbase": "0x0000000000000000000000000000000000000000",
47         "timestamp": "0x00",
48         "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
49         "extraData": "0x",
50         "gasLimit": "0x2FEFD8",
51         "alloc": {}
52       }
53     JSON
55     system bin/"geth", "--datadir", "testchain", "init", "genesis.json"
56     assert_predicate testpath/"testchain/geth/chaindata/000002.log", :exist?
57     assert_predicate testpath/"testchain/geth/nodekey", :exist?
58     assert_predicate testpath/"testchain/geth/LOCK", :exist?
59   end
60 end