|
| 1 | +class ConsensusDbTools < Formula |
| 2 | + desc "Tools to inspect and manipulate the Cardano node's chainDB and ledger databases" |
| 3 | + homepage "https://github.com/IntersectMBO/ouroboros-consensus" |
| 4 | + url "https://github.com/IntersectMBO/ouroboros-consensus/archive/d3c4b5c029bde7b7233f6f7bbd21968b4f62b020.tar.gz" |
| 5 | + sha256 "53428c5e8c62807dbaf97a9f201b702de2dc942e8b81661482d0a3c5f8d69994" |
| 6 | + license "Apache-2.0" |
| 7 | + |
| 8 | + depends_on "ghcup" => :build |
| 9 | + depends_on "pkg-config" => :build |
| 10 | + depends_on "gmp" |
| 11 | + depends_on "lmdb" |
| 12 | + depends_on "notunrandom/cardano/blst" |
| 13 | + depends_on "notunrandom/cardano/libsodium-cardano" |
| 14 | + depends_on "notunrandom/cardano/secp256k1@0.3.2" |
| 15 | + |
| 16 | + def install |
| 17 | + ENV["GHCUP_INSTALL_BASE_PREFIX"] = buildpath |
| 18 | + system "ghcup", "install", "ghc", "9.6.7" |
| 19 | + system "ghcup", "install", "cabal", "3.12.1.0" |
| 20 | + ENV.prepend_path "PATH", buildpath/".ghcup/bin" |
| 21 | + ENV.prepend_path "PKG_CONFIG_PATH", Formula["notunrandom/cardano/secp256k1@0.3.2"].opt_lib/"pkgconf" |
| 22 | + File.write("cabal.project.local", "with-compiler: ghc-9.6.7") |
| 23 | + system "cabal", "update" |
| 24 | + system "cabal", "build", "exe:db-analyser" |
| 25 | + system "cabal", "v2-install", *std_cabal_v2_args, "exe:db-analyser" |
| 26 | + end |
| 27 | + |
| 28 | + test do |
| 29 | + system bin/"db-analyser", "--help" |
| 30 | + end |
| 31 | +end |
0 commit comments