homebrew-core/Formula/corectl.rb

66 lines
2.0 KiB
Ruby

class Corectl < Formula
desc "CoreOS over macOS made very simple"
homepage "https://github.com/TheNewNormal/corectl"
url "https://github.com/TheNewNormal/corectl/archive/v0.7.18.tar.gz"
sha256 "9bdf7bc8c6a7bd861e2b723c0566d0a093ed5d5caf370a065a1708132b4ab98a"
license "Apache-2.0"
revision 2
head "https://github.com/TheNewNormal/corectl.git", branch: "golang"
bottle do
sha256 cellar: :any, mojave: "b3d030cf97c738ef427b24cd492a7b746b738be84f234f5904eedbff14661570"
sha256 cellar: :any, high_sierra: "74527235d27b207a4b4331f16cfbb4f5b72b1dac36f9c9a4470626c32e882d5f"
sha256 cellar: :any, sierra: "89e963f61102d26d5fe756b06f50aa73bf9f827f81f92cefa2da6c195b7865da"
end
disable! date: "2022-07-31", because: :unmaintained
depends_on "aspcud" => :build
depends_on "go" => :build
depends_on "ocaml" => :build
depends_on "opam" => :build
depends_on "libev"
def install
ENV["GOPATH"] = buildpath
path = buildpath/"src/github.com/TheNewNormal/#{name}"
path.install Dir["*"]
opamroot = path/"opamroot"
opamroot.mkpath
ENV["OPAMROOT"] = opamroot
ENV["OPAMYES"] = "1"
args = []
args << "VERSION=#{version}" if build.stable?
cd path do
system "opam", "init", "--no-setup", "--disable-sandboxing"
system "opam", "switch", "create", "ocaml-base-compiler.4.05.0"
system "opam", "config", "exec", "--", "opam", "install", "uri.2.2.0",
"ocamlfind.1.8.0", "qcow-format.0.5.0", "conf-libev.4-11", "io-page.1.6.1",
"mirage-block-unix.2.4.0", "lwt.3.0.0"
(opamroot/"system/bin").install_symlink opamroot/"ocaml-base-compiler.4.05.0/bin/qcow-tool"
system "opam", "config", "exec", "--", "make", "tarball", *args
bin.install Dir["bin/*"]
prefix.install_metafiles
man1.install Dir["documentation/man/*.1"]
pkgshare.install "examples"
end
end
def caveats
<<~EOS
Start the server daemon with:
corectld start
EOS
end
test do
assert_match version.to_s, shell_output("#{bin}/corectl version")
end
end