jackett 0.22.1382
[Homebrew/homebrew-core.git] / Formula / c / cadence.rb
blobc7c7b51119638972e2a5085e3d1c4af9a0d9bd75
1 class Cadence < Formula
2   desc "Resource-oriented smart contract programming language"
3   homepage "https://cadence-lang.org/"
4   url "https://github.com/onflow/cadence/archive/refs/tags/v1.3.1.tar.gz"
5   sha256 "7955e8f7715d70f4232d2b6579eed430828019f23cd052be1b18319ba40bae92"
6   license "Apache-2.0"
7   head "https://github.com/onflow/cadence.git", branch: "master"
9   # Upstream uses GitHub releases to indicate that a version is released
10   # (there's also sometimes a notable gap between when a version is tagged and
11   # and the release is created), so the `GithubLatest` strategy is necessary.
12   livecheck do
13     url :stable
14     strategy :github_latest
15   end
17   bottle do
18     sha256 cellar: :any_skip_relocation, arm64_sequoia: "c459a7920f6dcab5d207d2f47d5e60f445e55bbb050dfcda72ff93afa2ff4cf3"
19     sha256 cellar: :any_skip_relocation, arm64_sonoma:  "c459a7920f6dcab5d207d2f47d5e60f445e55bbb050dfcda72ff93afa2ff4cf3"
20     sha256 cellar: :any_skip_relocation, arm64_ventura: "c459a7920f6dcab5d207d2f47d5e60f445e55bbb050dfcda72ff93afa2ff4cf3"
21     sha256 cellar: :any_skip_relocation, sonoma:        "48a0d24aa77f24be66e7a5f516aadfcd1f69317b6dda5b71b80c212b83bb9a7b"
22     sha256 cellar: :any_skip_relocation, ventura:       "48a0d24aa77f24be66e7a5f516aadfcd1f69317b6dda5b71b80c212b83bb9a7b"
23     sha256 cellar: :any_skip_relocation, x86_64_linux:  "ecc190fbdebe831acfbd7301d6b7e1e843d0aac15efac959d085ab39f5aad0e4"
24   end
26   depends_on "go" => :build
28   conflicts_with "cadence-workflow", because: "both install a `cadence` executable"
30   def install
31     system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/main"
32   end
34   test do
35     # from https://cadence-lang.org/docs/tutorial/hello-world
36     (testpath/"hello.cdc").write <<~EOS
37       access(all) contract HelloWorld {
39           // Declare a public (access(all)) field of type String.
40           //
41           // All fields must be initialized in the initializer.
42           access(all) let greeting: String
44           // The initializer is required if the contract contains any fields.
45           init() {
46               self.greeting = "Hello, World!"
47           }
49           // Public function that returns our friendly greeting!
50           access(all) view fun hello(): String {
51               return self.greeting
52           }
53       }
54     EOS
55     system bin/"cadence", "hello.cdc"
56   end
57 end