homebrew-core/Formula/quex.rb

43 lines
1.3 KiB
Ruby

class Quex < Formula
desc "Generate lexical analyzers"
homepage "https://quex.sourceforge.io/"
url "https://downloads.sourceforge.net/project/quex/quex-0.71.2.zip"
sha256 "0453227304a37497e247e11b41a1a8eb04bcd0af06a3f9d627d706b175a8a965"
license "MIT"
head "https://svn.code.sf.net/p/quex/code/trunk"
livecheck do
url :stable
regex(%r{url=.*?/quex[._-]v?(\d+(?:\.\d+)+)\.[tz]}i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "8e53508d74a86c0ec8decef4bf4233f197a8612168cee8707295e22a7ed05b8b"
sha256 cellar: :any_skip_relocation, all: "8e53508d74a86c0ec8decef4bf4233f197a8612168cee8707295e22a7ed05b8b"
end
depends_on "python@3.9"
def install
libexec.install "quex", "quex-exe.py"
doc.install "README", "demo"
# Use a shim script to set QUEX_PATH on the user's behalf
(bin/"quex").write <<~EOS
#!/bin/bash
QUEX_PATH="#{libexec}" "#{Formula["python@3.9"].opt_bin}/python3" "#{libexec}/quex-exe.py" "$@"
EOS
if build.head?
man1.install "doc/manpage/quex.1"
else
man1.install "manpage/quex.1"
end
end
test do
system bin/"quex", "-i", doc/"demo/C/01-Trivial/easy.qx", "-o", "tiny_lexer"
assert_predicate testpath/"tiny_lexer", :exist?
end
end