icarus-verilog: depend on bison at build time

When iverilog is built with the macOS provided bison, it segfaults when
outputting certain syntax errors.

Closes .

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
Theodore Dubois 2018-04-17 21:52:54 -07:00 committed by ilovezfs
parent 23aaf022ae
commit 002c3eeae7

View file

@ -3,6 +3,7 @@ class IcarusVerilog < Formula
homepage "http://iverilog.icarus.com/"
url "ftp://icarus.com/pub/eda/verilog/v10/verilog-10.2.tar.gz"
sha256 "96dedbddb12d375edb45a144a926a3ba1e3e138d6598b18e7d79f2ae6de9e500"
revision 1
bottle do
sha256 "81e937d3d6a5f7b22271e79b73618e96db1e52ee491eaf3506671cfb5891c129" => :high_sierra
@ -15,12 +16,15 @@ class IcarusVerilog < Formula
depends_on "autoconf" => :build
end
# parser is subtly broken when processed with an old version of bison
depends_on "bison" => :build
def install
system "autoconf" if build.head?
system "./configure", "--prefix=#{prefix}"
# https://github.com/steveicarus/iverilog/issues/85
ENV.deparallelize
system "make", "install"
system "make", "install", "BISON=#{Formula["bison"].opt_bin}/bison"
end
test do
@ -35,5 +39,10 @@ class IcarusVerilog < Formula
EOS
system bin/"iverilog", "-otest", "test.v"
assert_equal "Boop", shell_output("./test").chomp
# test syntax errors do not cause segfaults
(testpath/"error.v").write "error;"
assert_equal "-:1: error: variable declarations must be contained within a module.",
shell_output("#{bin}/iverilog error.v 2>&1", 1).chomp
end
end