-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Chore] Support octez-smart-rollup-wasm-debugger
Problem: There is a demand for octez-smart-rollup-wasm-debugger to be included into release. Solution: Support it.
- Loading branch information
1 parent
3a6bfd8
commit 8c5fa48
Showing
6 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env ruby | ||
# SPDX-FileCopyrightText: 2023 Oxhead Alpha | ||
# SPDX-License-Identifier: LicenseRef-MIT-OA | ||
|
||
class TezosSmartRollupWasmDebugger < Formula | ||
@all_bins = [] | ||
|
||
class << self | ||
attr_accessor :all_bins | ||
end | ||
homepage "https://gitlab.com/tezos/tezos" | ||
|
||
url "https://gitlab.com/tezos/tezos.git", :tag => "v18.0-rc1", :shallow => false | ||
|
||
version "v18.0-rc1-1" | ||
|
||
build_dependencies = %w[pkg-config coreutils autoconf rsync wget rustup-init cmake] | ||
build_dependencies.each do |dependency| | ||
depends_on dependency => :build | ||
end | ||
|
||
dependencies = %w[gmp hidapi libev tezos-sapling-params] | ||
dependencies.each do |dependency| | ||
depends_on dependency | ||
end | ||
desc "Smart contract rollup wasm debugger" | ||
|
||
bottle do | ||
root_url "https://github.com/serokell/tezos-packaging/releases/download/#{TezosSmartRollupWasmDebugger.version}/" | ||
end | ||
|
||
def make_deps | ||
ENV.deparallelize | ||
ENV["CARGO_HOME"]="./.cargo" | ||
# Disable usage of instructions from the ADX extension to avoid incompatibility | ||
# with old CPUs, see https://gitlab.com/dannywillems/ocaml-bls12-381/-/merge_requests/135/ | ||
ENV["BLST_PORTABLE"]="yes" | ||
# Here is the workaround to use opam 2.0.9 because Tezos is currently not compatible with opam 2.1.0 and newer | ||
arch = RUBY_PLATFORM.include?("arm64") ? "arm64" : "x86_64" | ||
system "curl", "-L", "https://github.com/ocaml/opam/releases/download/2.0.9/opam-2.0.9-#{arch}-macos", "--create-dirs", "-o", "#{ENV["HOME"]}/.opam-bin/opam" | ||
system "chmod", "+x", "#{ENV["HOME"]}/.opam-bin/opam" | ||
ENV["PATH"]="#{ENV["HOME"]}/.opam-bin:#{ENV["PATH"]}" | ||
system "rustup-init", "--default-toolchain", "1.64.0", "-y" | ||
system "opam", "init", "--bare", "--debug", "--auto-setup", "--disable-sandboxing" | ||
system ["source .cargo/env", "make build-deps"].join(" && ") | ||
end | ||
|
||
def install_template(dune_path, exec_path, name) | ||
bin.mkpath | ||
self.class.all_bins << name | ||
system ["eval $(opam env)", "dune build #{dune_path}", "cp #{exec_path} #{name}"].join(" && ") | ||
bin.install name | ||
ln_sf "#{bin}/#{name}", "#{bin}/#{name.gsub("octez", "tezos")}" | ||
end | ||
|
||
def install | ||
make_deps | ||
install_template "src/bin_wasm_debugger/main_wasm_debugger.exe", | ||
"_build/default/src/bin_wasm_debugger/main_wasm_debugger.exe", | ||
"octez-smart-rollup-wasm-debugger" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters