homebrew-apps/Formula/guile-config.rb

48 lines
1.8 KiB
Ruby

class GuileConfig < Formula
desc "Module for handling application configuration in a declarative way"
homepage "https://gitlab.com/a-sassmannshausen/guile-config/"
url "https://gitlab.com/api/v4/projects/7016362/repository/archive?sha=8a4f6442ac42084b00713dde3181c3538d52edbf"
sha256 "6e5099475e23dcab4253f8c59b113c1cf0cb250fb9709582af7a5b2902999698"
version "main"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "pkg-config" => :build
depends_on "texinfo" => :build
depends_on "msg/apps/guile-next"
def 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 "autoreconf", "-vif"
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
def caveats
<<~EOS
Remember to add the following to your .bashrc or equivalent in order to use this module:
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"
EOS
end
test do
config = testpath/"config.scm"
config.write <<~EOS
(use-modules (config))
EOS
ENV["GUILE_AUTO_COMPILE"] = "0"
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 "guile", config
end
end