homebrew-apps/Formula/msg-cli.rb

71 lines
2.7 KiB
Ruby

# Documentation: https://docs.brew.sh/Formula-Cookbook
# https://rubydoc.brew.sh/Formula
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class MsgCli < Formula
desc "MacOS Subsystem for Guix - Creates a virtual machine for running a local guix environment on your mac"
homepage "https://superkamiguru.org/projects/msg.html"
url "https://forge.superkamiguru.org/MSG/msg-cli/archive/v0.1.1.tar.gz"
sha256 "5c543e46e3ac9c0c387fc70dbe660f6ea4318ecf187ae8ff573b8da5bfd0ff11"
license "AGPL-3.0-or-later"
bottle do
root_url "https://forge.superkamiguru.org/MSG/homebrew-apps/releases/download/msg-cli_v0.1.1"
sha256 arm64_sequoia: "11a205b49daf8660ffa3dc8a01271f9d3b0708692140fa586cd5ad306c6f7e0c"
end
# depends_on "cmake" => :build
depends_on "wget"
depends_on "qemu"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "msg/apps/guile-next"
depends_on "texinfo"
# Additional dependency
# resource "" do
# url ""
# sha256 ""
# end
def install
# Remove unrecognized options if they cause configure to fail
# https://rubydoc.brew.sh/Formula.html#std_configure_args-instance_method
ENV["GUILE_AUTO_COMPILE"] = "0"
# We need this so we can find other modules.
ENV["GUILE_LOAD_PATH"] = HOMEBREW_PREFIX/"share/guile/site/3.0"
ENV["GUILE_LOAD_COMPILED_PATH"] = HOMEBREW_PREFIX/"lib/guile/3.0/site-ccache"
ENV["GUILE_SYSTEM_EXTENSIONS_PATH"] = HOMEBREW_PREFIX/"lib/guile/3.0/extensions"
system "autoreconf", "-vif"
system "./configure", "--prefix=#{prefix}", "--libdir=#{prefix}/lib"
system "make"
system "make", "install"
# system "cmake", "-S", ".", "-B", "build", *std_cmake_args
end
def post_install
ENV["GUILE_AUTO_COMPILE"] = "0"
# We need this so we can find other modules.
ENV["GUILE_LOAD_PATH"] = HOMEBREW_PREFIX/"share/guile/site/3.0"
ENV["GUILE_LOAD_COMPILED_PATH"] = HOMEBREW_PREFIX/"lib/guile/3.0/site-ccache"
ENV["GUILE_SYSTEM_EXTENSIONS_PATH"] = HOMEBREW_PREFIX/"lib/guile/3.0/extensions"
system "guild", "compile", "-o", "#{prefix}/lib/guile/3.0/site-ccache/msg/machine.go", "#{prefix}/share/guile/site/3.0/msg/machine.scm"
end
def caveats
<<~EOS
Add the following to your .bashrc or equivalent:
export GUILE_LOAD_PATH="#{HOMEBREW_PREFIX}/share/guile/site/3.0"
export GUILE_LOAD_COMPILED_PATH="#{HOMEBREW_PREFIX}/lib/guile/3.0/site-ccache"
export GUILE_SYSTEM_EXTENSIONS_PATH="#{HOMEBREW_PREFIX}/lib/guile/3.0/extensions"
Then run the following to initialize msg:
msg machine init
EOS
end
test do
system "/opt/homebrew/bin/msg"
end
end