Skip to content

Commit

Permalink
feat: cartesi-machine formula
Browse files Browse the repository at this point in the history
  • Loading branch information
tuler committed Sep 5, 2024
1 parent 4abba3a commit 895b3e0
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Formula/cartesi-machine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class CartesiMachine < Formula
desc "Off-chain implementation of the Cartesi Machine"
homepage "https://cartesi.io/"
url "https://github.com/cartesi/machine-emulator/archive/refs/tags/v0.18.1.tar.gz"
sha256 "2d6ca78881b0a218aa9460d5cc7af7be51f9971b163305d6191039719568b5c3"
license "LGPL-3.0-only"
version "0.18.1"

depends_on "pkg-config" => :build
depends_on "wget" => :build
depends_on "boost" => :build
depends_on "libslirp" => :build
depends_on "lua" => :build
depends_on "openssl" => :build

resource "uarch" do
url "https://github.com/cartesi/machine-emulator/releases/download/v0.18.1/uarch-ram.bin"
sha256 "60888eed34d995be2480a456d48399c708fcd72d2d4f7e3b5a5423064e45444c"
end

patch :DATA

def install
system "make", "UARCH_RAM_IMAGE=#{resource("uarch").cached_download}", "BREW_PREFIX=#{prefix}"
system "make", "install", "PREFIX=#{prefix}"
end

test do
assert_match(/cartesi-machine #{version}/, shell_output("#{bin}/cartesi-machine --version | head -1"))
end
end

0 comments on commit 895b3e0

Please sign in to comment.