forked from riscv-software-src/homebrew-riscv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathriscv-isa-sim.rb
42 lines (37 loc) · 1.22 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
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 14
sha256 cellar: :any, ventura: "02b56f3cace2ad901f2bea580a5d041815742d79e7cde5167e363f4df108159f"
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