-
Notifications
You must be signed in to change notification settings - Fork 50
/
riscv-isa-sim.rb
43 lines (38 loc) · 1.33 KB
/
riscv-isa-sim.rb
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
class RiscvIsaSim < Formula
desc "RISC-V ISA simulator (spike)"
homepage "http://riscv.org"
url "https://github.com/riscv/riscv-isa-sim.git"
version "main"
bottle do
root_url "http://riscv.org.s3.amazonaws.com/bottles"
rebuild 17
sha256 cellar: :any, sonoma: "11f640bb01a1b3ad864ab689257e1ae684b281f035d1343d9b415761e6b4cd23"
sha256 cellar: :any, arm64_sonoma: "471cd017418fb75b8b2f6eb6e6d79952f9741b7c6c70782267aa95fedff0b58f"
end
depends_on "dtc"
depends_on "boost" => :optional
opoo "Building with clang could fail due to upstream bug: https://github.com/riscv-software-src/riscv-isa-sim/issues/820" if build.with? "boost"
def install
mkdir "build"
cd "build" do
args = [
"--prefix=#{prefix}", "--with-target=../../riscv-pk/main/riscv64-unknown-elf"
]
if build.with? "boost"
# This seems to be needed at least on macos/arm64
args << "--with-boost=#{Formula["boost"].prefix}"
else
args << "--without-boost"
args << "--without-boost-asio"
args << "--without-boost-regex"
end
# configure uses --with-target to set TARGET_ARCH but homebrew formulas only provide "with"/"without" options
system "../configure", *args
system "make"
system "make", "install"
end
end
test do
system "false"
end
end