From 4e409b8e92644708d9f35b1c654e24863e63e2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Tue, 5 Mar 2024 08:39:00 -0800 Subject: [PATCH] nyacc: new version 1.09.3 --- Formula/nyacc.rb | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Formula/nyacc.rb diff --git a/Formula/nyacc.rb b/Formula/nyacc.rb new file mode 100644 index 0000000..1174ce2 --- /dev/null +++ b/Formula/nyacc.rb @@ -0,0 +1,46 @@ +class Nyacc < Formula + desc "Guile modules for generating parsers and lexical analyzers" + homepage "https://www.nongnu.org/nyacc/" + url "https://download.savannah.gnu.org/releases/nyacc/nyacc-1.09.3.tar.gz" + sha256 "068f31458e71ac7fc462f98ea134160002635c03df6ef1995b0b3eacc09e2a2b" + + bottle do + root_url "https://github.com/aconchillo/homebrew-guile/releases/download/nyacc-1.08.1" + sha256 cellar: :any_skip_relocation, x86_64_linux: "f280d5abe0dc43049456df3e7a798b17db3eff93216dc1e7a500496aae5d9810" + end + + depends_on "pkg-config" => :build + depends_on "texinfo" => :build + depends_on "guile" + depends_on "guile-bytestructures" + + def install + ENV["GUILE_AUTO_COMPILE"] = "0" + + 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 + nyacc = testpath/"nyacc.scm" + nyacc.write <<~EOS + (use-modules (nyacc parse)) + 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", nyacc + end +end