-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFormula.rb.tpl
55 lines (47 loc) · 1.78 KB
/
Formula.rb.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{% set binary = "edgedb" + ("-{}".format(channel) if channel != "release" else "") -%}
class EdgedbCli{{ channel.capitalize() if channel != "release" }} < Formula
desc "Latest release of the EdgeDB command-line client (edgedb)"
homepage "https://github.com/edgedb/edgedb-cli"
version "{{ version }}"
on_macos do
if Hardware::CPU.physical_cpu_arm64?
url "{{ artifacts['aarch64-apple-darwin']['url'] }}",
using: :nounzip
sha256 "{{ artifacts['aarch64-apple-darwin']['sha256'] }}"
def install
bin.install "{{ artifacts['aarch64-apple-darwin']['file'] }}" => "{{ binary }}"
end
elsif Hardware::CPU.intel?
url "{{ artifacts['x86_64-apple-darwin']['url'] }}",
using: :nounzip
sha256 "{{ artifacts['x86_64-apple-darwin']['sha256'] }}"
def install
bin.install "{{ artifacts['x86_64-apple-darwin']['file'] }}" => "{{ binary }}"
end
else
odie "Unsupported CPU architecture!"
end
end
on_linux do
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
url "{{ artifacts["aarch64-unknown-linux-musl"]["url"] }}",
using: :nounzip
sha256 "{{ artifacts["aarch64-unknown-linux-musl"]["sha256"] }}"
def install
bin.install "{{ artifacts['aarch64-unknown-linux-musl']['file'] }}" => "{{ binary }}"
end
elsif Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
url "{{ artifacts["x86_64-unknown-linux-musl"]["url"] }}",
using: :nounzip
sha256 "{{ artifacts["x86_64-unknown-linux-musl"]["sha256"] }}"
def install
bin.install "{{ artifacts['x86_64-unknown-linux-musl']['file'] }}" => "{{ binary }}"
end
else
odie "Unsupported CPU architecture!"
end
end
test do
system "#{bin}/{{ binary }}", "--version"
end
end